protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         /*判断员工是否已经登陆了系统*/
         if (Session["employeeFlag"] == null)
         {
             Response.Write("<script>top.location.href='../login.aspx';</script>");
             return;
         }
         /*取得更新商品的商品编号*/
         string goodNo = Request.QueryString["goodNo"];
         /*调用业务层根据商品编号得到商品的信息并保存在模型中*/
         GoodInfoModel goodInfoModel = GoodLogic.GetGoodInfoByNo(goodNo);
         /*显示该商品的各个信息*/
         this.GoodNo.Text        = goodInfoModel.GoodNo;
         this.GoodClassName.Text = GoodClassLogic.GetGoodClassNameById(goodInfoModel.GoodClassId);
         this.GoodName.Text      = goodInfoModel.GoodName;
         this.GoodUnit.Text      = goodInfoModel.GoodUnit;
         this.GoodModel.Text     = goodInfoModel.GoodModel;
         this.GoodSpecs.Text     = goodInfoModel.GoodSpecs;
         this.GoodPrice.Text     = goodInfoModel.GoodPrice.ToString();
         this.GoodPlace.Text     = goodInfoModel.GoodPlace;
         this.GoodMemo.Text      = goodInfoModel.GoodMemo;
     }
 }
Esempio n. 2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            /*判断管理员是否已经登陆了系统*/
            if (Session["adminFlag"] == null)
            {
                Response.Write("<script>top.location.href='../login.aspx';</script>");
                return;
            }
            /*查询所有商品类别,初始化商品类别信息下拉框控件*/
            DataSet goodClassDs = GoodClassLogic.QueryAllGoodClassInfo();
            this.GoodClassId.Items.Add(new ListItem("请选择商品类别", "0"));
            for (int i = 0; i < goodClassDs.Tables[0].Rows.Count; i++)
            {
                DataRow dr = goodClassDs.Tables[0].Rows[i];
                this.GoodClassId.Items.Add(new ListItem(dr["goodClassName"].ToString(), dr["goodClassId"].ToString()));
            }

            this.GridView1.DataSourceID = null;
            this.GridView1.DataSource   = BuyInfoLogic.QueryBuyInfo("", "", 0, "", "");
            this.GridView1.DataBind();
            this.TotalPrice.Text = BuyInfoLogic.QueryBuyInfoTotalPrice("", "", 0, "", "").ToString();
        }
    }
Esempio n. 3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         /*判断管理员是否已经登陆了系统*/
         if (Session["adminFlag"] == null)
         {
             Response.Write("<script>top.location.href='../login.aspx';</script>");
             return;
         }
         DataSet goodClassDs = GoodClassLogic.QueryAllGoodClassInfo();
         for (int i = 0; i < goodClassDs.Tables[0].Rows.Count; i++)
         {
             DataRow dr = goodClassDs.Tables[0].Rows[i];
             this.GoodClassId.Items.Add(new ListItem(dr["goodClassName"].ToString(), dr["goodClassId"].ToString()));
         }
         /*取得更新商品的商品编号*/
         string goodNo = Request.QueryString["goodNo"];
         /*调用业务层根据商品编号得到商品的信息并保存在模型中*/
         GoodInfoModel goodInfoModel = GoodLogic.GetGoodInfoByNo(goodNo);
         /*显示该商品的各个信息*/
         this.GoodNo.Text = goodInfoModel.GoodNo;
         this.GoodClassId.SelectedValue = goodInfoModel.GoodClassId.ToString();
         this.GoodName.Text             = goodInfoModel.GoodName;
         this.GoodUnit.Text             = goodInfoModel.GoodUnit;
         this.GoodModel.Text            = goodInfoModel.GoodModel;
         this.GoodSpecs.Text            = goodInfoModel.GoodSpecs;
         this.GoodPrice.Text            = goodInfoModel.GoodPrice.ToString();
         this.GoodPlace.Text            = goodInfoModel.GoodPlace;
         this.GoodMemo.Text             = goodInfoModel.GoodMemo;
     }
 }
    protected void Btn_Add_Click(object sender, EventArgs e)
    {
        GoodClassModel goodClassModel = new GoodClassModel();   /*构建商品类型模型*/

        goodClassModel.GoodClassName = this.GoodClassName.Text; /*取得商品类别名称*/
        GoodClassLogic goodClassLogic = new GoodClassLogic();

        if (goodClassLogic.AddGoodClassInfo(goodClassModel))
        {
            Response.Write("<script>alert('商品类别信息添加成功!');location.href='GoodClassAdd.aspx';</script>");
        }
        else
        {
            Response.Write("<script>alert('" + goodClassLogic.ErrMessage + "');location.href='GoodClassAdd.aspx';</script>");
        }
    }
Esempio n. 5
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         /*判断管理员或员工是否已经登陆了系统*/
         if (Session["adminFlag"] == null && Session["employeeFlag"] == null)
         {
             Response.Write("<script>top.location.href='../login.aspx';</script>");
             return;
         }
         this.GoodClassId.Items.Clear();
         this.GoodClassId.Items.Add(new ListItem("请选择类别", "0"));
         DataSet goodClassDs = GoodClassLogic.QueryAllGoodClassInfo();
         for (int i = 0; i < goodClassDs.Tables[0].Rows.Count; i++)
         {
             DataRow dr = goodClassDs.Tables[0].Rows[i];
             this.GoodClassId.Items.Add(new ListItem(dr["goodClassName"].ToString(), dr["goodClassId"].ToString()));
         }
     }
 }