예제 #1
0
 protected void btnSave_Click(object sender, EventArgs e)
 {
     Tz888.BLL.Mail.IndustryBLL bll   = new Tz888.BLL.Mail.IndustryBLL();
     Tz888.Model.Mail.Industry  model = new Tz888.Model.Mail.Industry();
     if (txtName.Text.Trim() == "")
     {
         Response.Write("<script>alert('请输入行业名称!')</script>");
         return;
     }
     model.Name   = txtName.Text.Trim();
     model.IsShow = Convert.ToInt32(this.rbtIsShow.SelectedValue.Trim());
     if (Convert.ToString(ViewState["sk"]) == "add")
     {
         int result = bll.Add(model);
         if (result > 0)
         {
             Tz888.Common.MessageBox.ShowAndHref("录入成功", "IndustryManage.aspx");
         }
         else
         {
             Response.Write("<script>alert('已经存在该行业!')</script>");
         }
     }
     else
     {
         int red = bll.Update(model, Convert.ToInt32(ViewState["sdt"]));
         if (red >= 0)
         {
             Tz888.Common.MessageBox.ShowAndHref("审核成功", "IndustryManage.aspx");
         }
         else
         {
             Tz888.Common.MessageBox.Show(this.Page, "审核失败");
         }
     }
 }