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