Пример #1
0
        private void RptBind(string _strWhere, string _orderby)
        {
            Model.wx_userweixin weixin = GetWeiXinCode();

            this.page = MXRequest.GetQueryInt("page", 1);

            this.txtKeywords.Text = this.keywords;
            //图表或列表显示
            BLL.wx_qp_base bll = new BLL.wx_qp_base();

            _strWhere = "wid=" + weixin.id + " and " + _strWhere;
            DataSet ds = bll.GetList(this.pageSize, this.page, _strWhere, _orderby, out this.totalCount);

            if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
            {
                DataRow dr;
                int     cout = ds.Tables[0].Rows.Count;
                for (int i = 0; i < cout; i++)
                {
                    dr             = ds.Tables[0].Rows[i];
                    dr["link_url"] = "<a href=\"javascript:;\">" + MyCommFun.getWebSite() + "/weixin/qiangpiao/index.aspx?wid=" + MyCommFun.ObjToStr(dr["wid"]) + "&aid=" + dr["id"].ToString() + "</a>";
                }
                ds.AcceptChanges();
            }
            this.rptList1.DataSource = ds;
            this.rptList1.DataBind();

            //绑定页码
            txtPageNum.Text = this.pageSize.ToString();
            string pageUrl = Utils.CombUrlTxt("action_list.aspx", "keywords={0}&page={1}", this.keywords, "__id__");

            PageContent.InnerHtml = Utils.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8);
        }
Пример #2
0
        private void BindData()
        {
            BLL.wx_qp_img             imgBLl    = new BLL.wx_qp_img();
            BLL.wx_qp_base            actBll    = new BLL.wx_qp_base();
            BLL.wx_qp_users           usersBll  = new BLL.wx_qp_users();
            Model.wx_qp_base          baseModel = actBll.GetModelList(" id=" + aid)[0];
            IList <Model.wx_qp_users> userList  = usersBll.GetModelList(string.Format(" openid='{0}' and bId={1}", openid, aid));

            //判断活动是否过期
            if (baseModel.actEnd < DateTime.Now || baseModel.actBegin > DateTime.Now)
            {
                ErrLevel  = 1;
                ErrorInfo = "此活动时间不对,很遗憾!";
                return;
            }
            if (userList.Count > 0)
            {
                ErrLevel  = 1;
                ErrorInfo = "你已参加过活动,每人只能参加一次!";
                return;
            }

            //轮播图片
            this.rptImglist.DataSource = imgBLl.GetList(" bId=" + aid + " and iType=3 ");
            if (imgBLl.GetList(" bId=" + aid + " and iType=3 ").Tables[0].Rows.Count <= 0)
            {
                mark = "no";
            }
            this.rptImglist.DataBind();
            this.rptNum.DataSource = imgBLl.GetList(" bId=" + aid + " and iType=3 ");
            this.rptNum.DataBind();

            this.Page.Title     = baseModel.bName;
            this.ltrUserxz.Text = baseModel.qpRemark;
        }
Пример #3
0
        //批量删除
        protected void btnDelete_Click(object sender, EventArgs e)
        {
            ChkAdminLevel("qiaopiao", MXEnums.ActionEnum.Delete.ToString()); //检查权限
            int sucCount   = 0;                                              //成功数量
            int errorCount = 0;                                              //失败数量

            BLL.wx_qp_base bll     = new BLL.wx_qp_base();
            Repeater       rptList = new Repeater();

            rptList = this.rptList1;

            for (int i = 0; i < rptList.Items.Count; i++)
            {
                int      id = Convert.ToInt32(((HiddenField)rptList.Items[i].FindControl("hidId")).Value);
                CheckBox cb = (CheckBox)rptList.Items[i].FindControl("chkId");
                if (cb.Checked)
                {
                    if (bll.Delete(id))
                    {
                        sucCount++;
                    }
                    else
                    {
                        errorCount++;
                    }
                }
            }
            AddAdminLog(MXEnums.ActionEnum.Edit.ToString(), "删除抢票活动基本表成功" + sucCount + "条,失败" + errorCount + "条"); //记录日志
            JscriptMsg("删除成功" + sucCount + "条,失败" + errorCount + "条!", Utils.CombUrlTxt("action_list.aspx", "keywords={0}", this.keywords), "Success");
        }
Пример #4
0
        /// <summary>
        /// 电影院抢票
        /// </summary>
        /// <param name="id"></param>
        /// <param name="apiid"></param>
        /// <param name="openid"></param>
        /// <returns></returns>
        private IList <Model.ResponseContentEntity> DDYQPReponse(int id, int apiid, string openid)
        {
            IList <Model.ResponseContentEntity> responselist = new List <Model.ResponseContentEntity>();

            Model.ResponseContentEntity responseEntity = new Model.ResponseContentEntity();
            responseEntity.id  = id;
            responseEntity.wid = apiid;

            BLL.wx_qp_base   ggkActBll = new BLL.wx_qp_base();
            Model.wx_qp_base actModel  = ggkActBll.GetModel(id);
            if (actModel.actBegin > DateTime.Now)
            {  //活动尚未开始
                responseEntity.rcType   = Model.ReponseContentType.text;
                responseEntity.rContent = "活动【" + actModel.bName + "】将于" + actModel.actBegin + "开始。";
            }
            else if (actModel.actEnd <= DateTime.Now)
            {
                //活动结束
                responseEntity.rcType   = Model.ReponseContentType.text;
                responseEntity.rContent = "活动已经结束了。";
            }
            else
            {
                //活动正在进行中
                responseEntity.rcType    = Model.ReponseContentType.txtpic;
                responseEntity.rContent  = actModel.bName;
                responseEntity.rContent2 = "";
                responseEntity.detailUrl = MyCommFun.getWebSite() + "/weixin/qiangpiao/index.aspx?wid=" + apiid + "&aid=" + id;
                responseEntity.picUrl    = actModel.beginPic;
            }
            responselist.Add(responseEntity);

            return(responselist);
        }
