private void ShowInfo(int BrandId) { NoName.NetShop.BLL.BrandModelBll bll=new NoName.NetShop.BLL.BrandModelBll(); NoName.NetShop.Model.BrandModel model=bll.GetModel(BrandId); this.lblBrandName.Text=model.BrandName; this.lblCateId.Text=model.CateId.ToString(); this.lblCatePath.Text=model.CatePath; this.lblBrandLogo.Text=model.BrandLogo; this.lblBrief.Text=model.Brief; }
private void ShowInfo(int BrandId) { NoName.NetShop.BLL.BrandModelBll bll = new NoName.NetShop.BLL.BrandModelBll(); NoName.NetShop.Model.BrandModel model = bll.GetModel(BrandId); this.lblBrandName.Text = model.BrandName; this.lblCateId.Text = model.CateId.ToString(); this.lblCatePath.Text = model.CatePath; this.lblBrandLogo.Text = model.BrandLogo; this.lblBrief.Text = model.Brief; }
protected void btnAdd_Click(object sender, EventArgs e) { string strErr = ""; if (this.txtBrandName.Text == "") { strErr += "BrandName不能为空!\\n"; } if (!PageValidate.IsNumber(txtCateId.Text)) { strErr += "CateId不是数字!\\n"; } if (this.txtCatePath.Text == "") { strErr += "CatePath不能为空!\\n"; } if (this.txtBrandLogo.Text == "") { strErr += "BrandLogo不能为空!\\n"; } if (this.txtBrief.Text == "") { strErr += "Brief不能为空!\\n"; } if (strErr != "") { MessageBox.Show(this, strErr); return; } string BrandName = this.txtBrandName.Text; int CateId = int.Parse(this.txtCateId.Text); string CatePath = this.txtCatePath.Text; string BrandLogo = this.txtBrandLogo.Text; string Brief = this.txtBrief.Text; NoName.NetShop.Model.BrandModel model = new NoName.NetShop.Model.BrandModel(); model.BrandName = BrandName; model.CateId = CateId; model.CatePath = CatePath; model.BrandLogo = BrandLogo; model.Brief = Brief; NoName.NetShop.BLL.BrandModelBll bll = new NoName.NetShop.BLL.BrandModelBll(); bll.Update(model); }
protected void btnAdd_Click(object sender, EventArgs e) { string strErr=""; if(this.txtBrandName.Text =="") { strErr+="BrandName����Ϊ�գ�\\n"; } if(!PageValidate.IsNumber(txtCateId.Text)) { strErr+="CateId�������֣�\\n"; } if(this.txtCatePath.Text =="") { strErr+="CatePath����Ϊ�գ�\\n"; } if(this.txtBrandLogo.Text =="") { strErr+="BrandLogo����Ϊ�գ�\\n"; } if(this.txtBrief.Text =="") { strErr+="Brief����Ϊ�գ�\\n"; } if(strErr!="") { MessageBox.Show(this,strErr); return; } string BrandName=this.txtBrandName.Text; int CateId=int.Parse(this.txtCateId.Text); string CatePath=this.txtCatePath.Text; string BrandLogo=this.txtBrandLogo.Text; string Brief=this.txtBrief.Text; NoName.NetShop.Model.BrandModel model=new NoName.NetShop.Model.BrandModel(); model.BrandName=BrandName; model.CateId=CateId; model.CatePath=CatePath; model.BrandLogo=BrandLogo; model.Brief=Brief; NoName.NetShop.BLL.BrandModelBll bll=new NoName.NetShop.BLL.BrandModelBll(); bll.Update(model); }