예제 #1
0
파일: list.aspx.cs 프로젝트: WayLeeLi/tea2
        private void RptBind(string _strWhere, string _orderby)
        {
            if (!int.TryParse(Request.QueryString["page"] as string, out this.page))
            {
                this.page = 1;
            }
            this.txtKeywords.Text = this.keywords;
            if (Status > -1)
            {
                this.ddlPaymentStatus.SelectedValue = Status.ToString();
            }
            txtdate.SelectedValue = data;
            txtbegin.Text         = begin;
            txtend.Text           = end;

            //Response.Write(_strWhere);

            BLL.feedback bll = new BLL.feedback();
            this.rptList.DataSource = bll.GetList(this.pageSize, this.page, _strWhere, _orderby, out this.totalCount);
            this.rptList.DataBind();
            //綁定頁碼
            txtPageNum.Text = this.pageSize.ToString();
            string pageUrl = Utils.CombUrlTxt("list.aspx", "keywords={0}&page={1}&Status={2}&data={3}&begin={4}&end={5}", this.keywords, "__id__", Status.ToString(), data, begin, end);

            PageContent.InnerHtml = Utils.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8);
        }
예제 #2
0
        //批量删除
        protected void lbtnDelete_Click(object sender, EventArgs e)
        {
            ChkAdminLevel("plugin_feedback", DTEnums.ActionEnum.Delete.ToString()); //检查权限
            int sucCount   = 0;
            int errorCount = 0;

            BLL.feedback bll = new BLL.feedback();
            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 += 1;
                    }
                    else
                    {
                        errorCount += 1;
                    }
                }
            }
            AddAdminLog(DTEnums.ActionEnum.Delete.ToString(), "删除留言成功" + sucCount + "条,失败" + errorCount + "条"); //记录日志
            JscriptMsg("删除成功" + sucCount + "条,失败" + errorCount + "条!", Utils.CombUrlTxt("index.aspx", "keywords={0}", this.keywords));
        }
예제 #3
0
        private void feedback_list(HttpContext context)
        {
            int    page      = DTRequest.GetFormInt("page", 1);
            int    pageSize  = DTRequest.GetFormInt("size", 10);
            string site_path = Utils.SafeXXS(DTRequest.GetQueryString("site").Trim());

            if (string.IsNullOrWhiteSpace(site_path))
            {
                context.Response.Write("{\"status\": 0, \"msg\": \"对不起,参数错误!\"}");
                return;
            }

            int       totalcount = 0;
            DataTable dt         = new BLL.feedback().GetList(pageSize, page, "is_lock=0 and site_path='" + site_path + "'", "add_time desc", out totalcount).Tables[0];

            dt.Columns.Remove("user_tel");
            dt.Columns.Remove("user_qq");
            dt.Columns.Remove("user_email");
            dt.Columns.Remove("row_number");
            dt.Columns.Remove("site_path");
            JsonHelper.WriteJson(context,
                                 new {
                status = 1,
                msg    = "获取留言列表成功!",
                total  = totalcount,
                list   = dt
            }
                                 );
        }
예제 #4
0
 //批量删除
 protected void btnDelete_Click(object sender, EventArgs e)
 {
     ChkAdminLevel("plugin_feedback", DTEnums.ActionEnum.Delete.ToString()); //检查权限
     int sucCount = 0;
     int errorCount = 0;
     BLL.feedback bll = new BLL.feedback();
     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 += 1;
             }
             else
             {
                 errorCount += 1;
             }
         }
     }
     AddAdminLog(DTEnums.ActionEnum.Delete.ToString(), "删除留言成功" + sucCount + "条,失败" + errorCount + "条"); //记录日志
     JscriptMsg("删除成功" + sucCount + "条,失败" + errorCount + "条!", Utils.CombUrlTxt("index.aspx", "keywords={0}", this.keywords), "Success");
 }
예제 #5
0
 private void ShowInfo(int _id)
 {
     BLL.feedback bll = new BLL.feedback();
     model = bll.GetModel(_id);
     rblStatus.SelectedValue = model.is_lock.ToString();
     txtReContent.Text       = Utils.ToTxt(model.reply_content);
     txtBeiZhu.Text          = model.beizhu;
 }
