Ejemplo n.º 1
0
        /// <summary>
        /// 绑定办理人
        /// </summary>
        private void BindReplyUserList()
        {
            //获取到所拥有这个权限的用户ID
            string         content    = "Advice.Handle";
            List <string>  accountIDs = AdviceHelper.GetAllReceivers(AdviceTypeID, content);
            List <Account> account    = new List <Account>();

            this.ddlToOtherHandleUserID.Items.Clear();
            foreach (string aID in accountIDs)
            {
                if (aID != "")
                {
                    Account a = AccountHelper.GetAccount(aID, new string[] { "ID", "DepartmentID", "LoginName", "LastName" });
                    if (a != null)
                    {
                        Department dp   = AccountHelper.GetDepartment(a.DepartmentID, new string[] { "Name" });
                        string     text = a.LastName;
                        if (string.IsNullOrEmpty(text))
                        {
                            text = a.LoginName;
                        }
                        if (dp != null && !string.IsNullOrEmpty(dp.Name))
                        {
                            text = dp.Name + " - " + text;
                        }
                        ListItem lsTemp = new ListItem(text, a.ID);
                        if (!this.ddlToOtherHandleUserID.Items.Contains(lsTemp))
                        {
                            this.ddlToOtherHandleUserID.Items.Add(lsTemp);
                        }
                    }
                }
            }
        }
Ejemplo n.º 2
0
        public async Task Delete_Contract_Removes_Associated_Advices()
        {
            // Arrange
            const int organizationId = TestEnvironment.DefaultOrganizationId;
            var       contract       = await ItContractHelper.CreateContract(A <string>(), OrganizationId);

            var advice = new Core.DomainModel.Advice.Advice
            {
                Id         = A <int>(),
                AlarmDate  = DateTime.Now,
                StopDate   = DateTime.Now.AddDays(365),
                Scheduling = Scheduling.Quarter,
                Subject    = "Can_Delete_Contract_Advices",
                RelationId = contract.Id,
                Type       = RelatedEntityType.itProject
            };

            using var createResponse = await AdviceHelper.PostAdviceAsync(advice, organizationId);

            Assert.Equal(HttpStatusCode.Created, createResponse.StatusCode);

            // Act
            using var deleteResponse = await ItContractHelper.SendDeleteContractRequestAsync(contract.Id);

            Assert.Equal(HttpStatusCode.OK, deleteResponse.StatusCode);

            // Assert
            using var advicesResponse = AdviceHelper.GetContractAdvicesAsync(contract.Id);
            var deletedContractAdvices = await advicesResponse.Result.ReadOdataListResponseBodyAsAsync <Core.DomainModel.Advice.Advice>();

            Assert.True(deletedContractAdvices.Count == 0);
        }
Ejemplo n.º 3
0
 void AdviceEditorProvider_OnCommandComplete(object sender, We7.Model.Core.ModelEventArgs args)
 {
     if (txtPwd != null && mvAdvice != null)
     {
         mvAdvice.ActiveViewIndex = 1;
         string id = args.PanelContext.Row["ID"] as string;
         if (!String.IsNullOrEmpty(id))
         {
             Advice advice = AdviceHelper.GetAdvice(id, null);
             lblPwd.Text = advice.MyQueryPwd;
             lblSN.Text  = advice.SN.ToString();
             AdviceID    = id;
         }
     }
     else if (lblSN != null)
     {
         mvAdvice.ActiveViewIndex = 1;
         string id = args.PanelContext.Row["ID"] as string;
         if (!String.IsNullOrEmpty(id))
         {
             Advice advice = AdviceHelper.GetAdvice(id, null);
             lblSN.Text = advice.SN.ToString();
             AdviceID   = id;
         }
     }
     else
     {
         Alert("提交成功");
     }
 }
Ejemplo n.º 4
0
        string _GetAdviceCountByState(AdviceState adviceState)
        {
            CurrentQuery.State = Convert.ToInt32(adviceState);
            int n = AdviceHelper.QueryAdviceCountByAll(CurrentQuery);

            return(n.ToString());
        }
