Exemplo n.º 1
0
 protected void btnAdd_Click(object sender, EventArgs e)
 {
     if (string.IsNullOrWhiteSpace(this.txtName.Text))
     {
         MessageBox.ShowFailTip(this, Poll.ErrorFormsNameNull);
     }
     else if (string.IsNullOrWhiteSpace(this.txtDescription.Text))
     {
         MessageBox.ShowFailTip(this, Poll.ErrorFormsExplainNull);
     }
     else
     {
         string text = this.txtName.Text;
         string str2 = this.txtDescription.Text;
         Maticsoft.Model.Poll.Forms model = new Maticsoft.Model.Poll.Forms {
             Name = text,
             Description = str2
         };
         int num = new Maticsoft.BLL.Poll.Forms().Add(model);
         if (num > 0)
         {
             base.Response.Redirect("../Topics/Index.aspx?fid=" + num.ToString());
         }
         else
         {
             MessageBox.ShowFailTip(this, "保存失败!");
         }
     }
 }