예제 #6
0
 //保存
 protected void btnSubmit_Click(object sender, EventArgs e)
 {
     BLL.feedback bll = new BLL.feedback();
     model = bll.GetModel(this.id);
     model.reply_content = Utils.ToHtml(txtReContent.Text);
     model.reply_time    = DateTime.Now;
     bll.Update(model);
     JscriptMsg("留言回复成功啦!", "index.aspx", "Success");
 }
예제 #7
0
 //保存
 protected void btnSubmit_Click(object sender, EventArgs e)
 {
     BLL.feedback bll = new BLL.feedback();
     model = bll.GetModel(this.id);
     model.reply_content = Utils.ToHtml(txtReContent.Text);
     model.reply_time = DateTime.Now;
     bll.Update(model);
     JscriptMsg("留言回复成功啦!", "index.aspx", "Success");
 }
예제 #8
0
 //保存
 protected void btnSubmit_Click(object sender, EventArgs e)
 {
     ChkAdminLevel("plugin_feedback", DTEnums.ActionEnum.Reply.ToString()); //检查权限
     BLL.feedback bll = new BLL.feedback();
     model = bll.GetModel(this.id);
     model.reply_content = Utils.ToHtml(txtReContent.Text);
     model.reply_time    = DateTime.Now;
     bll.Update(model);
     AddAdminLog(DTEnums.ActionEnum.Reply.ToString(), "回复留言插件内容:" + model.title); //记录日志
     JscriptMsg("留言回复成功!", "index.aspx");
 }
예제 #9
0
 protected void btn_Submit_Click(object sender, EventArgs e)
 {
     BLL.feedback bll = new BLL.feedback();
     model               = bll.GetModel(this.id);
     model.is_lock       = Utils.StrToInt(rblStatus.SelectedValue, 0);
     model.reply_content = Utils.ToHtml(txtReContent.Text);
     model.beizhu        = Utils.ToHtml(txtBeiZhu.Text);
     bll.Update(model);
     AddAdminLog(TWEnums.ActionEnum.Reply.ToString(), "儲存留言內容:" + model.title); //記錄日誌
     JscriptMsg("留言儲存成功!", "list.aspx");
 }
예제 #10
0
 //保存
 protected void btnSubmit_Click(object sender, EventArgs e)
 {
     ChkAdminLevel("plugin_feedback", DTEnums.ActionEnum.Reply.ToString()); //检查权限
     BLL.feedback bll = new BLL.feedback();
     model = bll.GetModel(this.id);
     model.reply_content = Utils.ToHtml(txtReContent.Text);
     model.reply_time = DateTime.Now;
     bll.Update(model);
     AddAdminLog(DTEnums.ActionEnum.Reply.ToString(), "回复留言插件内容:" + model.title); //记录日志
     JscriptMsg("留言回复成功!", "index.aspx", "Success");
 }
예제 #11
0
 //批量审核
 protected void lbtnUnLock_Click(object sender, EventArgs e)
 {
     BLL.feedback bll = new BLL.feedback();
     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)
         {
             bll.UpdateField(id, "is_lock=0");
         }
     }
     JscriptMsg("批量审核成功啦!", Utils.CombUrlTxt("index.aspx", "keywords={0}", this.keywords), "Success");
 }
예제 #12
0
 //批量删除
 protected void btnDelete_Click(object sender, EventArgs e)
 {
     BLL.feedback bll = new BLL.feedback();
     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)
         {
             bll.Delete(id);
         }
     }
     JscriptMsg("批量删除成功啦!", Utils.CombUrlTxt("index.aspx", "keywords={0}", this.keywords), "Success");
 }
예제 #13
0
 private void RptBind(string _strWhere, string _orderby)
 {
     if (!int.TryParse(Request.QueryString["page"] as string, out this.page))
     {
         this.page = 1;
     }
     this.txtKeywords.Text = this.keywords;
     BLL.feedback bll = new BLL.feedback();
     this.rptList.DataSource = bll.GetList(this.pageSize, this.page, _strWhere, _orderby, out this.totalCount);
     this.rptList.DataBind();
     //绑定页码
     txtPageNum.Text = this.pageSize.ToString();
     string pageUrl = Utils.CombUrlTxt("index.aspx", "keywords={0}&page={1}", this.keywords, "__id__");
     PageContent.InnerHtml = Utils.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8);
 }