Ejemplo n.º 5
0
        /// <summary>
        /// 上报审核
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void AuditReportButton_Click(object sender, EventArgs e)
        {
            UserIDTextBox.Text = "";
            Advice a       = AdviceHelper.GetAdvice(AdviceID);
            bool   success = false;

            if (a.State == (int)AdviceState.WaitHandle)
            {
                success = OperationInfo(AdviceState.Checking, "1", true);
            }
            else
            {
                success = OperationInfo(AdviceState.Checking);
            }

            if (success)
            {
                Messages.ShowMessage(" :) 上报审核成功!");
                //记录日志
                string content = string.Format("上报审核了留言反馈:“{0}”的详细信息", AdviceID);
                AddLog("留言反馈详细信息", content);
            }

            Initialize();
        }
Ejemplo n.º 6
0
        protected override void Initialize()
        {
            //获取到所拥有这个权限的用户ID
            string         content    = "Advice.Handle";
            List <string>  accountIDs = AdviceHelper.GetAllReceivers(AdviceTypeID, content);
            List <Account> account    = new List <Account>();

            foreach (string aID in accountIDs)
            {
                if (aID != "")
                {
                    account.Add(AccountHelper.GetAccount(aID, new string[] { "LoginName", "DepartmentID" }));
                }
            }
            if (SearchTextBox.Text.Trim() != "" && SearchTextBox.Text != null)
            {
                List <Account> at = new List <Account>();
                for (int i = 0; i < account.Count; i++)
                {
                    if (account[i].LoginName == SearchTextBox.Text)
                    {
                        at.Add(account[i]);
                    }
                }
                DetailGridView.DataSource = at;
            }
            else
            {
                DetailGridView.DataSource = account;
            }
            DetailGridView.DataBind();
            UpdateAdviceTag();
        }
Ejemplo n.º 7
0
 /// <summary>
 /// 审核通过
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void ReportButton_Click(object sender, EventArgs e)
 {
     if (OperationInfo(AdviceState.Checking))
     {
         Advice      a     = ThisAdvice;
         AdviceReply reply = AdviceReplyHelper.GetAdviceReplyByAdviceID(AdviceID);
         if (reply == null)
         {
             reply            = new AdviceReply();
             reply.AdviceID   = AdviceID;
             reply.Suggest    = ToAdviceTextBox.Text;
             reply.UserID     = AccountID;
             reply.CreateDate = DateTime.Now;
             reply.Updated    = DateTime.Now;
         }
         reply.Content = We7Helper.ConvertPageBreakFromVisualToChar(ReplyContentTextBox.Value);
         AdviceReplyHelper.UpdateReplyByAdviceID(reply, null);
         if (a.State == (int)AdviceState.Finished)
         {
             if (chbSendEmail.Checked)
             {
                 AdviceEmailConfigs    adviceEmailConfigs = new AdviceEmailConfigs();
                 AdviceEmailConfigInfo info = adviceEmailConfigs["ReplyUser"];
                 AdviceHelper.SendResultMailToAdvicer(a, reply, null, info);
             }
         }
         Messages.ShowMessage(" :) 审核成功!");
         //记录日志
         string content = string.Format("审核通过了留言反馈:“{0}”的详细信息", AdviceID);
         AddLog("留言反馈详细信息", content);
         Response.Write("<script>alert('审核成功!');location.href='AdviceList.aspx?adviceTypeID=" + ThisAdvice.TypeID + "';</script>");
         //Initialize();
     }
 }
Ejemplo n.º 8
0
        void bttnUpdate_Click(object sender, EventArgs e)
        {
            Advice a = new Advice();

            a.ID         = AdviceID;
            a.MyQueryPwd = txtPwd.Text.Trim();
            AdviceHelper.UpdateAdvice(a, new string[] { "MyQueryPwd" });
            Alert2("修改成功");
        }
Ejemplo n.º 9
0
        public async Task Cannot_Delete_Advice_That_Does_Not_Exist()
        {
            //Arrange

            //Act
            using var deleteResult = await AdviceHelper.DeleteAdviceAsync(0);

            //Assert
            Assert.Equal(HttpStatusCode.NotFound, deleteResult.StatusCode);
        }
