Exemple #1
0
 //保存排序
 protected void btnSave_Click(object sender, EventArgs e)
 {
     ChkAdminLevel("weixin_sq", MXEnums.ActionEnum.Edit.ToString()); //检查权限
     BLL.wx_sq_act bll = new BLL.wx_sq_act();
     for (int i = 0; i < rptList.Items.Count; i++)
     {
         int id = Convert.ToInt32(((HiddenField)rptList.Items[i].FindControl("hidId")).Value);
         int sortId;
         if (!int.TryParse(((TextBox)rptList.Items[i].FindControl("txtSortId")).Text.Trim(), out sortId))
         {
             sortId = 99;
         }
         bll.UpdateField(id, "sort_id=" + sortId.ToString());
     }
     AddAdminLog(MXEnums.ActionEnum.Edit.ToString(), "保存产品库排序"); //记录日志
     JscriptMsg("保存排序成功!", "baseinfo.aspx", "Success");
 }
 //保存排序
 protected void btnSave_Click(object sender, EventArgs e)
 {
     ChkAdminLevel("weixin_sq", MXEnums.ActionEnum.Edit.ToString()); //检查权限
     BLL.wx_sq_act bll = new BLL.wx_sq_act();
     for (int i = 0; i < rptList.Items.Count; i++)
     {
         int id = Convert.ToInt32(((HiddenField)rptList.Items[i].FindControl("hidId")).Value);
         int sortId;
         if (!int.TryParse(((TextBox)rptList.Items[i].FindControl("txtSortId")).Text.Trim(), out sortId))
         {
             sortId = 99;
         }
         bll.UpdateField(id, "sort_id=" + sortId.ToString());
     }
     AddAdminLog(MXEnums.ActionEnum.Edit.ToString(), "保存产品库排序"); //记录日志
     JscriptMsg("保存排序成功!", "baseinfo.aspx", "Success");
 }
Exemple #3
0
        private void BindData()
        {
            BLL.wx_sq_act   actBll = new BLL.wx_sq_act();
            Model.wx_sq_act act    = actBll.GetModel(aid);
            if (act != null)
            {
                litBanner.Text = " <img src=\"" + act.bannerPic + "\">";
            }
            BLL.wx_sq_piclist pBll     = new BLL.wx_sq_piclist();
            string            whereStr = "";

            if (act.shenghe)
            {
                //需要审核
                whereStr = "aid=" + aid + " and hasShenghe=1";
            }
            else
            {
                //不需要审核
                whereStr = "aid=" + aid;
            }
            // IList<Model.wx_sq_piclist> plist = pBll.GetModelList(whereStr);
            DataSet artDs = pBll.GetList(20, this.page, whereStr, "createDate desc", out this.totalCount);

            rpPoto.DataSource = artDs;
            rpPoto.DataBind();
            //上一页
            if (this.page == 1)
            {
                aBefore.HRef = "javascript:;";
            }
            else
            {
                aBefore.HRef = MyCommFun.getWebSite() + "/weixin/shangqiang/index.aspx?wid=" + wid + "&aid=" + aid + "&openid=" + openid + "&p=" + (this.page - 1);
            }

            //下一页
            if (this.page == totalCount)
            {
                aAfter.HRef = "javascript:;";
            }
            else
            {
                aAfter.HRef = MyCommFun.getWebSite() + "/weixin/shangqiang/index.aspx?wid=" + wid + "&aid=" + aid + "&openid=" + openid + "&p=" + (this.page + 1);
            }
        }
        private void BindData()
        {
            BLL.wx_sq_act actBll = new BLL.wx_sq_act();
            Model.wx_sq_act act = actBll.GetModel(aid);
            if (act != null)
            {
                litBanner.Text = " <img src=\""+act.bannerPic+"\">";
            }
            BLL.wx_sq_piclist pBll = new BLL.wx_sq_piclist();
            string whereStr = "";
            if (act.shenghe)
            {
                //需要审核
                whereStr = "aid=" + aid + " and hasShenghe=1";
            }
            else
            { 
                //不需要审核
                whereStr = "aid=" + aid;
            }
           // IList<Model.wx_sq_piclist> plist = pBll.GetModelList(whereStr);
            DataSet artDs = pBll.GetList(20, this.page, whereStr, "createDate desc", out this.totalCount);
            rpPoto.DataSource = artDs;
            rpPoto.DataBind();
            //上一页
            if (this.page == 1)
            {
                aBefore.HRef = "javascript:;";
            }
            else
            {
                aBefore.HRef = MyCommFun.getWebSite() + "/weixin/shangqiang/index.aspx?wid="+wid+"&aid="+aid+"&openid="+openid+"&p="+(this.page-1);
            }

            //下一页
            if (this.page == totalCount)
            {
                aAfter.HRef = "javascript:;";
            }
            else
            {
                aAfter.HRef = MyCommFun.getWebSite() + "/weixin/shangqiang/index.aspx?wid=" + wid + "&aid=" + aid + "&openid="+openid+"&p=" + (this.page + 1);
            }
        
        }
