예제 #1
0
        /// <summary>
        /// 获取投票列表项目
        /// </summary>
        public void VoteListPage()
        {
            int ovtebase_id = MyCommFun.RequestInt("aid");

            //--=====begin: 将这个列表(文章类别)的基本信息展示出来 ====--
            Model.wx_vote_base voteBase = tDal.GetVoteBaseByWid(wid, ovtebase_id);
            this.Document.SetValue("voteBase", voteBase);
            string  whereStr = " baseid=" + ovtebase_id;
            DataSet voteList = new DataSet();

            if (ovtebase_id != 0)
            {
                DAL.wx_vote_item artDal = new DAL.wx_vote_item();
                voteList = artDal.GetList(whereStr);

                if (voteList != null && voteList.Tables.Count > 0 && voteList.Tables[0].Rows.Count > 0)
                {
                    DataRow dr;
                    for (int i = 0; i < voteList.Tables[0].Rows.Count; i++)
                    {
                        dr = voteList.Tables[0].Rows[i];
                        voteList.AcceptChanges();
                    }
                }
            }
            DAL.wx_vote_item tosum = new DAL.wx_vote_item();
            int votesum            = tosum.GetFieldSum("tpTimes", whereStr);

            this.Document.SetValue("voteList", voteList);
            this.Document.SetValue("votesum", votesum);
        }
예제 #2
0
 public void BindData(int wid, int aid, string openid)
 {
     //基本表信息
     BLL.wx_vote_base baseBll = new BLL.wx_vote_base();
     baseinfo = baseBll.GetModel(aid);
     if (baseinfo == null)
     {
         return;
     }
     //投票选项字符串设置\
     BLL.wx_vote_item itemBll = new BLL.wx_vote_item();
     IList<Model.wx_vote_item> itemlist = itemBll.GetModelList("baseid=" + baseinfo.id );
     if (itemlist == null || itemlist.Count <= 0)
     {
         return;
     }
     ItemListStr(itemlist,openid);
 }
예제 #3
0
        public void BindData(int wid, int aid, string openid)
        {
            //基本表信息
            BLL.wx_vote_base baseBll = new BLL.wx_vote_base();
            baseinfo = baseBll.GetModel(aid);
            if (baseinfo == null)
            {
                return;
            }
            //投票选项字符串设置\
            BLL.wx_vote_item           itemBll  = new BLL.wx_vote_item();
            IList <Model.wx_vote_item> itemlist = itemBll.GetModelList("baseid=" + baseinfo.id);

            if (itemlist == null || itemlist.Count <= 0)
            {
                return;
            }
            ItemListStr(itemlist, openid);
        }
예제 #4
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="source"></param>
 /// <param name="e"></param>
 protected void rptList_ItemCommand(object source, RepeaterCommandEventArgs e)
 {
     switch (e.CommandName)
     {
     case "end":
     {
         int id = int.Parse(e.CommandArgument.ToString());
         Model.wx_vote_base baseinfo = gbll.GetModel(id);
         if (baseinfo.endTime <= DateTime.Now)
         {
         }
         else
         {
             gbll.UpdateField(id, "endTime='" + DateTime.Now + "'");
         }
     }
     break;
     }
     JscriptMsg("操作成功", Utils.CombUrlTxt("vote_list.aspx", "typeid={0}&keywords={1}", ddlProperty.SelectedValue, this.txtKeywords.Text), "Success");
 }
예제 #5
0
파일: index.aspx.cs 프로젝트: yidane/51wine
        public void BindData(int wid, int aid, string openid)
        {
            //基本表信息
            BLL.wx_vote_base          baseBll = new BLL.wx_vote_base();
            List <Model.wx_vote_base> mlist   = baseBll.GetModelList(string.Format(" id={0} and wid={1} ", aid, wid));

            if (mlist.Count <= 0 || mlist == null)
            {
                return;
            }
            baseinfo = mlist[0];
            //投票选项字符串设置
            BLL.wx_vote_item           itemBll  = new BLL.wx_vote_item();
            IList <Model.wx_vote_item> itemlist = itemBll.GetModelList("baseid=" + baseinfo.id);

            if (itemlist == null || itemlist.Count <= 0)
            {
                return;
            }
            ItemListStr(itemlist, openid);
        }