Ejemplo n.º 10
0
 /// <summary>
 /// 更新反馈标签;
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void UpdateAdviceTag()
 {
     if (!string.IsNullOrEmpty(AdviceTag))
     {
         Advice advice = new Advice();
         advice.ID        = AdviceID;
         advice.AdviceTag = AdviceTag;
         string[] fields = new string[] { "ID", "Updated", "AdviceTag" };
         AdviceHelper.UpdateAdvice(advice, fields);
     }
 }
Ejemplo n.º 11
0
        /// <summary>
        /// 审核
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        //protected void SubmitBtn_Click(object sender, EventArgs e)
        //{
        //    List<string> list = new List<string>();
        //    list = GetIDs();
        //    int count = 0;
        //    if (list.Count > 0)
        //    {
        //        foreach (string id in list)
        //        {
        //            try
        //            {
        //                //ArticleProcessHelper.UpdateArticleProcess(id, AccountID);
        //                InsertArticleProcessHistory(id, "");
        //                Advice a = AdviceHelper.GetAdvice(id);
        //                string oldProcessState = a.ProcessState;
        //                int processState = Int32.Parse(a.ProcessState) + 1;
        //                string processStates = processState.ToString();
        //                AdviceHelper.UpdateAdviceProcess(id, processStates, AdviceState.Checking);

        //                Processing ap = ArticleProcessHelper.GetArticleProcess(id);
        //                GeneralConfigInfo si = GeneralConfigs.GetConfig();

        //               if (oldProcessState == GetChannelProcessLayerNO(id))
        //                {
        //                    //ArticleProcessHelper.DelArticleProcess(id);

        //                    if (si.ArticleAutoPublish == "true")
        //                    {
        //                        Advice advice = new Advice();
        //                        advice.ID = id;
        //                        advice.State = 1;
        //                        string[] fields = new string[] { "ID", "State" };
        //                        AdviceHelper.UpdateAdvice(advice,fields);
        //                    }
        //                }
        //                count++;
        //            }
        //            catch
        //            { }
        //        }
        //    }
        //    string message = string.Format("您已经成功审核{0}条记录", count);
        //    Messages.ShowMessage(message);
        //    LoadArticles();
        //}

        //void InsertArticleProcessHistory(string id ,string state)
        //{
        //    Processing ap = ArticleProcessHelper.GetArticleProcess(id);
        //    ProcessHistory aph = new ProcessHistory();
        //    aph.ObjectID = ap.ObjectID;
        //    if (state == "")
        //    {
        //        aph.ToProcessState = ap.CurLayerNO;
        //    }
        //    else
        //    {
        //        aph.ToProcessState = "-1";
        //    }
        //    aph.ProcessDirection = ap.ProcessDirection;
        //    aph.ProcessAccountID = ap.ProcessAccountID;
        //    aph.Remark = ap.Remark;
        //    aph.CreateDate = DateTime.Now;
        //    aph.UpdateDate = DateTime.Now;
        //    ArticleProcessHistoryHelper.InsertAdviceProcessHistory(aph);
        //}
        /// <summary>
        /// 退回
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        //protected void UntreadBtn_Click(object sender, EventArgs e)
        //{
        //    List<string> list = new List<string>();
        //    list = GetIDs();
        //    int count = 0;
        //    if (list.Count > 0)
        //    {
        //        foreach (string id in list)
        //        {
        //            try
        //            {
        //                Advice a = AdviceHelper.GetAdvice(id);
        //                int processState = Int32.Parse(a.ProcessState)-1;
        //                string processStates = processState.ToString();
        //                AdviceState state = AdviceState.Checking;
        //                if (processState == 0) state = AdviceState.All;
        //                AdviceHelper.UpdateAdviceProcess(id, processStates, state);

        //                Processing ap = new Processing();
        //                ap = ArticleProcessHelper.GetArticleProcess(id);
        //                if (ap.CurLayerNO == "0")
        //                {
        //                    InsertArticleProcessHistory(id,"-1");
        //                    //ArticleProcessHelper.DelArticleProcess(id);
        //                }
        //                else
        //                {
        //                    ArticleProcessHelper.UntreadArticleProcess(id, AccountID);
        //                    InsertArticleProcessHistory(id,"");
        //                }
        //                count++;
        //            }
        //            catch
        //            { }
        //        }
        //    }
        //    string message = string.Format("您已经成功退回{0}条记录", count);
        //    Messages.ShowMessage(message);
        //    LoadArticles();
        //}

        /// <summary>
        /// 审核状态
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public string GetProcessState(string id)
        {
            Advice     a           = AdviceHelper.GetAdvice(id);
            Processing ap          = ProcessHelper.GetAdviceProcess(a);
            string     processText = "";

            if (ap != null)
            {
                processText = ap.ProcessDirectionText + ap.ProcessText;
            }
            return(processText);
        }