Exemple #5
0
        //数据绑定
        private void RptBind()
        {
            BLL.wx_sq_act       bll     = new BLL.wx_sq_act();
            Model.wx_userweixin weixin  = GetWeiXinCode();
            DataSet             actlist = bll.GetList("wid=" + weixin.id);

            if (actlist != null && actlist.Tables.Count > 0 && actlist.Tables[0] != null && actlist.Tables[0].Rows.Count > 0)
            {
                DataRow dr;
                int     count = actlist.Tables[0].Rows.Count;
                for (int i = 0; i < count; i++)
                {
                    dr             = actlist.Tables[0].Rows[i];
                    dr["link_url"] = MyCommFun.getWebSite() + "/weixin/shangqiang/index.aspx?wid=" + weixin.id + "&aid=" + dr["id"].ToString();
                }
            }
            this.rptList.DataSource = actlist;
            this.rptList.DataBind();
        }
 //数据绑定
 private void RptBind()
 {
     BLL.wx_sq_act bll = new BLL.wx_sq_act();
     Model.wx_userweixin weixin = GetWeiXinCode();
     DataSet actlist = bll.GetList("wid="+weixin.id);
     if (actlist != null && actlist.Tables.Count > 0 && actlist.Tables[0] != null && actlist.Tables[0].Rows.Count > 0)
     {
         DataRow dr;
         int count = actlist.Tables[0].Rows.Count;
         for (int i = 0; i < count; i++)
         {
             dr = actlist.Tables[0].Rows[i];
             dr["link_url"] = MyCommFun.getWebSite() + "/weixin/shangqiang/index.aspx?wid="+weixin.id+"&aid="+dr["id"].ToString();
         
         }
     }
     this.rptList.DataSource = actlist;
     this.rptList.DataBind();
 }