예제 #6
0
        /// <summary>
        /// 获得投票信息
        /// </summary>
        /// <param name="wid"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Model.wx_vote_base GetVoteBaseByWid(int wid, int id)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select top 1");
            strSql.Append(" * ");
            strSql.Append(" from wx_vote_base  where   id=@id  and wId=@wId");
            SqlParameter[] parameters =
            {
                new SqlParameter("@id",  SqlDbType.Int, 4),
                new SqlParameter("@wId", SqlDbType.Int, 4)
            };
            parameters[0].Value = id;
            parameters[1].Value = wid;
            SqlDataReader sr = DbHelperSQL.ExecuteReader(strSql.ToString(), parameters);

            Model.wx_vote_base category = new Model.wx_vote_base();
            while (sr.Read())
            {
                category                = new Model.wx_vote_base();
                category.id             = MyCommFun.Obj2Int(sr["id"]);
                category.title          = MyCommFun.ObjToStr(sr["title"]);
                category.votepic        = MyCommFun.ObjToStr(sr["votepic"]);
                category.picdisplay     = MyCommFun.ObjBool(sr["picdisplay"]);
                category.votecontent    = MyCommFun.ObjToStr(sr["votecontent"]);
                category.isRadio        = MyCommFun.ObjBool(sr["isRadio"]);
                category.beginTime      = MyCommFun.Obj2DateTime(sr["beginTime"]);
                category.endTime        = MyCommFun.Obj2DateTime(sr["endTime"]);
                category.resultShowtype = MyCommFun.Obj2Int(sr["resultShowtype"]);
                category.actUrl         = MyCommFun.ObjToStr(sr["actUrl"]);
                category.voteType       = MyCommFun.Obj2Int(sr["voteType"]);
                category.sort_id        = MyCommFun.Obj2Int(sr["sort_id"]);
                category.creatDate      = MyCommFun.Obj2DateTime(sr["creatDate"]);
            }
            sr.Close();

            return(category);
        }
예제 #7
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;
            }


            //base表
            Model.wx_userweixin weixin = GetWeiXinCode();
            int wid = weixin.id;

            BLL.wx_vote_base votebaseBll = new BLL.wx_vote_base();

            Model.wx_vote_base votebase = new Model.wx_vote_base();
            votebase.wid         = wid;
            votebase.title       = this.title.Text.ToString();
            votebase.votepic     = this.votepic.Text.ToString();
            votebase.picdisplay  = Convert.ToBoolean(this.picdisplay.SelectedValue); //是否显示在投票页面
            votebase.votecontent = this.txtactContent.InnerText.ToString();          //投票说明
            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         = "";
            votebase.voteType       = 1;//文本投票
            votebase.creatDate      = DateTime.Now;

            votebase.actUrl = MyCommFun.getWebSite() + "/admin/vote/vote_list.aspx?wid=" + wid + "&aid=";
            int baseid = votebaseBll.Add(votebase);



            //item表
            BLL.wx_vote_item voteitemBll = new BLL.wx_vote_item();

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


            int sid = 0;

            TextBox xuanxtitle;
            TextBox Sortid;
            int     totJxNum = 0;

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

                if (xuanxtitle.Text.Trim() != "" && Sortid.Text.Trim() != "" && MyCommFun.isNumber(Sortid.Text.Trim()))
                {
                    totJxNum++;
                }
            }

            decimal avgDeg = (decimal)360.0 / (totJxNum + 1);

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

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


            // createDate


            AddAdminLog(MXEnums.ActionEnum.Delete.ToString(), "增加文字投票,id为" + baseid); //记录日志
            JscriptMsg("添加成功", "vote_list.aspx", "Success");
        }
예제 #8
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");
        }
예제 #10
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;
            }

            //base表
            Model.wx_userweixin weixin = GetWeiXinCode();
            int wid = weixin.id;

            BLL.wx_vote_base votebaseBll = new BLL.wx_vote_base();

            Model.wx_vote_base votebase = new Model.wx_vote_base();
            votebase.wid = wid;
            votebase.title = this.title.Text.ToString();
            votebase.votepic = this.votepic.Text.ToString();
            votebase.picdisplay = Convert.ToBoolean(this.picdisplay.SelectedValue);//是否显示在投票页面
            votebase.votecontent = this.txtactContent.InnerText.ToString();//投票说明
            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 = "";
            votebase.voteType = 1;//文本投票
            votebase.creatDate = DateTime.Now;

            votebase.actUrl = MyCommFun.getWebSite() + "/admin/vote/vote_list.aspx?wid=" + wid + "&aid=";
            int baseid = votebaseBll.Add(votebase);

            //item表
            BLL.wx_vote_item voteitemBll = new BLL.wx_vote_item();

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

               int  sid = 0;

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

               if (xuanxtitle.Text.Trim() != "" && Sortid.Text.Trim() != "" && MyCommFun.isNumber(Sortid.Text.Trim()))
               {
                   totJxNum++;
               }
               }

               decimal avgDeg = (decimal)360.0 / (totJxNum + 1);

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

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

               }

               // createDate

               AddAdminLog(MXEnums.ActionEnum.Delete.ToString(), "增加文字投票,id为" + baseid); //记录日志
            JscriptMsg("添加成功", "vote_list.aspx", "Success");
        }