Ejemplo n.º 12
0
        public async Task Can_Add_Repeatable_Advice_With_StartDate_Today()
        {
            //Arrange
            var recipient    = CreateDefaultEmailRecipient(CreateWellformedEmail());
            var createAdvice = CreateDefaultAdvice(Scheduling.Day, AdviceType.Repeat, recipient);

            //Act
            using var result = await AdviceHelper.PostAdviceAsync(createAdvice, OrganizationId);

            //Assert
            Assert.Equal(HttpStatusCode.Created, result.StatusCode);
        }
Ejemplo n.º 13
0
        void LoadArticles()
        {
            //取出所有待审批文章,逐一判断是否具有权限
            List <Advice> GetAllArticles = AdviceHelper.GetArticlesByAdviceTypeID(null, AdviceState.Checking, Pager.Begin, Pager.Count);

            if (GetAllArticles.Count == 0)
            {
                Messages.ShowMessage("您好,暂无待审核文章记录!");
                return;
            }
            List <Advice> adviceList = new List <Advice>();

            foreach (Advice advice in GetAllArticles)
            {
                try
                {
                    string curLayerNOText = ProcessHelper.GetCurLayerNOAdviceText(advice.ID);
                    if (curLayerNOText != "") //反馈当前审批进程:类似 Advice.FirstAudit
                    {
                        List <string> contents = AccountHelper.GetPermissionContents(AccountID, advice.TypeID);
                        if (contents.Contains(curLayerNOText))
                        {
                            adviceList.Add(advice);
                        }
                    }
                }
                catch
                { }
            }

            if (adviceList != null)
            {
                Pager.RecorderCount = adviceList.Count;
            }
            else
            {
                Pager.RecorderCount = 0;
            }
            if (Pager.Count < 0)
            {
                Pager.PageIndex = 0;
            }
            Pager.FreshMyself();
            if (Pager.Count <= 0)
            {
                DataGridView.DataSource = null;
                DataGridView.DataBind();
                return;
            }

            DataGridView.DataSource = adviceList.GetRange(Pager.Begin, Pager.Count);
            DataGridView.DataBind();
        }
