⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 complainshow.cs

📁 动易SiteFactory&#8482 网上商店系统1.0源代码
💻 CS
字号:
namespace PowerEasy.WebSite.Admin.Crm
{
    using PowerEasy.Accessories;
    using PowerEasy.Common;
    using PowerEasy.Components;
    using PowerEasy.Controls;
    using PowerEasy.Crm;
    using PowerEasy.ExtendedControls;
    using PowerEasy.Model.Crm;
    using PowerEasy.Web.UI;
    using System;
    using System.Web.UI.HtmlControls;
    using System.Web.UI.WebControls;

    public class ComplainShow : AdminPage
    {
        protected ExtendedButton BtnDoProcess;
        protected ExtendedButton BtnFeedback;
        protected ExtendedButton BtnModify;
        protected ExtendedButton BtnSaveFeedBack;
        protected ExtendedButton BtnSaveProcess;
        protected DatePicker DpkEnd;
        protected DatePicker DpkFeedBack;
        protected DropDownList DropConfirmScore;
        protected HiddenField HdnItemId;
        protected HiddenField HdnStatus;
        protected HyperLink LnkClientName;
        protected HyperLink LnkContacterName;
        protected RegularExpressionValidator RegularExpressionValidator1;
        protected PowerEasy.Controls.RequiredFieldValidator RequiredFieldValidator1;
        protected ExtendedSiteMapPath SmpNavigator;
        protected HtmlTableCell TdComplainMode;
        protected HtmlTableCell TdComplainType;
        protected HtmlTableCell TdConfirmCaller;
        protected HtmlTableCell TdConfirmFeedback;
        protected HtmlTableCell TdConfirmScore;
        protected HtmlTableCell TdConfirmTime;
        protected HtmlTableCell TdContent;
        protected HtmlTableCell TdCurrentOwner;
        protected HtmlTableCell TdDateAndTime;
        protected HtmlTableCell TdDefendant;
        protected HtmlTableCell TdEndTime;
        protected HtmlTableCell TdFeedback;
        protected HtmlTableCell TdFirstReceiver;
        protected HtmlTableCell TdMagnitudeOfExigence;
        protected HtmlTableCell TdProcess;
        protected HtmlTableCell TdProcessor;
        protected HtmlTableCell TdRemark;
        protected HtmlTableCell TdResult;
        protected HtmlTableCell TdTitle;
        protected TextBox TxtConfirmCaller;
        protected TextBox TxtEndTime;
        protected TextBox TxtFeedback;
        protected TextBox TxtFeedBack2;
        protected TextBox TxtFreeBackTime;
        protected TextBox TxtProcess;
        protected TextBox TxtProcessor;
        protected TextBox TxtResult;
        protected RegularExpressionValidator ValeEndTime;
        protected PowerEasy.Controls.RequiredFieldValidator ValrEndTime;

        protected void BtnModify_Click(object sender, EventArgs e)
        {
            BasePage.ResponseRedirect("Complain.aspx?Action=Modify&ItemId=" + this.HdnItemId.Value);
        }

        protected void BtnSaveFeedBack_Click(object sender, EventArgs e)
        {
            if (base.IsValid)
            {
                ComplainItemInfo info = this.ViewState["info"] as ComplainItemInfo;
                info.ConfirmTime = new DateTime?(DataConverter.CDate(this.DpkFeedBack.Date.ToString("yyyy-MM-dd") + " " + this.TxtFreeBackTime.Text));
                info.ConfirmCaller = DataSecurity.HtmlEncode(this.TxtConfirmCaller.Text);
                info.ConfirmScore = DataConverter.CLng(this.DropConfirmScore.SelectedValue);
                info.ConfirmFeedback = DataSecurity.HtmlEncode(this.TxtFeedBack2.Text);
                info.Status = 3;
                if (Complain.Update(info))
                {
                    BasePage.ResponseRedirect("ComplainManage.aspx");
                }
            }
        }

        protected void BtnSaveProcess_Click(object sender, EventArgs e)
        {
            if (base.IsValid)
            {
                ComplainItemInfo info = this.ViewState["info"] as ComplainItemInfo;
                info.EndTime = new DateTime?(DataConverter.CDate(this.DpkEnd.Date.ToString("yyyy-MM-dd") + " " + this.TxtEndTime.Text));
                info.Processor = DataSecurity.HtmlEncode(this.TxtProcessor.Text);
                info.Process = DataSecurity.HtmlEncode(this.TxtProcess.Text);
                info.Result = DataSecurity.HtmlEncode(this.TxtResult.Text);
                info.Feedback = DataSecurity.HtmlEncode(this.TxtFeedback.Text);
                info.Status = 2;
                if (Complain.Update(info))
                {
                    BasePage.ResponseRedirect("ComplainManage.aspx");
                }
            }
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!base.IsPostBack)
            {
                Choiceset.DropDownListDataBind("PE_ServiceItem", "ConfirmScore", this.DropConfirmScore);
                int itemId = BasePage.RequestInt32("ItemId");
                this.HdnItemId.Value = itemId.ToString();
                if (itemId != 0)
                {
                    this.ShowInfo(itemId);
                    this.ProcStatus();
                }
                else
                {
                    this.BtnModify.Visible = false;
                    this.BtnDoProcess.Visible = false;
                    this.BtnFeedback.Visible = false;
                }
            }
        }