Пример #5
0
        private void RptBind()
        {
            BLL.wx_qp_img  imgBll  = new BLL.wx_qp_img();
            BLL.wx_qp_base baseBll = new BLL.wx_qp_base();
            BLL.wx_qp_film filmBll = new BLL.wx_qp_film();
            //得到抢票活动相关信息
            IList <Model.wx_qp_base> qblist = baseBll.GetModelList("wid=" + wid + " and id=" + aid);

            if (qblist == null || qblist.Count <= 0)
            {
                return;
            }

            Model.wx_qp_base qpBase = qblist[0];
            litFilmhb.Text = "<img src=\"" + qpBase.haibaoPic + "\">";
            actName        = qpBase.bName;
            litJies.Text   = "<span>" + qpBase.yyRemark + "</span>";

            //得到所有热映电影
            DataSet ds = filmBll.GetList("bid=" + aid + " order by sort_id asc,id desc");

            this.rptList.DataSource = ds;
            this.rptList.DataBind();

            //得到所有影院图片
            DataSet imgDs = imgBll.GetList(4, "bId=" + aid + " and iType=2 ", "id desc");

            this.rptImg.DataSource = imgDs;
            this.rptImg.DataBind();
        }
Пример #6
0
 protected void Page_Load(object sender, EventArgs e)
 {
     BLL.wx_qp_base actBll = new BLL.wx_qp_base();
     openid = MyCommFun.RequestOpenid();
     wid    = MyCommFun.RequestWid();
     aid    = MyCommFun.RequestInt("aid");
     if (aid == 0 || wid == 0 || openid.Trim() == "loseopenid" || !actBll.Exists(aid))
     {
         ErrLevel  = 1;
         ErrorInfo = "访问参数错误!";
         return;
     }
     BindData();
 }
Пример #7
0
        private void TreeBind()
        {
            //Model.wx_userweixin weixin = GetWeiXinCode();
            BLL.wx_qp_base bll = new BLL.wx_qp_base();
            DataTable      dt  = bll.GetList("id>0").Tables[0];

            this.ddlCategoryId.Items.Clear();
            this.ddlCategoryId.Items.Add(new ListItem("请选择活动...", ""));
            foreach (DataRow dr in dt.Rows)
            {
                string Id    = dr["id"].ToString();
                string Title = dr["bName"].ToString().Trim();
                this.ddlCategoryId.Items.Add(new ListItem(Title, Id));
            }

            ddlCategoryId.SelectedValue = category_id.ToString();
        }
Пример #8
0
        private void ckState()
        {
            BLL.wx_qp_base            actBll    = new BLL.wx_qp_base();
            BLL.wx_qp_users           userBll   = new BLL.wx_qp_users();
            Model.wx_qp_base          baseModel = actBll.GetModel(aid);
            IList <Model.wx_qp_users> userList  = userBll.GetModelList(" openid='" + openid + "' and bId=" + aid);

            Model.wx_qp_users userModel = null;
            string            gpTime    = DateTime.Parse(baseModel.yyGouPiaoBeginDate.ToString()).ToString("MM月dd日-HH:mm") +
                                          "~" + DateTime.Parse(baseModel.yyGouPiaoEndDate.ToString()).ToString("MM月dd日-HH:mm");

            if (userList != null && userList.Count > 0)
            {
                userModel = userList[0];
            }

            string Fulltext = "<h1><i class=\"text-icon\">✔</i>已有" + baseModel.maxPersonNum + "人抢到票啦!</h1>" +
                              "<dl class=\"list\">" +
                              "<dd class=\"dd-padding\">特价票已售完即止!</dd>" +
                              "<dd class=\"dd-padding\">请抓紧时间购票把!</dd>" +
                              "<dd class=\"dd-padding\">购票时间:" + gpTime + "</dd></dl><br />";

            //活动人数已满
            if (baseModel.cyPersonNum > baseModel.maxPersonNum)
            {
                this.litFull.Text = Fulltext;
                return;
            }

            //非法用户
            if (userModel == null)
            {
                if (baseModel.cyPersonNum == baseModel.maxPersonNum)//最后一个用户
                {
                    this.litFull.Text = Fulltext;
                }
                else
                {
                    Response.Redirect(string.Format("index.aspx?wid={0}&aid={1}&openid={2}", wid, aid, openid));
                }
                return;
            }

            //第一次参与活动
            if (joined == "true")
            {
                string snNum = userModel.sn;
                this.litShow.Text = "<h1><i class=\"text-icon\">✔</i>您是第" + baseModel.cyPersonNum + "位参加本次抢票!</h1>" +
                                    "<dl class=\"list\">" +
                                    "<dd class=\"dd-padding\">您的sn码:" + snNum + " </dd>" +
                                    "<dd class=\"dd-padding\">购票时间:" + gpTime + "</dd></dl><br />";
                return;
            }//已参与过本次活动,不可以再参加
            else if (joined == "false")
            {
                string snNum = userModel.sn;
                this.litJoined.Text = "<h1><i class=\"text-icon\">✔</i>您已成功参加本次抢票!</h1>" +
                                      "<dl class=\"list\">" +
                                      "<dd class=\"dd-padding\">您的sn码:" + snNum + " </dd>" +
                                      "<dd class=\"dd-padding\">购票时间:" + gpTime + "</dd></dl><br />";
                return;
            }
        }