/// <summary>
        /// 直接回复
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnReply_Click(object sender, EventArgs e)
        {
            if (txtReplyOption.Text == "")
            {
                AlertAjaxMessage("请输入回复意见");
            }
            if (txtReplyOption.Text != "")
            {
                DateTime Times       = DateTime.Now;
                string   Typr        = "普通件";
                string   HistoryGuid = Request.QueryString["HistoryGuid"];
                Detail_RG_ConsultHistory historyDetail = mana.GetDetail(HistoryGuid);
                mana.UpdateUserSendToBox(HistoryGuid, treeSendToBox.Value);
                DataView handleDV = mana.SelectAllHandle(HistoryGuid);
                if (handleDV.Count == 0)
                {
                    // 信件不经过分发,直接就回复
                    mana.InsertHandle(treeSendToBox.Value, HistoryGuid, Typr, "", "", "", 0, Convert.ToDateTime(txtEndDate.Text + " " + DateTime.Now.ToShortTimeString()));
                    mana.UpdateHandle(HistoryGuid, treeSendToBox.Value, Times, txtReplyOption.Text, Session["UserGuid"].ToString());//结束自己的办理流程
                    mana.UpdateHandleStatus(HistoryGuid, treeSendToBox.Value, 9);
                }
                else
                {
                    // 信件已经分发
                    handleDV.RowFilter = "HandleStatus=9";
                    if (handleDV.Count == 0)
                    {
                        // 没有回复
                        mana.InsertHandle(treeSendToBox.Value, HistoryGuid, Typr, "", "", "", 0, Convert.ToDateTime(txtEndDate.Text + " " + DateTime.Now.ToShortTimeString()));
                        mana.UpdateHandle(HistoryGuid, treeSendToBox.Value, Times, txtReplyOption.Text, Session["UserGuid"].ToString());//结束自己的办理流程
                        mana.UpdateHandleStatus(HistoryGuid, treeSendToBox.Value, 9);
                    }
                }

                mana.UpdateOver(HistoryGuid, Times, Session["DisplayName"].ToString(),
                                txtReplyOption.Text, RblType.SelectedValue, RblPublishOnweb.SelectedIndex == 0 ? true : false);//将信件结束

                mana.UpdateReplyType(HistoryGuid, RblType.SelectedValue);
                mana.UpdatePublishOnWeb(HistoryGuid, RblPublishOnweb.SelectedIndex == 0 ? true : false);
                mana.Update(HistoryGuid, 9);
                //if(RblPublishOnweb.SelectedIndex == 0)
                //AddCatch();
            }
            WriteScript("refreshParent(\"\");window.close();");
        }