Ejemplo n.º 14
0
        public async Task Cannot_Add_Advice_When_Emails_Are_Malformed()
        {
            //Arrange
            var recipient    = CreateDefaultEmailRecipient(A <string>()); // Malformed email
            var createAdvice = CreateDefaultAdvice(Scheduling.Day, A <AdviceType>(), recipient);

            //Act
            using var result = await AdviceHelper.PostAdviceAsync(createAdvice, OrganizationId);

            //Assert
            Assert.Equal(HttpStatusCode.BadRequest, result.StatusCode);
        }
        /// <summary>
        /// 构造反馈统计绑定数据的对象集
        /// </summary>
        /// <returns></returns>
        List <AdviceRate> CreateAdviceRateList()
        {
            List <AdviceRate> adviceRateList     = new List <AdviceRate>();                      //数据对象集
            List <Advice>     adviceInfoTypeList = AdviceHelper.CreatedAdviceRate(AdviceTypeID); //此对象仅为反馈信息类型去重后的结果。

            CurrentQuery.AdviceTypeID = AdviceTypeID;
            for (int i = 0; i < adviceInfoTypeList.Count; i++)
            {
                CurrentQuery.AdviceInfoType = adviceInfoTypeList[i].AdviceInfoType;
                //CurrentQuery.State = 0;
                //CurrentQuery.NotEnumState = -1;
                AdviceRate adviceRate = new AdviceRate();
                adviceRate.AdviceCount     = AdviceHelper.GetAdviceCount(CurrentQuery);//总件数
                adviceRate.AdviceInfoType  = adviceInfoTypeList[i].AdviceInfoType;
                adviceRate.AdviceTypeID    = AdviceTypeID;
                adviceRate.AdviceTypeTitle = adviceInfoTypeList[i].TypeTitle;
                CurrentQuery.State         = (int)AdviceState.Finished;
                adviceRate.HandleCount     = AdviceHelper.GetAdviceCount(CurrentQuery);//总处理数

                CurrentQuery.State      = 0;
                CurrentQuery.MustHandle = 1;
                adviceRate.HandleNumber = AdviceHelper.GetAdviceCount(CurrentQuery);//应处理数

                CurrentQuery.NotState    = (int)AdviceState.Finished;
                adviceRate.NoHandleCount = AdviceHelper.GetAdviceCount(CurrentQuery);//未处理数

                CurrentQuery.NotEnumState          = (int)EnumLibrary.AdviceEnum.AdminHandle;
                CurrentQuery.State                 = (int)AdviceState.Finished;
                CurrentQuery.NotState              = -1;
                adviceRate.NotAdminMustHandleCount = AdviceHelper.GetAdviceCount(CurrentQuery);//办理人处理的必须办理的信息数

                CurrentQuery.MustHandle       = -1;
                adviceRate.NoAdminHandleCount = AdviceHelper.GetAdviceCount(CurrentQuery);    //办理人处理数

                adviceRate.NoHandleNumber = adviceRate.AdviceCount - adviceRate.HandleNumber; //不需处理数

                int count = 0;
                if (adviceRate.NoAdminHandleCount > 0 && adviceRate.HandleNumber > 0)
                {
                    count = (int)(((double)adviceRate.NotAdminMustHandleCount / (double)adviceRate.HandleNumber) * 100);
                }
                if (count > 100)
                {
                    count = 100;
                }
                adviceRate.HandleRate = count + "%";

                adviceRateList.Add(adviceRate);

                CurrentQuery = CreateQuery();
            }
            return(adviceRateList);
        }
Ejemplo n.º 16
0
        public override bool Update(We7.Model.Core.PanelContext data)
        {
            string id     = GetValue <string>(data, "ID");
            Advice advice = AdviceHelper.GetAdvice(id);

            if (advice == null)
            {
                Insert(data);
            }
            else
            {
                advice.Title   = GetValue <string>(data, "Title");
                advice.UserID  = GetValue <string>(data, "UserID");
                advice.Content = GetValue <string>(data, "Content");
                advice.Updated = DateTime.Now;
                advice.Name    = GetValue <string>(data, "Name");
                advice.Email   = GetValue <string>(data, "Email");
                advice.Address = GetValue <string>(data, "Address");
                advice.Phone   = GetValue <string>(data, "Phone");
                advice.Fax     = GetValue <string>(data, "Fax");

                int isshow;
                Int32.TryParse(GetValue <string>(data, "IsShow"), out isshow);
                string stateStr = StateMgr.StateProcess(advice.EnumState, EnumLibrary.Business.AdviceDisplay, isshow);
                advice.IsShow    = isshow;
                advice.EnumState = stateStr;

                advice.Display1 = GetValue <string>(data, "Display1");
                advice.Display2 = GetValue <string>(data, "Display2");
                advice.Display3 = GetValue <string>(data, "Display3");

                //下面是添加模型信息
                string config, schema;
                advice.ModelXml    = GetModelDataXml(data, advice.ModelXml, out schema, out config);//获取模型数据
                advice.ModelConfig = config;
                advice.ModelName   = data.ModelName;
                advice.ModelSchema = schema;
                advice.TypeID      = data.Objects["AdviceTypeID"] as string;

                List <string> udpatedFields = new List <string>()
                {
                    "ModelXml", "ModelName", "ModelSchema", "TypeID", "Title", "UserID", "Content", "Updated", "Name", "Email", "Phone", "Address", "Fax", "Display1", "Display2", "Display3"
                };
                if (!String.IsNullOrEmpty(GetValue <string>(data, "IsShow")))
                {
                    udpatedFields.Add("IsShow");
                }

                AdviceHelper.UpdateAdvice(advice, udpatedFields.ToArray());
                SetValue(data, "ID", advice.ID);
            }
            return(true);
        }