Exemple #7
0
        /// <summary>
        /// 处理图片请求
        /// </summary>
        /// <param name="requestMessage"></param>
        /// <returns></returns>
        public override IResponseMessageBase OnImageRequest(RequestMessageImage requestMessage)
        {
            int apiid = 0;
            //   apiid = wxcomm.getApiid();
            WeiXCommFun wxFun = new WeiXCommFun();

            //查询微信上墙的活动,只取一条
            BLL.wx_sq_act   actBll = new BLL.wx_sq_act();
            Model.wx_sq_act act    = actBll.GetModel(apiid, DateTime.Now);
            if (act != null)
            {
                //查询是否在黑名单里
                BLL.wx_sq_heimd hBll    = new BLL.wx_sq_heimd();
                bool            isExist = hBll.Exists(requestMessage.FromUserName, act.id);
                if (isExist)
                {
                    //存在黑名单里
                    return(wxFun.GetResponseMessageTxtByContent(requestMessage, "您在黑名单里,无法上传图片", apiid));
                }
                else
                {
                    //说明有微信上墙活动
                    //1 将图片的地址保存到数据库
                    BLL.wx_sq_piclist   pBll = new BLL.wx_sq_piclist();
                    Model.wx_sq_piclist pic  = new Model.wx_sq_piclist();
                    pic.openid     = requestMessage.FromUserName;
                    pic.aid        = act.id;
                    pic.picUrl     = requestMessage.PicUrl;
                    pic.hasShenghe = false;
                    pic.createDate = DateTime.Now;
                    int ret = pBll.Add(pic);
                    //2返回提示语句

                    if (ret > 0)
                    {
                        string content = "";
                        if (act.shenghe)
                        {
                            content = "已经成功上传等待审核!<br/><a href=\"" + MyCommFun.getWebSite() + "/weixin/shangqiang/index.aspx?wid=" + apiid + "&aid=" + act.id + "\">查看相册</a>照片id为" + ret;
                        }
                        else
                        {
                            content = "已经成功上传点击查看<br/><a href=\"" + MyCommFun.getWebSite() + "/weixin/shangqiang/index.aspx?wid=" + apiid + "&aid=" + act.id + "\">查看相册</a>照片id为" + ret;
                        }
                        return(wxFun.GetResponseMessageTxtByContent(requestMessage, content, apiid));
                    }
                    else
                    {
                        return(wxFun.GetResponseMessageTxtByContent(requestMessage, "图片上传失败,请重新上传", apiid));
                    }
                }
            }
            else
            {
                var responseMessage = CreateResponseMessage <ResponseMessageNews>();
                responseMessage.Articles.Add(new Article()
                {
                    Title       = "这是你刚发送的图片",
                    Description = "您发送的图片将会显示在边上",
                    PicUrl      = requestMessage.PicUrl,
                    Url         = requestMessage.PicUrl
                });
                responseMessage.Articles.Add(new Article()
                {
                    Title       = "快速预约",
                    Description = "第二条带连接的内容",
                    PicUrl      = "http://www.hugongll.com/hugongll/dist/img/png/service01.png",
                    Url         = "http://www.hugongll.com/hugongll/index.aspx"
                });
                return(responseMessage);
                //   return wxFun.GetResponseMessageTxtByContent(requestMessage, "您刚刚上传了一个图片", apiid);
            }

            //var responseMessage = CreateResponseMessage<ResponseMessageNews>();
            //responseMessage.Articles.Add(new Article()
            //{
            //    Title = "您刚才发送了图片信息",
            //    Description = "您发送的图片将会显示在边上",
            //    PicUrl = requestMessage.PicUrl,
            //    Url = requestMessage.PicUrl
            //});
            //responseMessage.Articles.Add(new Article()
            //{
            //    Title = "第二条",
            //    Description = "第二条带连接的内容",
            //    PicUrl = requestMessage.PicUrl,
            //    Url = "http://www.yubom.net"
            //});
            //return responseMessage;
        }
