Exemplo n.º 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                string txtKeywords       = "";
                string openid            = Request.Params["openId"];
                BLL.wx_message_list gbll = new BLL.wx_message_list();
                gbll.Deleteopenid(openid);


                BLL.wx_message_blacklist gbllblack = new BLL.wx_message_blacklist();
                Model.wx_userweixin      weixin    = GetWeiXinCode();
                int      wid      = weixin.id;
                DateTime datetime = DateTime.Now;

                //拉黑记录
                BLL.wx_message_blacklist   settingBll = new BLL.wx_message_blacklist();
                Model.wx_message_blacklist setting    = new Model.wx_message_blacklist();
                setting.wid       = wid;
                setting.openid    = openid;
                setting.blacktime = datetime;
                settingBll.Add(setting);

                // AddAdminLog(MXEnums.ActionEnum.Delete.ToString(), ""); //记录日志
                AddAdminLog(MXEnums.ActionEnum.Add.ToString(), "增加黑名单,openid为" + openid); //记录日志
                JscriptMsg("拉黑成功!", Utils.CombUrlTxt("message_list.aspx", "keywords={0}", txtKeywords), "Success");
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                string txtKeywords = "";
                string openid = Request.Params["openId"];
                BLL.wx_message_list gbll = new BLL.wx_message_list();
                gbll.Deleteopenid(openid);


                BLL.wx_message_blacklist gbllblack = new BLL.wx_message_blacklist();
                Model.wx_userweixin weixin = GetWeiXinCode();
                int wid = weixin.id;
                DateTime datetime = DateTime.Now;

                //拉黑记录
                BLL.wx_message_blacklist settingBll = new BLL.wx_message_blacklist();
                Model.wx_message_blacklist setting = new Model.wx_message_blacklist();
                setting.wid = wid;
                setting.openid = openid;
                setting.blacktime = datetime;
                settingBll.Add(setting);

               // AddAdminLog(MXEnums.ActionEnum.Delete.ToString(), ""); //记录日志
                AddAdminLog(MXEnums.ActionEnum.Add.ToString(), "增加黑名单,openid为" + openid); //记录日志
                JscriptMsg("拉黑成功!", Utils.CombUrlTxt("message_list.aspx", "keywords={0}", txtKeywords), "Success");
            }
            
        }
Exemplo n.º 3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                int    wid                    = Convert.ToInt32(Request.Params["wid"]);
                string openid                 = Request.Params["openid"];
                string txtKeywords            = "";
                BLL.wx_message_blacklist gbll = new BLL.wx_message_blacklist();
                gbll.Deleteblack(wid, openid);

                AddAdminLog(MXEnums.ActionEnum.Delete.ToString(), "删除黑名单,openid" + openid); //记录日志
                JscriptMsg("取消黑名单成功!", Utils.CombUrlTxt("BlackManage.aspx", "keywords={0}", txtKeywords), "Success");
            }
        }
Exemplo n.º 4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                int wid = Convert.ToInt32(Request.Params["wid"]);
                string openid = Request.Params["openid"];
                string txtKeywords = "";
                BLL.wx_message_blacklist gbll = new BLL.wx_message_blacklist();
                gbll.Deleteblack(wid, openid);

                AddAdminLog(MXEnums.ActionEnum.Delete.ToString(), "删除黑名单,openid" + openid); //记录日志
                JscriptMsg("取消黑名单成功!", Utils.CombUrlTxt("BlackManage.aspx", "keywords={0}", txtKeywords), "Success");
            }
        }