Ejemplo n.º 17
0
 public override bool Delete(We7.Model.Core.PanelContext data)
 {
     try
     {
         string adviceid = data.DataKey["ID"] as string;
         AdviceHelper.DeleteAdvice(adviceid);
     }
     catch (Exception ex)
     {
         throw ex;
     }
     return(true);
 }
Ejemplo n.º 18
0
        /// <summary>
        /// 获取前台当前页面栏目内容类型
        /// </summary>
        /// <returns></returns>
        string GetColumnMode()
        {
            if (Request["mode"] != null)
            {
                return(Request["mode"]);
            }
            else
            {
                if (ArticleID != null && ArticleID != "")
                {
                    Article a         = ArticleHelper.GetArticle(ArticleID);
                    string  channelID = "";
                    if (a != null)
                    {
                        channelID = a.OwnerID;
                    }
                    if (channelID != "")
                    {
                        Channel ch = this.ChannelHelper.GetChannel(channelID, new string[] { "EnumState" });
                        //string type = StateManagement.GetStateName(ch.EnumState, UserEnumLibrary.Business.ArticleType).ToString();
                        EnumLibrary.ArticleType type = (EnumLibrary.ArticleType)StateMgr.GetStateValueEnum(ch.EnumState, EnumLibrary.Business.ArticleType);
                        if (type == EnumLibrary.ArticleType.Product)
                        {
                            return("productDetail");
                        }
                        else if (type == EnumLibrary.ArticleType.Article)
                        {
                            return("detail");
                        }
                        else
                        {
                            return("contentMode");
                        }
                    }
                    else if (AdviceHelper.Exist(ArticleID))
                    {
                        return("adviceMode");
                    }
                    else
                    {
                        return(string.Empty);
                    }
                }

                else
                {
                    return(string.Empty);
                }
            }
        }
Ejemplo n.º 19
0
        string GetChannelProcessLayerNO(string id)
        {
            string     adviceTypeID = AdviceHelper.GetAdvice(id).TypeID;
            AdviceType adviceType   = AdviceTypeHelper.GetAdviceType(adviceTypeID);

            if (adviceType.FlowSeries != null)
            {
                return(adviceType.FlowSeries.ToString());
            }
            else
            {
                return("");
            }
        }
Ejemplo n.º 20
0
        public async Task Cannot_Add_Repeatable_Advice_With_StopDate_Before_StartDate()
        {
            //Arrange
            var recipient    = CreateDefaultEmailRecipient(CreateWellformedEmail());
            var createAdvice = CreateDefaultAdvice(Scheduling.Day, AdviceType.Repeat, recipient);

            createAdvice.StopDate = DateTime.Now.AddDays(-1);

            //Act
            using var result = await AdviceHelper.PostAdviceAsync(createAdvice, OrganizationId);

            //Assert
            Assert.Equal(HttpStatusCode.BadRequest, result.StatusCode);
        }