예제 #14
0
        private void RptBind(string _strWhere, string _orderby)
        {
            if (!int.TryParse(Request.QueryString["page"] as string, out this.page))
            {
                this.page = 1;
            }
            this.txtKeywords.Text = this.keywords;
            BLL.feedback bll = new BLL.feedback();
            this.rptList.DataSource = bll.GetList(this.pageSize, this.page, _strWhere, _orderby, out this.totalCount);
            this.rptList.DataBind();
            //绑定页码
            txtPageNum.Text = this.pageSize.ToString();
            string pageUrl = Utils.CombUrlTxt("index.aspx", "keywords={0}&page={1}", this.keywords, "__id__");

            PageContent.InnerHtml = Utils.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8);
        }
예제 #15
0
 //批量审核
 protected void lbtnUnLock_Click(object sender, EventArgs e)
 {
     ChkAdminLevel("plugin_feedback", DTEnums.ActionEnum.Audit.ToString()); //检查权限
     BLL.feedback bll = new BLL.feedback();
     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)
         {
             bll.UpdateField(id, "is_lock=0");
         }
     }
     AddAdminLog(DTEnums.ActionEnum.Audit.ToString(), "审核留言插件内容"); //记录日志
     JscriptMsg("批量审核成功!", Utils.CombUrlTxt("index.aspx", "keywords={0}", this.keywords));
 }
예제 #16
0
파일: list.aspx.cs 프로젝트: WayLeeLi/tea2
 //批次審核
 protected void lbtnUnLock_Click(object sender, EventArgs e)
 {
     //ChkAdminLevel("plugin_feedback", TWEnums.ActionEnum.Audit.ToString()); //檢查權限
     BLL.feedback bll = new BLL.feedback();
     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)
         {
             bll.UpdateField(id, "site_path='no'");
         }
     }
     AddAdminLog(TWEnums.ActionEnum.Audit.ToString(), "審核留言內容"); //記錄日誌
     JscriptMsg("批次審核成功!", Utils.CombUrlTxt("list.aspx", "keywords={0}", this.keywords));
 }
예제 #17
0
 //批量审核
 protected void lbtnUnLock_Click(object sender, EventArgs e)
 {
     ChkAdminLevel("plugin_feedback", DTEnums.ActionEnum.Audit.ToString()); //检查权限
     BLL.feedback bll = new BLL.feedback();
     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)
         {
             bll.UpdateField(id, "is_lock=0");
         }
     }
     AddAdminLog(DTEnums.ActionEnum.Audit.ToString(), "审核留言插件内容"); //记录日志
     JscriptMsg("批量审核成功!", Utils.CombUrlTxt("index.aspx", "keywords={0}", this.keywords), "Success");
 }
예제 #18
0
        //儲存
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            ChkAdminLevelEdit("site_contact", "Edit");
            //ChkAdminLevel("plugin_feedback", TWEnums.ActionEnum.Reply.ToString()); //檢查權限

            Model.manager _admin = new Tea.Web.UI.ManagePage().GetAdminInfo();

            BLL.feedback bll = new BLL.feedback();
            model = bll.GetModel(this.id);
            model.reply_content = Utils.ToHtml(txtReContent.Text);
            model.reply_time    = DateTime.Now;
            model.company       = _admin.id;
            model.is_lock       = Utils.StrToInt(rblStatus.SelectedValue, 0);
            model.beizhu        = Utils.ToHtml(txtBeiZhu.Text);
            bll.Update(model);

            try
            {
                //if (model.is_lock == 2)
                //{
                TWMail.sendMail(siteConfig.emailsmtp, siteConfig.emailssl, siteConfig.emailport, siteConfig.emailusername, siteConfig.emailpassword,
                                siteConfig.emailnickname,
                                siteConfig.emailfrom,
                                model.user_email,
                                model.title + ":回答", model.reply_content);

                TWMail.sendMail(siteConfig.emailsmtp, siteConfig.emailssl, siteConfig.emailport, siteConfig.emailusername, siteConfig.emailpassword,
                                siteConfig.emailnickname,
                                siteConfig.emailfrom,
                                siteConfig.webmail,
                                model.title + ":回答", model.reply_content);
                // }
            }
            catch (Exception eee) { }
            AddAdminLog(TWEnums.ActionEnum.Reply.ToString(), "回覆留言內容:" + model.title); //記錄日誌
            JscriptMsg("留言回覆成功!", "list.aspx");
        }
