Exemple #1
0
        private void feedback_add(HttpContext context)
        {
            StringBuilder strTxt = new StringBuilder();

            BLL.feedback   bll   = new BLL.feedback();
            Model.feedback model = new Model.feedback();

            string _site_path  = DTRequest.GetQueryString("site");
            string _code       = DTRequest.GetFormString("txtCode");
            string _title      = DTRequest.GetFormString("txtTitle");
            string _content    = DTRequest.GetFormString("txtContent");
            string _user_name  = DTRequest.GetFormString("txtUserName");
            string _user_tel   = DTRequest.GetFormString("txtUserTel");
            string _user_qq    = DTRequest.GetFormString("txtUserQQ");
            string _user_email = DTRequest.GetFormString("txtUserEmail");

            //检查站点目录
            if (string.IsNullOrEmpty(_site_path))
            {
                context.Response.Write("{\"status\":0, \"msg\":\"对不起,网站传输参数有误!\"}");
                return;
            }
            //校检验证码
            //if (string.IsNullOrEmpty(_code))
            //{
            //    context.Response.Write("{\"status\":0, \"msg\":\"对不起,请输入验证码!\"}");
            //    return;
            //}
            //if (context.Session[DTKeys.SESSION_CODE] == null)
            //{
            //    context.Response.Write("{\"status\":0, \"msg\":\"对不起,验证码已过期!\"}");
            //    return;
            //}
            //if (_code.ToLower() != (context.Session[DTKeys.SESSION_CODE].ToString()).ToLower())
            //{
            //    context.Response.Write("{\"status\":0, \"msg\":\"验证码与系统的不一致!\"}");
            //    return;
            //}
            if (string.IsNullOrEmpty(_content))
            {
                context.Response.Write("{\"status\": 0, \"msg\": \"对不起,请输入留言的内容!\"}");
                return;
            }
            model.site_path  = Utils.DropHTML(_site_path);
            model.title      = Utils.DropHTML(_title);
            model.content    = Utils.ToHtml(_content);
            model.user_name  = Utils.DropHTML(_user_name);
            model.user_tel   = Utils.DropHTML(_user_tel);
            model.user_qq    = Utils.DropHTML(_user_qq);
            model.user_email = Utils.DropHTML(_user_email);
            model.add_time   = DateTime.Now;
            model.is_lock    = 1; //不需要审核,请改为0
            if (bll.Add(model) > 0)
            {
                context.Response.Write("{\"status\": 1, \"msg\": \"恭喜您,留言提交成功!\"}");
                return;
            }
            context.Response.Write("{\"status\": 0, \"msg\": \"对不起,保存过程中发生错误!\"}");
            return;
        }
Exemple #2
0
        private void feedback_add(HttpContext context)
        {
            StringBuilder strTxt = new StringBuilder();
            BLL.feedback bll = new BLL.feedback();
            Model.feedback model = new Model.feedback();

            string _site_path = DTRequest.GetQueryString("site");
            string _code = DTRequest.GetFormString("txtCode");
            string _title = DTRequest.GetFormString("txtTitle");
            string _content = DTRequest.GetFormString("txtContent");
            string _user_name = DTRequest.GetFormString("txtUserName");
            string _user_tel = DTRequest.GetFormString("txtUserTel");
            string _user_qq = DTRequest.GetFormString("txtUserQQ");
            string _user_email = DTRequest.GetFormString("txtUserEmail");

            //检查站点目录
            if (string.IsNullOrEmpty(_site_path))
            {
                context.Response.Write("{\"status\":0, \"msg\":\"对不起,网站传输参数有误!\"}");
                return;
            }
            //校检验证码
            if (string.IsNullOrEmpty(_code))
            {
                context.Response.Write("{\"status\":0, \"msg\":\"对不起,请输入验证码!\"}");
                return;
            }
            if (context.Session[DTKeys.SESSION_CODE] == null)
            {
                context.Response.Write("{\"status\":0, \"msg\":\"对不起,验证码已过期!\"}");
                return;
            }
            if (_code.ToLower() != (context.Session[DTKeys.SESSION_CODE].ToString()).ToLower())
            {
                context.Response.Write("{\"status\":0, \"msg\":\"验证码与系统的不一致!\"}");
                return;
            }
            if (string.IsNullOrEmpty(_content))
            {
                context.Response.Write("{\"status\": 0, \"msg\": \"对不起,请输入留言的内容!\"}");
                return;
            }
            model.site_path = Utils.DropHTML(_site_path);
            model.title = Utils.DropHTML(_title);
            model.content = Utils.ToHtml(_content);
            model.user_name = Utils.DropHTML(_user_name);
            model.user_tel = Utils.DropHTML(_user_tel);
            model.user_qq = Utils.DropHTML(_user_qq);
            model.user_email = Utils.DropHTML(_user_email);
            model.add_time = DateTime.Now;
            model.is_lock = 1; //不需要审核,请改为0
            if (bll.Add(model) > 0)
            {
                context.Response.Write("{\"status\": 1, \"msg\": \"恭喜您,留言提交成功!\"}");
                return;
            }
            context.Response.Write("{\"status\": 0, \"msg\": \"对不起,保存过程中发生错误!\"}");
            return;
        }