Ejemplo n.º 21
0
        protected void AdviceGridView_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                Label AlertLabel = (Label)e.Row.FindControl("AlertLabel");
                if (AlertLabel != null)
                {
                    Label NoteLabel = (Label)e.Row.FindControl("NoteLabel");

                    switch (AlertLabel.Text)
                    {
                    case "1":
                        e.Row.CssClass = "alertRow";
                        NoteLabel.Text = "必须回复";
                        break;

                    case "2":
                        Label CreateLabel = (Label)e.Row.FindControl("CreateLabel");


                        if (CreateLabel != null)
                        {
                            DateTime create = Convert.ToDateTime(CreateLabel.Text);
                            int      days   = AdviceHelper.GetWorkingDays(create);
                            if (days >= 3)
                            {
                                e.Row.CssClass = "overdueRow";
                                if (NoteLabel != null)
                                {
                                    NoteLabel.Text = "延期";
                                }
                            }
                            else
                            {
                                e.Row.CssClass = "hastenRow";
                                if (NoteLabel != null)
                                {
                                    NoteLabel.Text = "催办";
                                }
                            }
                        }
                        break;

                    default:
                        break;
                    }
                }
            }
        }
Ejemplo n.º 22
0
        /// <summary>
        /// 将错误邮件手动的对应到反馈信息上
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void AdviceBtn_Click(object sender, EventArgs e)
        {
            string adviceID = AdviceIDTextBox.Text;

            if (adviceID != null && adviceID != "")
            {
                Advice advice = AdviceHelper.GetAdvice(adviceID);
                OperationInfo(advice.ID);

                string xmlTitle = FileName;
                string root     = Server.MapPath("/_Data/ErrorEmail/");
                File.Delete(root + xmlTitle);
                Messages.ShowMessage("您已成功将邮件对应到【" + advice.Title + "】的回复中。");
            }
        }
Ejemplo n.º 23
0
        void InsertArticleProcessHistory(string id)
        {
            Advice         a   = AdviceHelper.GetAdvice(id);
            Processing     ap  = ProcessHelper.GetAdviceProcess(a);
            ProcessHistory aph = new ProcessHistory();

            aph.ObjectID         = ap.ObjectID;
            aph.ToProcessState   = ap.CurLayerNO;
            aph.ProcessDirection = ap.ProcessDirection;
            aph.ProcessAccountID = ap.ProcessAccountID;
            aph.Remark           = ap.Remark;
            aph.CreateDate       = DateTime.Now;
            aph.UpdateDate       = DateTime.Now;
            ProcessHistoryHelper.InsertAdviceProcessHistory(aph);
        }
Ejemplo n.º 24
0
        public async Task Cannot_Add_Advice_If_No_RelationId_Defined()
        {
            //Arrange
            var recipient = CreateDefaultEmailRecipient(CreateWellformedEmail());

            var createAdvice = CreateDefaultAdvice(Scheduling.Day, A <AdviceType>(), recipient);

            createAdvice.RelationId = null;

            //Act
            using var result = await AdviceHelper.PostAdviceAsync(createAdvice, OrganizationId);

            //Assert
            Assert.Equal(HttpStatusCode.BadRequest, result.StatusCode);
        }
Ejemplo n.º 25
0
        /// <summary>
        /// 管理员标记为已处理
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void AdminHandButton_Click(object sender, EventArgs e)
        {
            Advice advice = new Advice();

            advice.EnumState    = StateMgr.StateProcess(advice.EnumState, EnumLibrary.Business.AdviceEnum, (int)EnumLibrary.AdviceEnum.AdminHandle);
            advice.State        = (int)AdviceState.Finished;
            advice.Updated      = DateTime.Now;
            advice.ID           = AdviceID;
            advice.AdviceTag    = ddlAdviceTag.SelectedItem.Value;
            advice.ProcessState = ((int)ProcessStates.Finished).ToString();
            string[] fields = new string[] { "ID", "State", "EnumState", "Updated", "AdviceTag", "ProcessState" };
            AdviceHelper.UpdateAdvice(advice, fields);
            actionTable.Visible = false;
            Messages.ShowMessage("反馈已标记为处理。");
        }