예제 #19
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)
            {
                //是否开启通知功能
                if (config.bookmsg > 0 && config.receive != "")
                {
                    switch (config.bookmsg)
                    {
                    case 1:
                        DTcms.Model.sms_template smsModel = new DTcms.BLL.sms_template().GetModel(config.booktemplet);     //取得短信内容
                        if (smsModel != null)
                        {
                            //替换模板内容
                            string smstxt = smsModel.content;
                            smstxt = smstxt.Replace("{webname}", siteConfig.webname);
                            smstxt = smstxt.Replace("{webtel}", siteConfig.webtel);
                            smstxt = smstxt.Replace("{weburl}", siteConfig.weburl);
                            smstxt = smstxt.Replace("{username}", model.user_name);
                            smstxt = smstxt.Replace("{usertel}", model.user_tel);
                            smstxt = smstxt.Replace("{userqq}", model.user_qq);
                            smstxt = smstxt.Replace("{useremail}", model.user_email);
                            smstxt = smstxt.Replace("{usertitle}", model.title);
                            smstxt = smstxt.Replace("{usercontent}", model.content);
                            //发送短信
                            string tipMsg = string.Empty;
                            bool   result = new DTcms.BLL.sms_message().Send(config.receive, smstxt, 1, out tipMsg);
                            if (!result)
                            {
                                LogHelper.WriteLog("手机信息发送失败!");
                            }
                        }
                        break;

                    case 2:
                        //获得邮件内容
                        DTcms.Model.mail_template mailModel = new DTcms.BLL.mail_template().GetModel(config.booktemplet);
                        if (mailModel != null)
                        {
                            //替换模板内容
                            string titletxt = mailModel.maill_title;
                            string bodytxt  = mailModel.content;

                            titletxt = titletxt.Replace("{webname}", siteConfig.webname);
                            titletxt = titletxt.Replace("{username}", model.user_name);

                            bodytxt = bodytxt.Replace("{webname}", siteConfig.webname);
                            bodytxt = bodytxt.Replace("{webtel}", siteConfig.webtel);
                            bodytxt = bodytxt.Replace("{weburl}", siteConfig.weburl);

                            bodytxt = bodytxt.Replace("{username}", model.user_name);
                            bodytxt = bodytxt.Replace("{usertel}", model.user_tel);
                            bodytxt = bodytxt.Replace("{userqq}", model.user_qq);
                            bodytxt = bodytxt.Replace("{useremail}", model.user_email);
                            bodytxt = bodytxt.Replace("{usertitle}", model.title);
                            bodytxt = bodytxt.Replace("{usercontent}", model.content);
                            //循环发送
                            string[] emailArr = config.receive.Split(',');
                            foreach (string email in emailArr)
                            {
                                if (DTcms.Common.Utils.IsValidEmail(email))
                                {
                                    //发送邮件
                                    try
                                    {
                                        DTMail.sendMail(siteConfig.emailsmtp, siteConfig.emailssl,
                                                        siteConfig.emailusername,
                                                        DESEncrypt.Decrypt(siteConfig.emailpassword, siteConfig.sysencryptstring),
                                                        siteConfig.emailnickname,
                                                        siteConfig.emailfrom,
                                                        email,
                                                        titletxt, bodytxt);
                                    }
                                    catch
                                    {
                                        LogHelper.WriteLog("邮件发送失败!");
                                    }
                                }
                            }
                        }
                        break;
                    }
                }
                context.Response.Write("{\"status\": 1, \"msg\": \"恭喜您,留言提交成功!\"}");
                return;
            }
            context.Response.Write("{\"status\": 0, \"msg\": \"对不起,保存过程中发生错误!\"}");
            return;
        }
예제 #20
0
 private void ShowInfo(int _id)
 {
     BLL.feedback bll = new BLL.feedback();
     model             = bll.GetModel(_id);
     txtReContent.Text = Utils.ToTxt(model.reply_content);
 }
예제 #21
0
 private void ShowInfo(int _id)
 {
     BLL.feedback bll = new BLL.feedback();
     model = bll.GetModel(_id);
     txtReContent.Text = Utils.ToTxt(model.reply_content);
 }