Exemplo n.º 5
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/json";
            string _action = MyCommFun.QueryString("myact");
            string openid  = MyCommFun.RequestOpenid(); //得到微信用户的openid
            Dictionary <string, string> jsonDict = new Dictionary <string, string>();

            //黑名单权限openid


            BLL.wx_message_blacklist blackBll = new BLL.wx_message_blacklist();

            if (_action == "commit")
            {
                //留言



                if (blackBll.ExistsByOpenid(openid))
                {
                    jsonDict.Add("ret", "fail");
                    jsonDict.Add("content", "留言失败");

                    context.Response.Write(MyCommFun.getJsonStr(jsonDict));

                    return;
                }
                else
                {
                    int    wid      = MyCommFun.RequestInt("wid");
                    string nickname = MyCommFun.QueryString("nickname");
                    string info     = MyCommFun.QueryString("info");
                    bool   hasSH    = Convert.ToBoolean(MyCommFun.QueryString("hasSH"));

                    BLL.wx_message_list   mBll    = new BLL.wx_message_list();
                    Model.wx_message_list message = new Model.wx_message_list();
                    message.wid        = wid;
                    message.title      = info;
                    message.userName   = nickname;
                    message.createDate = DateTime.Now;
                    message.openId     = openid;
                    message.parentId   = 0;
                    if (hasSH)
                    {
                        message.hasSH = false;
                    }
                    else
                    {
                        message.hasSH = true;
                    }
                    mBll.Add(message);

                    //AddAdminLog(MXEnums.ActionEnum.Add.ToString(), ""); //记录日志


                    jsonDict.Add("ret", "ok");
                    jsonDict.Add("content", "留言成功");

                    context.Response.Write(MyCommFun.getJsonStr(jsonDict));
                }
            }
            //回复
            if (_action == "setly")
            {
                if (blackBll.ExistsByOpenid(openid))
                {
                    jsonDict.Add("ret", "fail");
                    jsonDict.Add("content", "留言失败");

                    context.Response.Write(MyCommFun.getJsonStr(jsonDict));

                    return;
                }
                else
                {
                    int    wid                    = MyCommFun.RequestInt("wid");
                    string info                   = MyCommFun.QueryString("info");
                    bool   hasSH                  = Convert.ToBoolean(MyCommFun.QueryString("hasSH"));
                    int    parentid               = MyCommFun.RequestInt("parentid");
                    string nickname               = MyCommFun.QueryString("nickname");
                    BLL.wx_message_list   mBll    = new BLL.wx_message_list();
                    Model.wx_message_list message = new Model.wx_message_list();
                    message.wid        = wid;
                    message.title      = info;
                    message.userName   = nickname;
                    message.createDate = DateTime.Now;
                    message.openId     = openid;
                    message.parentId   = parentid;

                    if (hasSH)
                    {
                        message.hasSH = false;
                    }
                    else
                    {
                        message.hasSH = true;
                    }
                    mBll.Add(message);

                    //AddAdminLog(MXEnums.ActionEnum.Add.ToString(), ""); //记录日志


                    jsonDict.Add("ret", "ok");
                    jsonDict.Add("content", "回复成功");

                    context.Response.Write(MyCommFun.getJsonStr(jsonDict));
                }
            }
        }
Exemplo n.º 6
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/json";
            string _action = MyCommFun.QueryString("myact");
            string openid = MyCommFun.RequestOpenid();  //得到微信用户的openid
            Dictionary<string, string> jsonDict = new Dictionary<string, string>();

            //黑名单权限openid

            BLL.wx_message_blacklist blackBll = new BLL.wx_message_blacklist();

            if (_action == "commit")
            {
                //留言

                if (blackBll.ExistsByOpenid(openid))
                {
                    jsonDict.Add("ret", "fail");
                    jsonDict.Add("content", "留言失败");

                    context.Response.Write(MyCommFun.getJsonStr(jsonDict));

                    return;
                }
                else
                {

                    int wid = MyCommFun.RequestInt("wid");
                    string nickname = MyCommFun.QueryString("nickname");
                    string info = MyCommFun.QueryString("info");
                    bool hasSH = Convert.ToBoolean(MyCommFun.QueryString("hasSH"));

                    BLL.wx_message_list mBll = new BLL.wx_message_list();
                    Model.wx_message_list message = new Model.wx_message_list();
                    message.wid = wid;
                    message.title = info;
                    message.userName = nickname;
                    message.createDate = DateTime.Now;
                    message.openId = openid;
                    message.parentId = 0;
                    if (hasSH)
                    {
                        message.hasSH = false;
                    }
                    else
                    {
                        message.hasSH = true;
                    }
                    mBll.Add(message);

                    //AddAdminLog(MXEnums.ActionEnum.Add.ToString(), ""); //记录日志

                    jsonDict.Add("ret", "ok");
                    jsonDict.Add("content", "留言成功");

                    context.Response.Write(MyCommFun.getJsonStr(jsonDict));

                }
            }
            //回复
            if (_action == "setly")
            {
                if (blackBll.ExistsByOpenid(openid))
                {
                    jsonDict.Add("ret", "fail");
                    jsonDict.Add("content", "留言失败");

                    context.Response.Write(MyCommFun.getJsonStr(jsonDict));

                    return;
                }
                else
                {

                    int wid = MyCommFun.RequestInt("wid");
                    string info = MyCommFun.QueryString("info");
                    bool hasSH = Convert.ToBoolean(MyCommFun.QueryString("hasSH"));
                    int parentid = MyCommFun.RequestInt("parentid");
                    string nickname = MyCommFun.QueryString("nickname");
                    BLL.wx_message_list mBll = new BLL.wx_message_list();
                    Model.wx_message_list message = new Model.wx_message_list();
                    message.wid = wid;
                    message.title = info;
                    message.userName = nickname;
                    message.createDate = DateTime.Now;
                    message.openId = openid;
                    message.parentId = parentid;

                    if (hasSH)
                    {
                        message.hasSH = false;
                    }
                    else
                    {
                        message.hasSH = true;
                    }
                    mBll.Add(message);

                    //AddAdminLog(MXEnums.ActionEnum.Add.ToString(), ""); //记录日志

                    jsonDict.Add("ret", "ok");
                    jsonDict.Add("content", "回复成功");

                    context.Response.Write(MyCommFun.getJsonStr(jsonDict));
                }
            }
        }