private void ShowInfo(int CateId) { NoName.NetShop.BLL.CategoryModelBll bll=new NoName.NetShop.BLL.CategoryModelBll(); NoName.NetShop.Model.CategoryModel model=bll.GetModel(CateId); this.lblCateName.Text=model.CateName; this.lblCatePath.Text=model.CatePath; this.lblStatus.Text=model.Status.ToString(); this.lblPriceRange.Text=model.PriceRange; this.chkIsHide.Checked=model.IsHide; this.lblCateLevel.Text=model.CateLevel.ToString(); }
private void ShowInfo(int CateId) { NoName.NetShop.BLL.CategoryModelBll bll = new NoName.NetShop.BLL.CategoryModelBll(); NoName.NetShop.Model.CategoryModel model = bll.GetModel(CateId); this.lblCateName.Text = model.CateName; this.lblCatePath.Text = model.CatePath; this.lblStatus.Text = model.Status.ToString(); this.lblPriceRange.Text = model.PriceRange; this.chkIsHide.Checked = model.IsHide; this.lblCateLevel.Text = model.CateLevel.ToString(); }
protected void btnAdd_Click(object sender, EventArgs e) { string strErr = ""; if (this.txtCateName.Text == "") { strErr += "CateName不能为空!\\n"; } if (this.txtCatePath.Text == "") { strErr += "CatePath不能为空!\\n"; } if (!PageValidate.IsNumber(txtStatus.Text)) { strErr += "Status不是数字!\\n"; } if (this.txtPriceRange.Text == "") { strErr += "PriceRange不能为空!\\n"; } if (!PageValidate.IsNumber(txtCateLevel.Text)) { strErr += "CateLevel不是数字!\\n"; } if (strErr != "") { MessageBox.Show(this, strErr); return; } string CateName = this.txtCateName.Text; string CatePath = this.txtCatePath.Text; int Status = int.Parse(this.txtStatus.Text); string PriceRange = this.txtPriceRange.Text; bool IsHide = this.chkIsHide.Checked; int CateLevel = int.Parse(this.txtCateLevel.Text); NoName.NetShop.Model.CategoryModel model = new NoName.NetShop.Model.CategoryModel(); model.CateName = CateName; model.CatePath = CatePath; model.Status = Status; model.PriceRange = PriceRange; model.IsHide = IsHide; model.CateLevel = CateLevel; NoName.NetShop.BLL.CategoryModelBll bll = new NoName.NetShop.BLL.CategoryModelBll(); bll.Update(model); }
protected void btnAdd_Click(object sender, EventArgs e) { string strErr=""; if(this.txtCateName.Text =="") { strErr+="CateName����Ϊ�գ�\\n"; } if(this.txtCatePath.Text =="") { strErr+="CatePath����Ϊ�գ�\\n"; } if(!PageValidate.IsNumber(txtStatus.Text)) { strErr+="Status�������֣�\\n"; } if(this.txtPriceRange.Text =="") { strErr+="PriceRange����Ϊ�գ�\\n"; } if(!PageValidate.IsNumber(txtCateLevel.Text)) { strErr+="CateLevel�������֣�\\n"; } if(strErr!="") { MessageBox.Show(this,strErr); return; } string CateName=this.txtCateName.Text; string CatePath=this.txtCatePath.Text; int Status=int.Parse(this.txtStatus.Text); string PriceRange=this.txtPriceRange.Text; bool IsHide=this.chkIsHide.Checked; int CateLevel=int.Parse(this.txtCateLevel.Text); NoName.NetShop.Model.CategoryModel model=new NoName.NetShop.Model.CategoryModel(); model.CateName=CateName; model.CatePath=CatePath; model.Status=Status; model.PriceRange=PriceRange; model.IsHide=IsHide; model.CateLevel=CateLevel; NoName.NetShop.BLL.CategoryModelBll bll=new NoName.NetShop.BLL.CategoryModelBll(); bll.Update(model); }