Ejemplo n.º 26
0
        void Initialize()
        {
            BindReplayList();
            Advice adviceModel = ThisAdvice;

            adviceModel.IsRead = 0;
            AdviceHelper.UpdateAdvice(adviceModel, null);
            if (AdviceTypeID != null && AdviceTypeID != "")
            {
                NameLabel.Text = AdviceTypeHelper.GetAdviceType(AdviceTypeID).Title.ToString() + "详细信息";;
            }
            PagePathLiteral.Text = BuildPagePath();
            InitializeButtons();
            DataBindAdviceTag();
            BindReplyUserList();
        }
Ejemplo n.º 27
0
        public string GetAdviceIDBySN(long sn)
        {
            int           from     = 0;
            int           count    = 1;
            string        adviceID = "";
            List <Advice> advice   = AdviceHelper.GetAdviceByQuery(CurrentQuery, from, count);

            for (int i = 0; i < advice.Count; i++)
            {
                if (advice[i] != null)
                {
                    adviceID = advice[i].TypeID;
                }
            }
            return(adviceID);
        }
Ejemplo n.º 28
0
 /// <summary>
 /// 获取邮件
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void ReceiveBtn_Click(object sender, EventArgs e)
 {
     if (AdviceTypeID != null && AdviceTypeID != "")
     {
         AdviceType adviceType = AdviceTypeHelper.GetAdviceType(AdviceTypeID);
         //try
         //{
         MailHelper mailHelper = AdviceHelper.GetMailHelper(adviceType);
         string     typeName   = typeof(AdviceHelper).ToString();
         bool       delete     = false;
         if (DeleteEmailTextBox.Text == "1")
         {
             delete = true;
         }
         string     stateText = adviceType.StateText;
         MailResult result    = mailHelper.ReceiveMail("We7.CMS.Utils.dll", typeName, "HandleReceiveMail", delete, stateText);
         LoadAdvices();
         string errorRoot = "<a href=\"/admin/Advice/AdviceProcessManage.aspx\" >反馈监控管理</a>";
         string message   = "";
         if (result.Count > 0)
         {
             message = "您共获取到了" + result.Count + "封邮件";
         }
         else
         {
             message = "Sorry,没有邮件可以获取...";
         }
         if (result.Success > 0)
         {
             message += ",并成功受理了" + result.Success + "条反馈信息。";
         }
         else if (result.Count > 0 && result.Success == 0)
         {
             message += ",有" + result.Count + "封回复邮件存在错误信息,不可直接对应回复到反馈信息,请到" + errorRoot + " <邮件回复>下进行处理。";
         }
         Messages.ShowMessage(message);
         //}
         //catch (Exception ex)
         //{
         //    Messages.ShowMessage("系统繁忙,请稍后在试!错误信息:"+ex.Message);
         //}
     }
     else
     {
         Messages.ShowMessage("请先选择反馈模型后再获取回复邮件!");
     }
 }
Ejemplo n.º 29
0
        /// <summary>
        /// 删除反馈信息事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void DeleteBtn_Click(object sender, EventArgs e)
        {
            List <string> list = GetIDs();

            if (list.Count < 1)
            {
                Messages.ShowMessage("您没有选择任何一条记录!");
                return;
            }
            AdviceHelper.DeleteAdvice(list);
            Messages.ShowMessage(string.Format("您已经成功删除了{0}条反馈信息", list.Count.ToString()));
            //记录日志
            string atContent = string.Format("删除了{0}个留言反馈", list.Count.ToString());

            AddLog("留言反馈管理", atContent);
            LoadAdvices();
        }
Ejemplo n.º 30
0
        /// <summary>
        /// 必须办理回复事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void MustHandleButton_Click(object sender, EventArgs e)
        {
            List <string> adviceIDs = GetIDs();
            int           count     = 0;

            foreach (string adviceID in adviceIDs)
            {
                Advice advice = AdviceHelper.GetAdvice(adviceID);
                advice.MustHandle = 1;
                string[] fields = new string[] { "MustHandle" };
                AdviceHelper.UpdateAdvice(advice, fields);
                count++;
            }
            CurrentQuery = CreateQuery();
            LoadAdvices();
            Messages.ShowMessage(string.Format("您已经成功将{0}条反馈信息追加为 必须回复。", count.ToString()));
        }