Пример #1
0
        protected void btnAdd_Click(object sender, EventArgs e)
        {
            string BrandId    = this.txtBrandId.Text;
            string Name       = this.txtName.Text;
            string Descn      = this.txtDescn.Text;
            string CategoryId = DropCategory.SelectedValue;


            Maticsoft.Model.Brand model = new Maticsoft.Model.Brand();
            model.BrandId    = BrandId;
            model.Name       = Name;
            model.Descn      = Descn;
            model.CategoryId = CategoryId;
            Maticsoft.BLL.Products.Brand bll = new Maticsoft.BLL.Products.Brand();
            if (bll.Exists(BrandId))
            {
                lblMsg.Visible = true;
                lblMsg.Text    = "±àºÅÒѾ­´æÔÚ£¡";
            }
            else
            {
                bll.Add(model);
                if (chkAddContinue.Checked)
                {
                    Response.Redirect("Add.aspx");
                }
                else
                {
                    Response.Redirect("index.aspx");
                }
            }
        }
Пример #2
0
        protected void btnAdd_Click(object sender, EventArgs e)
        {
            string BrandId = this.txtBrandId.Text;
            string Name = this.txtName.Text;
            string Descn = this.txtDescn.Text;
            string CategoryId = DropCategory.SelectedValue;


            Maticsoft.Model.Brand model = new Maticsoft.Model.Brand();
            model.BrandId = BrandId;
            model.Name = Name;
            model.Descn = Descn;
            model.CategoryId = CategoryId;
            Maticsoft.BLL.Products.Brand bll = new Maticsoft.BLL.Products.Brand();
            if (bll.Exists(BrandId))
            {
                lblMsg.Visible = true;
                lblMsg.Text = "±àºÅÒѾ­´æÔÚ£¡";
            }
            else
            {
                bll.Add(model);
                if (chkAddContinue.Checked)
                {
                    Response.Redirect("Add.aspx");
                }
                else
                {
                    Response.Redirect("index.aspx");
                }
            }

        }