internal List<string> historyContentMethod(SupportRequirementModel model, List<string> strList, SupportProcessStatus status, string target) { if (!String.IsNullOrEmpty(model.SupportRequirementId)) { SupportRequirementModel parentModel = _service.Requirements.Where(x => x.Id == model.SupportRequirementId).FirstOrDefault(); strList = historyContentMethod(parentModel, strList, status, target); } foreach (var item in model.SupportProcesses) { SupportHistoryModel m = new SupportHistoryModel() { Status = item.Status, }; switch (item.Status) { case SupportProcessStatus.Solution: m.Message = PublicMethod.JsonSerialize<SupportSolutionOptionModel>(item.SupportSolutions.SupportSolutionOptions.Where(x => x.selected == true).FirstOrDefault()); break; case SupportProcessStatus.CustomerReply: m.Name = model.MemberId; m.Message = item.Message; break; case SupportProcessStatus.HandlerReply: m.Name = model.Handler; m.Message = item.Message; break; } string historyStr = PublicMethod.JsonSerialize<SupportHistoryModel>(m); strList = _service.SendContentMethod(strList, target, CustomerCommand.History, historyStr); } return strList; }
public override List<string> Do() { SupportRequirementModel requirement = PublicMethod.JsonDeSerialize<SupportRequirementModel>(_receiveCmd.Content); if (!String.IsNullOrEmpty(requirement.Handler)) { var alreadyRequirement = _service.Requirements.Where(x => x.Id == requirement.Id).FirstOrDefault(); alreadyRequirement.Handler = requirement.Handler; alreadyRequirement.Status = RequirementStatus.Handling; strList = historyContentMethod(alreadyRequirement, strList, SupportProcessStatus.HandlerReply, requirement.Handler); string groupName = PublicMethod.GetToken(); _service.Connector.Subscribe(groupName); strList = _service.SendContentMethod(strList, alreadyRequirement.MemberId, CustomerCommand.Pair, groupName); strList = _service.SendContentMethod(strList, alreadyRequirement.Handler, CustomerCommand.Pair, groupName); } else { var oldRequirement = _service.Requirements.Where(x => x.Id == requirement.Id).FirstOrDefault(); if (oldRequirement != null) { oldRequirement.MemberId = requirement.MemberId; oldRequirement.Status = RequirementStatus.Wait; strList = historyContentMethod(oldRequirement, strList, SupportProcessStatus.CustomerReply, requirement.MemberId); } else { requirement.Id = PublicMethod.GetToken(); requirement.Status = RequirementStatus.Wait; _service.Requirements.Add(requirement); } strList = _service.SendContentMethod(strList, requirement.MemberId, CustomerCommand.Requirement, requirement.Id); } strList = ReNewList(strList); return strList; }
public override List<string> Do() { SupportRequirementModel requirE = _service.Requirements.Where(x => x.Id == _receiveCmd.Content).FirstOrDefault(); requirE.Status = RequirementStatus.Complete; strList = _service.SendContentMethod(strList, requirE.MemberId, CustomerCommand.Close, ""); strList = _service.SendContentMethod(strList, requirE.Handler, CustomerCommand.Close, requirE.QType.ToString()); strList = ReNewList(strList); return strList; }
public override List<string> Do() { string[] strArrayS = _receiveCmd.Content.Split(';'); SupportRequirementModel requirS = _service.Requirements.Where(x => x.Id == strArrayS[0]).FirstOrDefault(); SupportSolutionModel solutionS = requirS.SupportProcesses.Where(x => x.Status == SupportProcessStatus.Solution).LastOrDefault().SupportSolutions; var optionS = solutionS.SupportSolutionOptions.Where(x => x.Id == strArrayS[1]).FirstOrDefault(); optionS.selected = true; optionS.Title = solutionS.Title; strList = _service.SendContentMethod(strList, requirS.MemberId, CustomerCommand.SelectSolution, PublicMethod.JsonSerialize<SupportSolutionOptionModel>(optionS)); strList = _service.SendContentMethod(strList, requirS.Handler, CustomerCommand.SelectSolution, PublicMethod.JsonSerialize<SupportSolutionOptionModel>(optionS)); return strList; }
public override List<string> Do() { TransHandleModel transModel = PublicMethod.JsonDeSerialize<TransHandleModel>(_receiveCmd.Content); SupportRequirementModel preTransRequirement = _service.Requirements.Where(x => x.Id == transModel.RequirementId).FirstOrDefault(); SupportRequirementModel transRequirement = new SupportRequirementModel() { Id = PublicMethod.GetToken(), SupportRequirementId = preTransRequirement.Id, MemberId = preTransRequirement.MemberId, Name = preTransRequirement.Name, Email = preTransRequirement.Email, Status = RequirementStatus.Wait, QType = transModel.QType }; _service.Requirements.Add(transRequirement); preTransRequirement.Status = RequirementStatus.TransHandle; strList = _service.SendContentMethod(strList, preTransRequirement.MemberId, CustomerCommand.Requirement, transRequirement.Id); strList = _service.SendContentMethod(strList, preTransRequirement.Handler, CustomerCommand.Close, preTransRequirement.QType.ToString()); strList = ReNewList(strList); return strList; }
internal void AddSolution(string requirId, string solutionId, out SupportRequirementModel requir) { SupportSolutionModel solution = _service.Solutions.Where(x => x.Id == solutionId).FirstOrDefault(); requir = _service.Requirements.Where(x => x.Id == requirId).FirstOrDefault(); SupportProcessModel model = new SupportProcessModel() { Status = SupportProcessStatus.Solution, SupportSolutions = new SupportSolutionModel() { Id = solution.Id, Title = solution.Title, SupportSolutionOptions = new List<SupportSolutionOptionModel>() } }; foreach (SupportSolutionOptionModel item in solution.SupportSolutionOptions) { model.SupportSolutions.SupportSolutionOptions.Add(new SupportSolutionOptionModel() { Id = item.Id, Description = item.Description }); } requir.SupportProcesses.Add(model); }