Exemple #8
0
        /// <summary>
        /// 处理图片请求
        /// </summary>
        /// <param name="requestMessage"></param>
        /// <returns></returns>
        public override IResponseMessageBase OnImageRequest(RequestMessageImage requestMessage)
        {
            int apiid = wxcomm.getApiid();

            wxResponseBaseMgr.Add(apiid, requestMessage.FromUserName, requestMessage.MsgType.ToString(), requestMessage.PicUrl, "none", "", requestMessage.ToUserName);


            #region ==== 微拍 ===
            var responseMessage           = base.CreateResponseMessage <ResponseMessageText>();
            BLL.wx_paizhao_setting setBll = new BLL.wx_paizhao_setting();
            bool isOpen = setBll.isOpened(apiid);
            if (isOpen)
            {
                if (CurrentMessageContext.RequestMessages.Count > 1)
                {
                    string keywordStr = "";
                    for (int i = CurrentMessageContext.RequestMessages.Count - 2; i >= 0; i--)
                    {
                        var historyMessage = CurrentMessageContext.RequestMessages[i];
                        if (historyMessage.MsgType == RequestMsgType.Text)
                        {
                            keywordStr += (historyMessage as RequestMessageText).Content + ",";
                        }
                    }
                    threeInterface.weipaiInterface wxcf = new threeInterface.weipaiInterface();
                    if (wxcf.isWeipaiKeyWord(keywordStr, apiid))
                    {
                        //奥尔图的照片来拉
                        string content = wxcf.weipaiChuanTuPian(requestMessage.FromUserName, requestMessage.PicUrl, apiid);
                        responseMessage.Content = content;
                        return(responseMessage);
                    }
                }
            }

            #endregion

            #region 微信上墙
            WeiXCommFun wxFun = new WeiXCommFun();
            //查询微信上墙的活动,只取一条
            BLL.wx_sq_act   actBll = new BLL.wx_sq_act();
            Model.wx_sq_act act    = actBll.GetModel(apiid, DateTime.Now);
            if (act != null)
            {
                //查询是否在黑名单里
                BLL.wx_sq_heimd hBll    = new BLL.wx_sq_heimd();
                bool            isExist = hBll.Exists(requestMessage.FromUserName, act.id);
                if (isExist)
                {
                    //存在黑名单里
                    return(wxFun.GetResponseMessageTxtByContent(requestMessage, "您在黑名单里,无法上传图片", apiid));
                }
                else
                {
                    //说明有微信上墙活动
                    //1 将图片的地址保存到数据库
                    BLL.wx_sq_piclist   pBll = new BLL.wx_sq_piclist();
                    Model.wx_sq_piclist pic  = new Model.wx_sq_piclist();
                    pic.openid     = requestMessage.FromUserName;
                    pic.aid        = act.id;
                    pic.picUrl     = requestMessage.PicUrl;
                    pic.hasShenghe = false;
                    pic.createDate = DateTime.Now;
                    int ret = pBll.Add(pic);
                    //2返回提示语句

                    if (ret > 0)
                    {
                        string content = "";
                        if (act.shenghe)
                        {
                            if (act.shengheTip == null || act.shengheTip.Trim().Length <= 0)
                            {
                                content = "已经成功上传等待审核!<br/><a href=\"" + MyCommFun.getWebSite() + "/weixin/shangqiang/index.aspx?wid=" + apiid + "&aid=" + act.id + "\">查看相册</a>照片id为" + ret;
                            }
                            else
                            {
                                content = act.shengheTip;
                            }
                        }
                        else
                        {
                            if (act.noshengheTip == null || act.noshengheTip.Trim().Length <= 0)
                            {
                                content = "已经成功上传点击查看<br/><a href=\"" + MyCommFun.getWebSite() + "/weixin/shangqiang/index.aspx?wid=" + apiid + "&aid=" + act.id + "\">查看相册</a>照片id为" + ret;
                            }
                            else
                            {
                                content = act.noshengheTip;
                            }
                        }
                        return(wxFun.GetResponseMessageTxtByContent(requestMessage, content, apiid));
                    }
                    else
                    {
                        return(wxFun.GetResponseMessageTxtByContent(requestMessage, "图片上传失败,请重新上传", apiid));
                    }
                }
            }
            else
            {
                return(wxFun.GetResponseMessageTxtByContent(requestMessage, "您刚刚上传了一个图片", apiid));
            }

            #endregion

            //var responseMessage = CreateResponseMessage<ResponseMessageNews>();
            //responseMessage.Articles.Add(new Article()
            //{
            //    Title = "您刚才发送了图片信息",
            //    Description = "您发送的图片将会显示在边上",
            //    PicUrl = requestMessage.PicUrl,
            //    Url = requestMessage.PicUrl
            //});
            //responseMessage.Articles.Add(new Article()
            //{
            //    Title = "第二条",
            //    Description = "第二条带连接的内容",
            //    PicUrl = requestMessage.PicUrl,
            //    Url = "http://m.uweixin.cn"
            //});
            //return responseMessage;
        }