        private void ProcStatus()
        {
            string str = this.HdnStatus.Value;
            if (str != null)
            {
                if (!(str == "0"))
                {
                    if (!(str == "1"))
                    {
                        if (!(str == "2"))
                        {
                            if (str == "3")
                            {
                                this.BtnModify.Visible = false;
                                this.BtnDoProcess.Visible = false;
                                this.BtnFeedback.Visible = true;
                                this.BtnSaveProcess.Visible = false;
                                this.BtnFeedback.Text = "修改回访记录";
                            }
                        }
                        else
                        {
                            this.BtnModify.Visible = false;
                            this.BtnDoProcess.Visible = true;
                            this.BtnDoProcess.Text = "修改处理记录";
                        }
                    }
                }
                else
                {
                    this.BtnModify.Visible = true;
                    this.BtnDoProcess.Visible = true;
                    this.BtnFeedback.Visible = false;
                    this.BtnSaveFeedBack.Visible = false;
                }
            }
        }

        private void ShowInfo(int itemId)
        {
            ComplainItemInfo complainById = Complain.GetComplainById(itemId);
            if (!complainById.IsNull)
            {
                this.ViewState["info"] = complainById;
                this.HdnStatus.Value = complainById.Status.ToString();
                this.TdDateAndTime.InnerText = complainById.DateAndTime.ToString();
                this.TdTitle.InnerText = DataSecurity.HtmlDecode(complainById.Title);
                this.LnkClientName.Text = Client.GetClientNameById(complainById.ClientId, false);
                this.LnkClientName.NavigateUrl = "ClientShow.aspx?ClientId=" + complainById.ClientId.ToString();
                ContacterInfo contacterById = Contacter.GetContacterById(complainById.ContacterId);
                this.LnkContacterName.Text = (contacterById == null) ? "" : DataSecurity.HtmlDecode(contacterById.TrueName);
                this.LnkContacterName.NavigateUrl = "ContacterShow.aspx?ContacterId=" + complainById.ContacterId.ToString();
                this.TdComplainType.InnerText = Complain.GetFiledNameById("ComplainType", complainById.ComplainType);
                this.TdComplainMode.InnerText = Complain.GetFiledNameById("ComplainMode", complainById.ComplainMode);
                this.TdMagnitudeOfExigence.InnerText = Complain.GetFiledNameById("MagnitudeOfExigence", complainById.MagnitudeOfExigence);
                this.TdFirstReceiver.InnerText = DataSecurity.HtmlDecode(complainById.FirstReceiver);
                this.TdCurrentOwner.InnerText = DataSecurity.HtmlDecode(complainById.CurrentOwner);
                this.TdContent.InnerText = DataSecurity.HtmlDecode(complainById.Content);
                this.TdRemark.InnerText = DataSecurity.HtmlDecode(complainById.Remark);
                this.TdEndTime.InnerText = complainById.EndTime.ToString();
                this.TdConfirmTime.InnerText = complainById.ConfirmTime.ToString();
                this.TdProcessor.InnerText = DataSecurity.HtmlDecode(complainById.Processor);
                this.TdProcess.InnerText = DataSecurity.HtmlDecode(complainById.Process);
                this.TdResult.InnerText = DataSecurity.HtmlDecode(complainById.Result);
                this.TdFeedback.InnerText = DataSecurity.HtmlDecode(complainById.Feedback);
                this.TxtProcess.Text = DataSecurity.HtmlDecode(complainById.Process);
                this.TxtResult.Text = DataSecurity.HtmlDecode(complainById.Result);
                this.TxtFeedback.Text = DataSecurity.HtmlDecode(complainById.Feedback);
                this.TdDefendant.InnerText = complainById.Defendant;
                if (complainById.EndTime.HasValue)
                {
                    this.DpkEnd.Text = complainById.EndTime.Value.ToString("yyyy-MM-dd");
                    this.TxtEndTime.Text = complainById.EndTime.Value.ToLongTimeString();
                }
                else
                {
                    this.DpkEnd.Text = DateTime.Today.ToString("yyyy-MM-dd");
                    this.TxtEndTime.Text = DateTime.Now.ToLongTimeString();
                }
                if (complainById.ConfirmTime.HasValue)
                {
                    this.DpkFeedBack.Text = complainById.ConfirmTime.Value.ToString("yyyy-MM-dd");
                    this.TxtFreeBackTime.Text = complainById.ConfirmTime.Value.ToLongTimeString();
                }
                else
                {
                    this.DpkFeedBack.Text = DateTime.Today.ToString("yyyy-MM-dd");
                    this.TxtFreeBackTime.Text = DateTime.Now.ToLongTimeString();
                }
                if (string.IsNullOrEmpty(complainById.Processor))
                {
                    this.TxtProcessor.Text = PEContext.Current.Admin.AdminName;
                }
                else
                {
                    this.TxtProcessor.Text = complainById.Processor;
                }
                if (string.IsNullOrEmpty(complainById.ConfirmCaller))
                {
                    this.TxtConfirmCaller.Text = PEContext.Current.Admin.AdminName;
                }
                else
                {
                    this.TxtConfirmCaller.Text = DataSecurity.HtmlDecode(complainById.ConfirmCaller);
                    this.TdConfirmCaller.InnerText = this.TxtConfirmCaller.Text;
                }
                this.TxtFeedBack2.Text = DataSecurity.HtmlDecode(complainById.ConfirmFeedback);
                this.TdConfirmFeedback.InnerText = this.TxtFeedBack2.Text;
                this.DropConfirmScore.SelectedValue = complainById.ConfirmScore.ToString();
                this.TdConfirmScore.InnerText = Complain.GetFiledNameById("ConfirmScore", complainById.ConfirmScore);
            }
        }
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -