protected void btntype_Click(object sender, EventArgs e) { if (txtaddtype.Text.Trim() == "") { lbladdtype.Text = "请填写服务类型"; return; } Maticsoft.BLL.NicheTypeInfo typebll = new Maticsoft.BLL.NicheTypeInfo(); Maticsoft.Model.NicheTypeInfo typemodel = new Maticsoft.Model.NicheTypeInfo(); typemodel.NicheTypeTitle = txtaddtype.Text.Trim(); typebll.Add(typemodel); Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<SCRIPT>alert('信息提交成功)</SCRIPT>"); }
protected void btnNiche_Click(object sender, EventArgs e) { Maticsoft.BLL.NicheTypeInfo nichebll = new Maticsoft.BLL.NicheTypeInfo(); Maticsoft.Model.NicheTypeInfo nichemodel = new Maticsoft.Model.NicheTypeInfo(); if (txtNiche.Text.Trim() == "") { Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('请将填写完整!')</script>"); return; } nichemodel.NicheTypeTitle = txtNiche.Text.Trim(); nichebll.Add(nichemodel); Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('信息添加成功!')</script>"); txtNiche.Text = string.Empty; }
protected void btnSave_Click(object sender, EventArgs e) { string strErr = ""; if (this.txtNicheTypeTitle.Text.Trim().Length == 0) { strErr += "NicheTypeTitle不能为空!\\n"; } if (strErr != "") { MessageBox.Show(this, strErr); return; } string NicheTypeTitle = this.txtNicheTypeTitle.Text; Maticsoft.Model.NicheTypeInfo model = new Maticsoft.Model.NicheTypeInfo(); model.NicheTypeTitle = NicheTypeTitle; Maticsoft.BLL.NicheTypeInfo bll = new Maticsoft.BLL.NicheTypeInfo(); bll.Add(model); Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "add.aspx"); }