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,
             IsActive = this.chkIsActive.Checked
         };
         Maticsoft.BLL.Poll.Forms forms2 = new Maticsoft.BLL.Poll.Forms();
         if (forms2.Add(model) > 0)
         {
             MessageBox.ShowSuccessTip(this, Site.TooltipAddSuccess);
         }
         else
         {
             MessageBox.ShowFailTip(this, Site.TooltipSaveError);
         }
         this.gridView.OnBind();
     }
 }