Example #1
0
 private void ShowInfo(int _id)
 {
     BLL.comment bll = new BLL.comment();
     model = bll.GetModel(_id);
     txtReContent.Text = Utils.ToTxt(model.reply_content);
     rblIsLock.SelectedValue = model.is_lock.ToString();
 }
Example #2
0
 private void ShowInfo(int _id)
 {
     BLL.comment bll = new BLL.comment();
     model                   = bll.GetModel(_id);
     txtReContent.Text       = Utils.ToTxt(model.reply_content);
     rblIsLock.SelectedValue = model.is_lock.ToString();
 }
        private void comment_add(HttpContext context)
        {
            Model.siteconfig siteConfig = new BLL.siteconfig().loadConfig(Utils.GetXmlMapPath(DTKeys.FILE_SITE_XML_CONFING));
            StringBuilder    strTxt     = new StringBuilder();

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

            string _code       = DTRequest.GetFormString("txtCode");
            int    _channel_id = DTRequest.GetQueryInt("channel_id");
            int    _content_id = DTRequest.GetQueryInt("content_id");
            string _title      = DTRequest.GetFormString("txtTitle");
            string _content    = DTRequest.GetFormString("txtContent");

            //校检验证码
            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 (_channel_id == 0 || _content_id == 0)
            {
                context.Response.Write("{msg: 0, msgbox: \"对不起,参数传输有误!\"}");
                return;
            }
            if (string.IsNullOrEmpty(_content))
            {
                context.Response.Write("{msg: 0, msgbox: \"对不起,请输入评论的内容!\"}");
                return;
            }

            model.channel_id = _channel_id;
            model.content_id = _content_id;
            model.title      = _title;
            model.content    = Utils.ToHtml(_content);
            model.user_name  = "游客";
            model.user_ip    = DTRequest.GetIP();
            model.is_lock    = siteConfig.commentstatus; //审核开关
            model.add_time   = DateTime.Now;
            model.is_reply   = 0;
            if (bll.Add(model) > 0)
            {
                context.Response.Write("{msg: 1, msgbox: \"恭喜您,留言提交成功啦!\"}");
                return;
            }
            context.Response.Write("{msg: 0, msgbox: \"对不起,保存过程中发生错误!\"}");
            return;
        }
        private void comment_add(HttpContext context)
        {
            Model.siteconfig siteConfig = new BLL.siteconfig().loadConfig(Utils.GetXmlMapPath(DTKeys.FILE_SITE_XML_CONFING));
            StringBuilder strTxt = new StringBuilder();
            BLL.comment bll = new BLL.comment();
            Model.comment model = new Model.comment();

            string _code = DTRequest.GetFormString("txtCode");
            int _channel_id = DTRequest.GetQueryInt("channel_id");
            int _content_id = DTRequest.GetQueryInt("content_id");
            string _title = DTRequest.GetFormString("txtTitle");
            string _content = DTRequest.GetFormString("txtContent");

            //校检验证码
            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 (_channel_id == 0 || _content_id == 0)
            {
                context.Response.Write("{msg: 0, msgbox: \"对不起,参数传输有误!\"}");
                return;
            }
            if (string.IsNullOrEmpty(_content))
            {
                context.Response.Write("{msg: 0, msgbox: \"对不起,请输入评论的内容!\"}");
                return;
            }

            model.channel_id = _channel_id;
            model.content_id = _content_id;
            model.title = _title;
            model.content = Utils.ToHtml(_content);
            model.user_name = "游客";
            model.user_ip = DTRequest.GetIP();
            model.is_lock = siteConfig.commentstatus; //审核开关
            model.add_time = DateTime.Now;
            model.is_reply = 0;
            if (bll.Add(model) > 0)
            {
                context.Response.Write("{msg: 1, msgbox: \"恭喜您,留言提交成功啦!\"}");
                return;
            }
            context.Response.Write("{msg: 0, msgbox: \"对不起,保存过程中发生错误!\"}");
            return;
        }
Example #5
0
 //保存
 protected void btnSubmit_Click(object sender, EventArgs e)
 {
     BLL.comment bll = new BLL.comment();
     model = bll.GetModel(this.id);
     model.is_reply = 1;
     model.reply_content = Utils.ToHtml(txtReContent.Text);
     model.is_lock = int.Parse(rblIsLock.SelectedValue);
     model.reply_time = DateTime.Now;
     bll.Update(model);
     JscriptMsg("评论回复成功啦!", "list.aspx?channel_id=" + model.channel_id, "Success");
 }
Example #6
0
 //保存
 protected void btnSubmit_Click(object sender, EventArgs e)
 {
     BLL.comment bll = new BLL.comment();
     model               = bll.GetModel(this.id);
     model.is_reply      = 1;
     model.reply_content = Utils.ToHtml(txtReContent.Text);
     model.is_lock       = int.Parse(rblIsLock.SelectedValue);
     model.reply_time    = DateTime.Now;
     bll.Update(model);
     JscriptMsg("评论回复成功啦!", "list.aspx?channel_id=" + model.channel_id, "Success");
 }
Example #7
0
        public bool UploadComment(string text)
        {
            bool result = false;

            if (text == "")
            {
                return(result);
            }
            var activityID = Convert.ToInt32(Request.QueryString["actID"]);
            var model      = new Model.comment();

            model.actID  = activityID;
            model.userID = Common.User.GetUserID(Session["Username"].ToString());
            model.time   = DateTime.Now;
            model.text   = text;
            new BLL.comment().Add(model);
            result = true;
            return(result);
        }