Esempio 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, "保存失败!");
         }
     }
 }
Esempio n. 2
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();
     }
 }
Esempio n. 3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if ((!this.Page.IsPostBack && (base.Request.Params["fid"] != null)) && (base.Request.Params["fid"].Trim() != ""))
     {
         string str = base.Request.Params["fid"];
         int formID = Convert.ToInt32(str);
         Maticsoft.Model.Poll.Forms model = new Maticsoft.BLL.Poll.Forms().GetModel(formID);
         this.lblFormName.Text = model.Name;
         this.lblFormID.Text = model.FormID.ToString();
         Maticsoft.BLL.Poll.UserPoll poll = new Maticsoft.BLL.Poll.UserPoll();
         this.polluser = poll.GetUserByForm(0).ToString();
         this.formuser = poll.GetUserByForm(formID).ToString();
         this.BindData(formID);
     }
 }
Esempio n. 4
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!this.Page.IsPostBack)
     {
         if (!base.UserPrincipal.HasPermissionID(base.GetPermidByActID(this.Act_AddData)) && (base.GetPermidByActID(this.Act_AddData) != -1))
         {
             this.btnAdd.Visible = false;
         }
         if (!base.UserPrincipal.HasPermissionID(base.GetPermidByActID(this.Act_DelData)) && (base.GetPermidByActID(this.Act_DelData) != -1))
         {
             this.liDel.Visible = false;
             this.btnDelete.Visible = false;
         }
         string str = base.Request.Params["fid"];
         if (!string.IsNullOrWhiteSpace(str) && PageValidate.IsNumber(str))
         {
             Maticsoft.Model.Poll.Forms model = new Maticsoft.BLL.Poll.Forms().GetModel(Convert.ToInt32(str));
             if (model != null)
             {
                 this.lblFormID.Text = model.FormID.ToString();
                 this.Session["strWhereTopics"] = " FormID= " + model.FormID;
                 this.lblFormName.Text = model.Name;
             }
         }
         if ((this.Session["Style"] != null) && (this.Session["Style"].ToString() != ""))
         {
             string str2 = this.Session["Style"] + "xtable_bordercolorlight";
             if ((base.Application[str2] != null) && (base.Application[str2].ToString() != ""))
             {
                 this.gridView.BorderColor = ColorTranslator.FromHtml(base.Application[str2].ToString());
                 this.gridView.HeaderStyle.BackColor = ColorTranslator.FromHtml(base.Application[str2].ToString());
             }
         }
     }
 }