Exemple #3
0
        private void feedback_add(HttpContext context)
        {
            StringBuilder strTxt = new StringBuilder();

            BLL.feedback   bll   = new BLL.feedback();
            Model.feedback model = new Model.feedback();

            string _code       = DTRequest.GetFormString("txtCode");
            string _title      = DTRequest.GetFormString("txtTitle");
            string _content    = DTRequest.GetFormString("txtContent");
            string _user_name  = DTRequest.GetFormString("txtUserName");
            string _user_tel   = DTRequest.GetFormString("txtUserTel");
            string _user_qq    = DTRequest.GetFormString("txtUserQQ");
            string _user_email = DTRequest.GetFormString("txtUserEmail");

            //校检验证码
            if (string.IsNullOrEmpty(_code))
            {
                context.Response.Write("{msg:0, msgbox:\"对不起,请输入验证码!\"}");
                return;
            }
            if (context.Session[DTKeys.SESSION_CODE] == null)
            {
                context.Response.Write("{msg:0, msgbox:\"对不起,系统找不到生成的验证码!\"}");
                return;
            }
            if (_code.ToLower() != (context.Session[DTKeys.SESSION_CODE].ToString()).ToLower())
            {
                context.Response.Write("{msg:0, msgbox:\"您输入的验证码与系统的不一致!\"}");
                return;
            }
            if (string.IsNullOrEmpty(_content))
            {
                context.Response.Write("{msg: 0, msgbox: \"对不起,请输入留言的内容!\"}");
                return;
            }

            model.title      = _title;
            model.content    = Utils.ToHtml(_content);
            model.user_name  = _user_name;
            model.user_tel   = _user_tel;
            model.user_qq    = _user_qq;
            model.user_email = _user_email;
            model.add_time   = DateTime.Now;
            model.is_lock    = 1; //不需要审核,请改为0
            if (bll.Add(model) > 0)
            {
                context.Response.Write("{msg: 1, msgbox: \"恭喜您,留言提交成功啦!\"}");
                return;
            }
            context.Response.Write("{msg: 0, msgbox: \"对不起,保存过程中发生错误!\"}");
            return;
        }
        private void feedback_add(HttpContext context)
        {
            StringBuilder strTxt = new StringBuilder();
            BLL.feedback bll = new BLL.feedback();
            Model.feedback model = new Model.feedback();

            string _code = DTRequest.GetFormString("txtCode");
            string _title = DTRequest.GetFormString("txtTitle");
            string _content = DTRequest.GetFormString("txtContent");
            string _user_name = DTRequest.GetFormString("txtUserName");
            string _user_tel = DTRequest.GetFormString("txtUserTel");
            string _user_qq = DTRequest.GetFormString("txtUserQQ");
            string _user_email = DTRequest.GetFormString("txtUserEmail");

            //校检验证码
            if (string.IsNullOrEmpty(_code))
            {
                context.Response.Write("{msg:0, msgbox:\"对不起,请输入验证码!\"}");
                return;
            }
            if (context.Session[DTKeys.SESSION_CODE] == null)
            {
                context.Response.Write("{msg:0, msgbox:\"对不起,系统找不到生成的验证码!\"}");
                return;
            }
            if (_code.ToLower() != (context.Session[DTKeys.SESSION_CODE].ToString()).ToLower())
            {
                context.Response.Write("{msg:0, msgbox:\"您输入的验证码与系统的不一致!\"}");
                return;
            }
            if (string.IsNullOrEmpty(_content))
            {
                context.Response.Write("{msg: 0, msgbox: \"对不起,请输入留言的内容!\"}");
                return;
            }

            model.title = _title;
            model.content = Utils.ToHtml(_content);
            model.user_name = _user_name;
            model.user_tel = _user_tel;
            model.user_qq = _user_qq;
            model.user_email = _user_email;
            model.add_time = DateTime.Now;
            model.is_lock = 1; //不需要审核,请改为0
            if (bll.Add(model) > 0)
            {
                context.Response.Write("{msg: 1, msgbox: \"恭喜您,留言提交成功啦!\"}");
                return;
            }
            context.Response.Write("{msg: 0, msgbox: \"对不起,保存过程中发生错误!\"}");
            return;
        }