Exemple #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                int              id          = Convert.ToInt32(Request.Params["id"]);
                int              wid         = Convert.ToInt32(Request.Params["wid"]);
                string           txtKeywords = "";
                BLL.wx_vote_base gbll        = new BLL.wx_vote_base();
                gbll.Delete(id, wid);

                BLL.wx_vote_item itembll = new BLL.wx_vote_item();
                itembll.Delete(id);


                AddAdminLog(MXEnums.ActionEnum.Delete.ToString(), "删除投票,id为" + id); //记录日志
                JscriptMsg("删除成功!", Utils.CombUrlTxt("vote_list.aspx", "keywords={0}", txtKeywords), "Success");
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                int id = Convert.ToInt32( Request.Params["id"]);
                int wid = Convert.ToInt32(Request.Params["wid"]);
                string txtKeywords = "";
                BLL.wx_vote_base gbll = new BLL.wx_vote_base();
                gbll.Delete(id, wid);

                BLL.wx_vote_item itembll = new BLL.wx_vote_item();
                itembll.Delete(id);

                AddAdminLog(MXEnums.ActionEnum.Delete.ToString(), "删除投票,id为" + id); //记录日志
                JscriptMsg("删除成功!", Utils.CombUrlTxt("vote_list.aspx", "keywords={0}", txtKeywords), "Success");

            }
        }
Exemple #3
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            DateTime begin = DateTime.Parse(begindate.Text.Trim());
            DateTime end   = DateTime.Parse(enddate.Text.Trim());

            if (begin >= end)
            {
                JscriptMsg("开始时间必须小于结束时间", "back", "Error");
                return;
            }

            int id = Convert.ToInt32(Request.Params["id"]);

            BLL.wx_vote_base   basebll  = new BLL.wx_vote_base();
            Model.wx_vote_base votebase = new Model.wx_vote_base();
            votebase.id          = id;
            votebase.title       = this.title.Text.ToString();
            votebase.votepic     = this.votepic.Text.ToString();
            votebase.picdisplay  = Convert.ToBoolean(this.picdisplay.SelectedValue);
            votebase.votecontent = this.txtactContent.InnerText;
            votebase.isRadio     = Convert.ToBoolean(this.Radio.SelectedValue);
            if (this.begindate.Text.ToString() != "")
            {
                votebase.beginTime = Convert.ToDateTime(this.begindate.Text.ToString());
            }
            if (this.enddate.Text.ToString() != "")
            {
                votebase.endTime = Convert.ToDateTime(this.enddate.Text.ToString());
            }
            votebase.resultShowtype = Convert.ToInt32(this.resultShowtype.SelectedValue);
            votebase.actUrl         = this.actUrl.Text;
            votebase.voteType       = 1;
            basebll.Update(votebase);


            BLL.wx_vote_item   itembll  = new BLL.wx_vote_item();
            Model.wx_vote_item voteitem = new Model.wx_vote_item();


            // voteitem.sid=
            itembll.Delete(id);//删除
            //编辑

            int sid = 0;

            TextBox     xuanxtitle;
            TextBox     Sortid;
            HiddenField toupiaoTimes;

            for (int i = 1; i <= 6; i++)
            {
                xuanxtitle   = this.FindControl("xuanxtitle" + i) as TextBox;
                Sortid       = this.FindControl("Sortid" + i) as TextBox;
                toupiaoTimes = this.FindControl("toupiaoTimes" + i) as HiddenField;

                if (xuanxtitle.Text.Trim() != "" && Sortid.Text.Trim() != "" && MyCommFun.isNumber(Sortid.Text.Trim()))
                {
                    sid++;
                    voteitem.sid        = sid;
                    voteitem.baseid     = id;
                    voteitem.title      = xuanxtitle.Text.ToString();
                    voteitem.sort_id    = MyCommFun.Str2Int(Sortid.Text.ToString());
                    voteitem.createDate = DateTime.Now;
                    voteitem.tpTimes    = MyCommFun.Str2Int(toupiaoTimes.Value);
                    itembll.Add(voteitem);
                }
            }
            AddAdminLog(MXEnums.ActionEnum.Edit.ToString(), "修改文字投票,id为" + id); //记录日志
            JscriptMsg("修改成功!", Utils.CombUrlTxt("vote_list.aspx", "keywords={0}", ""), "Success");
        }
        protected void Button1_Click(object sender, EventArgs e)
        {


            DateTime begin = DateTime.Parse(begindate.Text.Trim());
            DateTime end = DateTime.Parse(enddate.Text.Trim());
            if (begin >= end)
            {
                JscriptMsg("开始时间必须小于结束时间", "back", "Error");
                return;
            }

            int id = Convert.ToInt32(Request.Params["id"]);
            BLL.wx_vote_base basebll = new BLL.wx_vote_base();
            Model.wx_vote_base votebase = new Model.wx_vote_base();
            votebase.id = id;
            votebase.title = this.title.Text.ToString();
            votebase.votepic = this.votepic.Text.ToString();
            votebase.picdisplay = Convert.ToBoolean(this.picdisplay.SelectedValue);
            votebase.votecontent = this.txtactContent.InnerText;
            votebase.isRadio =  Convert.ToBoolean(this.Radio.SelectedValue);
            if (this.begindate.Text.ToString()!="")
            {
            votebase.beginTime =  Convert.ToDateTime(  this.begindate.Text.ToString());
            }
            if (this.enddate.Text.ToString() != "")
            {
                votebase.endTime = Convert.ToDateTime(this.enddate.Text.ToString());
            }
            votebase.resultShowtype = Convert.ToInt32( this.resultShowtype.SelectedValue);
            votebase.actUrl = this.actUrl.Text;
            votebase.voteType = 1;
            basebll.Update(votebase);


            BLL.wx_vote_item itembll = new BLL.wx_vote_item();
            Model.wx_vote_item voteitem = new Model.wx_vote_item();
        
        
           // voteitem.sid=
            itembll.Delete(id);//删除
            //编辑

            int sid = 0;

            TextBox xuanxtitle;
            TextBox Sortid;
            HiddenField toupiaoTimes;

            for (int i = 1; i <= 6; i++)
            {
                xuanxtitle = this.FindControl("xuanxtitle" + i) as TextBox;
                Sortid = this.FindControl("Sortid" + i) as TextBox;
                toupiaoTimes = this.FindControl("toupiaoTimes" + i) as HiddenField;

                if (xuanxtitle.Text.Trim() != "" && Sortid.Text.Trim() != "" && MyCommFun.isNumber(Sortid.Text.Trim()))
                {
                    sid++;
                    voteitem.sid = sid;
                    voteitem.baseid =id;
                    voteitem.title = xuanxtitle.Text.ToString();
                    voteitem.sort_id = MyCommFun.Str2Int(Sortid.Text.ToString());
                    voteitem.createDate = DateTime.Now;
                    voteitem.tpTimes= MyCommFun.Str2Int( toupiaoTimes.Value);
                    itembll.Add(voteitem);
                }

            }
            AddAdminLog(MXEnums.ActionEnum.Edit.ToString(), "修改文字投票,id为" + id); //记录日志
            JscriptMsg("修改成功!", Utils.CombUrlTxt("vote_list.aspx", "keywords={0}", ""), "Success");
        }