Ejemplo n.º 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                this.CurrentPosition = "咨询回复";

                BtnDel.Visible    = false;
                BtnReply.Visible  = false;
                btnSave.Visible   = false;
                btnBack.Visible   = false;
                BtnChange.Visible = false;
                BtnZbcl.Visible   = false;
                BtnHfcl.Visible   = false;

                trfenfa.Visible     = false;
                trfenfadate.Visible = false;

                string HistoryGuid = Request.QueryString["HistoryGuid"];
                Detail_RG_ConsultHistory ConsultHistory = mana.GetDetail(HistoryGuid);

                #region 初始化ConsultHistory页面信息

                lblSubject.Text = ConsultHistory.Subject;
                //lblSex.Text = ConsultHistory.Sex;
                lblPostUserName.Text = ConsultHistory.PostUserName;
                lblPostDate.Text     = ConsultHistory.PostDate.ToString();
                //lblPhone.Text = ConsultHistory.Tel;
                //lblEmail.Text = ConsultHistory.Email;
                //lblAddress.Text = ConsultHistory.Address;
                txtContent.Text = ConsultHistory.Content;
                lblUserIP.Text  = ConsultHistory.UserIP;

                if (ConsultHistory.PublishOnWeb)
                {
                    RblPublishOnweb.SelectedIndex = 0;
                }
                else
                {
                    RblPublishOnweb.SelectedIndex = 1;
                }

                if (ConsultHistory.ReplyType == "网站回复")
                {
                    Rdo_HuiFu.SelectedIndex = 1;
                }

                if (ConsultHistory.IsDelete)
                {
                    lblHandled.Text = "暂不处理";
                }
                else
                {
                    lblHandled.Text = mana.SelectAllHandleStr(HistoryGuid);//处理情况
                }

                #endregion

                Detail_RG_ConsultBox DetailBox = BoxMana.GetDetail(ConsultHistory.UserSendToBoxGuid);

                int Row_ID = Convert.ToInt32(Request.QueryString["Row_ID"]);
                Detail_RG_ConsultHandle ConsultHandle = mana.GetDetailHanDle(Row_ID);

                ViewState["ReplayType"] = ConsultHandle.HandleType;
                ViewState["BoxGuid"]    = ConsultHandle.BoxGuid;

                txtReplyOption.Text = ConsultHandle.strComment;

                if (ConsultHandle.HandleStatus != 2 && ConsultHandle.HandleStatus != 3) //已退回、已转发 操作按钮都不可见
                {
                    if (ConsultHandle.HandleStatus == handledStatusCode)                //已处理 保存按钮可见
                    {
                        btnSave.Visible = true;
                    }

                    if (DetailBox.NeedAudit == 0)    //不启用信访局过滤
                    {
                        if (ConsultHistory.IsDelete) //恢复处理按钮可见
                        {
                            BtnHfcl.Visible = true;
                        }
                        else
                        {
                            BtnZbcl.Visible = true;

                            if (ConsultHandle.HandleStatus == 0)//未处理 转发、回复按钮可见
                            {
                                BtnReply.Visible  = true;
                                BtnChange.Visible = true;

                                if (ConsultHistory.UserSendToBoxGuid == ConsultHandle.BoxGuid)
                                {
                                    BtnDel.Visible = true;
                                }
                            }
                        }
                    }
                    else//启用信访局过滤 只能回复和退回
                    {
                        #region 分发意见

                        trfenfa.Visible     = true;
                        trfenfadate.Visible = true;
                        lbzfcomment.Text    = ConsultHandle.strFenfaComment;
                        lblFenfaDate.Text   = ConsultHandle.dtFenfaDate.ToString("yyyy-MM-dd");

                        #endregion

                        if (ConsultHandle.HandleStatus == 0)//ConsultHandle.HandleStatus
                        {
                            BtnReply.Visible = true;
                            btnBack.Visible  = true;
                        }
                    }
                }
                /// 判断是否现在网上发布行
                if (new Epoint.Frame.Bizlogic.Frame_Config().GetDetail("Consult_EnablePubAtReply").ConfigValue == "1")
                {
                    trIsPub.Visible = true;
                }
                else
                {
                    trIsPub.Visible = false;
                }
                /// 判断是否现 回复方式
                if (new Epoint.Frame.Bizlogic.Frame_Config().GetDetail("Consult_EnableReplyType").ConfigValue == "1")
                {
                    trReplyType.Visible = true;
                }
                else
                {
                    trReplyType.Visible = false;
                }
            }
            else
            {
                if (Request.Form["__EVENTTARGET"] == "SendBack")
                {
                    if (Request.Form["__EVENTARGUMENT"] != "")
                    {
                        //mana.InsertHandle("", Request.QueryString["HistoryGuid"], "普通件", "","","",2);//添加一条退回的记录
                        mana.UpdateHandle(Convert.ToInt32(Request.QueryString["Row_ID"]), DateTime.Now, Request.Form["__EVENTARGUMENT"], Session["UserGuid"].ToString());//结束自己的办理流程
                        mana.Update(Request.QueryString["HistoryGuid"], 2);
                        mana.UpdateHandleStatus(Convert.ToInt32(Request.QueryString["Row_ID"]), 2);
                        WriteAjaxMessage("refreshParent(\"\");window.close();");
                    }
                }
                if (Request.Form["__EVENTTARGET"] == "ReSend")//转发信件
                {
                    string AllInfo = Request.Form["__EVENTARGUMENT"];
                    if (AllInfo.IndexOf('★') > -1)
                    {
                        string BoxGuid = AllInfo.Split('★')[0].ToString();
                        // AlertAjaxMessage(BoxGuid);
                        string NoticeInfo = AllInfo.Replace(BoxGuid + "★", "");

                        int      HandleDays = BoxMana.GetDetail(BoxGuid).HandleDays;
                        DateTime dt         = DateTime.Now;
                        //DateTime HandleEndDate = new Epoint.Frame.Webbuilder.Bizlogic.WorkingDay.DB_WorkingDay().GetEndWorkingDate(dt, HandleDays)
                        DateTime HandleEndDate = dt.AddDays(HandleDays);
                        mana.InsertHandle(BoxGuid, Request.QueryString["HistoryGuid"], "普通件", "", "", "", 0, HandleEndDate);                         //添加一个待处理信息
                        mana.UpdateHandle(Convert.ToInt32(Request.QueryString["Row_ID"]), DateTime.Now, NoticeInfo, Session["UserGuid"].ToString()); //结束自己的办理流程
                        mana.UpdateHandleStatus(Convert.ToInt32(Request.QueryString["Row_ID"]), 3);
                        WriteAjaxMessage("refreshParent(\"\");window.close();");
                    }
                }
            }
        }