Admin/SPXXEdit.aspx.cs

(开头部分) 4KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.IO;

public partial class Admin_SPXXEdit : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        // 在此处放置用户代码以初始化页面
        if (!Page.IsPostBack)
        {
            //绑定类别列表
            this.drSPFL.DataTextField = "类别名称";
            this.drSPFL.DataValueField = "代码";
            this.drSPFL.DataSource = DataBase.Get_Table("select * from 药品类别");
            this.drSPFL.DataBind();

            Session.Remove("imgname");
            if (Request.QueryString["ID"] != null)
            {
                //显示当前的药品信息
                DataTable tmpda = new DataTable();
                tmpda = DataBase.Get_Table("select * from 药品信息 where 代码=" + Request.QueryString["ID"]);
                if (tmpda.Rows.Count > 0)
                {
                    this.txtSPMC.Text = tmpda.Rows[0]["名称"].ToString();
                    this.txtMS.Text = tmpda.Rows[0]["保质期"].ToString();
                    Image1.ImageUrl = "../image/" + tmpda.Rows[0]["图片"].ToString();
                    Session["imgname"] = tmpda.Rows[0]["图片"].ToString();
                    this.txtSJ.Text = tmpda.Rows[0]["价格"].ToString();
                    this.txtGG.Text = tmpda.Rows[0]["批号"].ToString();
                    this.txtJLDW.Text = tmpda.Rows[0]["生产日期"].ToString();
                    this.drSPFL.SelectedValue = tmpda.Rows[0]["类别代码"].ToString();
                    this.rdLB.SelectedValue = tmpda.Rows[0]["分类"].ToString();
                }
            }
        }

    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        //判断信息是否正确
        if (this.txtSPMC.Text.Trim() == "")
        {
            Page.ClientScript.RegisterStartupScript(this.GetType(), "info", "<script>alert('药品名称不能为空!');</script>");            
            return;
        }

        //将相关的图片上传到@"Image\"路径下
        string FileName = "";
        string FileName1;
        string DPath;
后面还有 45 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。