private async void GetPlans(int id, string startTime = "", string endTime = "", string statu = "", string sourceTypeCode = "D") { try { _commonFun.ShowLoading("查询中..."); var result = await _tourService.GetPlans(id, startTime, endTime, statu, sourceTypeCode); if (null != result && result.ResultCode == Module.ResultType.Success) { TaskList = JsonConvert.DeserializeObject<List<TaskOfPlanDto>>(result.Body); } if (TaskList != null && TaskList.Count == 0) { _commonFun.ShowToast("没有数据"); } } catch (OperationCanceledException) { _commonFun.HideLoading(); _commonFun.AlertLongText("请求超时,请重试"); } catch (Exception) { _commonFun.HideLoading(); _commonFun.AlertLongText("查询异常,请重试"); } finally { _commonFun.HideLoading(); } }
private async void GetNoticeStatusList() { try { _commonFun.ShowLoading("查询中..."); //TO-DO var result = await _caseService.GetTypeFromHiddenCode("02"); if (result != null && result.ResultCode == Module.ResultType.Success) { var statusList = JsonConvert.DeserializeObject <List <NameValueObject> >(result.Body); if (statusList != null && statusList.Count > 0) { _commonFun.HideLoading(); statusList.Insert(0, new NameValueObject() { Name = "全部", Value = "" }); SourceList = statusList; LstHeight = SourceList.Count * _lstRowHeight; } else { _commonFun.HideLoading(); SourceList = new List <NameValueObject>(); _commonFun.ShowToast("没有数据"); } } else { _commonFun.HideLoading(); SourceList = new List <NameValueObject>(); _commonFun.AlertLongText("查询失败,请重试。 " + result.Msg); } } catch (OperationCanceledException) { _commonFun.HideLoading(); SourceList = new List <NameValueObject>(); _commonFun.AlertLongText("请求超时。"); } catch (Exception) { _commonFun.HideLoading(); SourceList = new List <NameValueObject>(); _commonFun.AlertLongText("查询失败,请重试。"); } finally { _commonFun.HideLoading(); } }
private async void GetCaseInfoDetail(string caseId) { if (_commonHelper.IsNetWorkConnected() == true) { try { _commonFun.ShowLoading("查询中..."); // TO-DO var result = await _caseService.GetCaseDetailInfo(caseId); if (result.ResultCode == Module.ResultType.Success) { CasesInfoDto caseInfoDto = CommonHelper.DecodeString <CasesInfoDto>(result.Body); if (caseInfoDto != null) { Id = caseInfoDto.Id; CaseNo = caseInfoDto.CaseNo; CaseTypeCode = caseInfoDto.CaseType; CaseType = caseInfoDto.CaseTypeName; CaseTitle = caseInfoDto.CaseTitle; CasePoint = caseInfoDto.CasePoint; LossRemark = caseInfoDto.LossRemark; ImproveRemark = caseInfoDto.ImproveRemark; AttachList = caseInfoDto.AttachList; CaseAttachList = caseInfoDto.AttachList; LstHeight = CaseAttachList.Count * _lstRowHeight; _commonFun.HideLoading(); } else { _commonFun.HideLoading(); _commonFun.ShowToast("没有数据"); } } else { _commonFun.HideLoading(); _commonFun.AlertLongText("查询失败,请重试。 " + result.Msg); } } catch (OperationCanceledException) { _commonFun.HideLoading(); _commonFun.AlertLongText("请求超时。"); } catch (Exception) { _commonFun.HideLoading(); _commonFun.AlertLongText("查询失败,请重试。"); } finally { _commonFun.HideLoading(); } } else { _commonFun.AlertLongText("网络连接异常。"); } }
private async void GetImproveResult(string itemNae, string startDate, string endDate, int userId, string statueType, string statue, int serviceId, int departmentId, int planid, string sourceType) { try { _commonFun.ShowLoading("查询中..."); //TO-DO var result = await improveService.GetResult(itemNae, startDate, endDate, userId, statueType, statue, serviceId, departmentId, planid, sourceType); if (result.ResultCode == Module.ResultType.Success) { List <ImprovementMngDto> improveResultInfo = CommonHelper.DecodeString <List <ImprovementMngDto> >(result.Body); if (improveResultInfo != null && improveResultInfo.Count > 0) { _commonFun.HideLoading(); ImprovePlansOrResults = improveResultInfo; } else { _commonFun.HideLoading(); ImprovePlansOrResults = new List <ImprovementMngDto>(); _commonFun.ShowToast("没有数据"); } } else { _commonFun.HideLoading(); ImprovePlansOrResults = new List <ImprovementMngDto>(); _commonFun.AlertLongText("查询失败,请重试。 " + result.Msg); } } catch (OperationCanceledException) { _commonFun.HideLoading(); ImprovePlansOrResults = new List <ImprovementMngDto>(); _commonFun.AlertLongText("请求超时。"); } catch (Exception) { _commonFun.HideLoading(); ImprovePlansOrResults = new List <ImprovementMngDto>(); _commonFun.AlertLongText("查询异常,请重试。"); } finally { _commonFun.HideLoading(); } }
private async Task GetImproveDitstriLst(string arg) { if (_commonHelper.IsNetWorkConnected() == true) { try { if (arg != "R") { _commonFun.ShowLoading("查询中..."); } int userId = Int32.Parse(CommonContext.Account.UserId); // TO-DO var result = await _improveService.GetResult("", "19000101", "99991231", userId, "A", "A", 0, 0, 0, ""); if (result.ResultCode == Module.ResultType.Success) { List <ImprovementMngDto> improvePlanInfo = CommonHelper.DecodeString <List <ImprovementMngDto> >(result.Body); if (improvePlanInfo != null && improvePlanInfo.Count > 0) { ImproveDistriLst = improvePlanInfo; _commonFun.HideLoading(); } else { _commonFun.HideLoading(); ImproveDistriLst = new List <ImprovementMngDto>(); _commonFun.ShowToast("没有数据"); } } else { _commonFun.HideLoading(); ImproveDistriLst = new List <ImprovementMngDto>(); _commonFun.AlertLongText("查询失败,请重试。 " + result.Msg); } } catch (OperationCanceledException) { _commonFun.HideLoading(); ImproveDistriLst = new List <ImprovementMngDto>(); _commonFun.AlertLongText("请求超时。"); } catch (Exception) { _commonFun.HideLoading(); ImproveDistriLst = new List <ImprovementMngDto>(); _commonFun.AlertLongText("查询异常,请重试。"); } finally { _commonFun.HideLoading(); } } else { _commonFun.AlertLongText("网络连接异常。"); } }
public async void GetPlansDtlList(string Id) { if (_commonHelper.IsNetWorkConnected() == true) { try { _commonFun.ShowLoading("查询中..."); // TO-DO var result = await _reviewPlansService.GetPlansDtlList(Id); if (result.ResultCode == Module.ResultType.Success) { var List = JsonConvert.DeserializeObject <List <PlansDtlDto> >(result.Body); //CasesInfoDto caseInfoDto = CommonHelper.DecodeString<CasesInfoDto>(result.Body); if (List != null) { Title = List[0].Title; Name = List[0].Name; VisitDateTime = List[0].VisitDateTime; VisitTypeName = List[0].VisitTypeName; PlansDtlDtoList = List; LstHeight = (32 * List.Count) + 40; _commonFun.HideLoading(); } else { LstHeight = 30; _commonFun.HideLoading(); _commonFun.ShowToast("没有数据"); } } else { _commonFun.HideLoading(); _commonFun.AlertLongText("查询失败,请重试。 " + result.Msg); } } catch (OperationCanceledException) { _commonFun.HideLoading(); _commonFun.AlertLongText("请求超时。"); } catch (Exception) { _commonFun.HideLoading(); _commonFun.AlertLongText("查询异常,请重试。"); } finally { _commonFun.HideLoading(); } } else { _commonFun.AlertLongText("网络连接异常。"); } }
private async void SearchReportLst() { try { _commonFun.ShowLoading("查询中..."); var result = await _reportService.GetAttachmentByUserId(userid, sourceTypeCode, startDate.Replace("-", ""), endDate.Replace("-", "")); if (null != result && result.ResultCode == Module.ResultType.Success) { var casesList = JsonConvert.DeserializeObject <List <ReportAttachmentDto> >(result.Body); if (casesList != null && casesList.Count > 0) { ReportAttachmentLst = casesList; } else { ReportAttachmentLst = new List <ReportAttachmentDto>(); _commonFun.ShowToast("没有数据"); } } } catch (OperationCanceledException) { _commonFun.HideLoading(); _commonFun.AlertLongText("请求超时,请重试"); } catch (Exception) { _commonFun.HideLoading(); _commonFun.AlertLongText("查询异常,请重试"); } finally { _commonFun.HideLoading(); } }
private async void SearchCaseLst() { try { _commonFun.ShowLoading("查询中..."); var result = await _caseService.GetCaseList(userid, startDate, endDate, caseTypeCode, KeyWord); if (null != result && result.ResultCode == Module.ResultType.Success) { var casesList = JsonConvert.DeserializeObject <List <CasesListDto> >(result.Body); if (casesList != null && casesList.Count > 0) { CaseInfoList = casesList; } else { CaseInfoList = new List <CasesListDto>(); _commonFun.ShowToast("没有数据"); } } } catch (OperationCanceledException) { _commonFun.HideLoading(); _commonFun.AlertLongText("请求超时,请重试"); } catch (Exception) { _commonFun.HideLoading(); _commonFun.AlertLongText("查询失败,请重试"); } finally { _commonFun.HideLoading(); } }
private async void SetNoticeDetail(string noticeId) { try { _commonFun.ShowLoading("查询中..."); //TO-DO var result = await _notifiMngService.SearchMadeNoticeDetailInfo(noticeId); if (result.ResultCode == Module.ResultType.Success) { NoticeDetailDto noticeList = CommonHelper.DecodeString <NoticeDetailDto>(result.Body); if (noticeList != null) { _commonFun.HideLoading(); ResultDto = noticeList; NoticeTitle = ResultDto.Title; NoticeNo = ResultDto.NoticeNo; StartNoticeDate = ResultDto.SDate; StartDateStr = ResultDto.SDate.ToString("yyyy-MM-dd"); EndNoticeDate = ResultDto.EDate; EndDateStr = ResultDto.EDate.ToString("yyyy-MM-dd"); ReplySelected = ResultDto.NeedReply; ReplySelectedName = ResultDto.NeedReplyName; AllDisItems = ResultDto.NoticeDisList; AllDepItems = ResultDto.NoticeDepList; NoticeContent = ResultDto.Content; oldAttachmentList = new List <AttachDto>(); oldAttachmentList.AddRange(ResultDto.AttachList); NotifiAttachmentList = oldAttachmentList; LstHeight = oldAttachmentList.Count * _lstRowHeight; List <MultiSelectDto> disList = new List <MultiSelectDto>(); List <MultiSelectDto> depList = new List <MultiSelectDto>(); if ((CommonContext.Account.UserType == "A" || CommonContext.Account.UserType == "R" || CommonContext.Account.UserType == "Z")) { if (ResultDto.Status == "T") { List <ServerDto> serverList = new List <ServerDto>(); foreach (var item in CommonContext.Account.ZionList[0].AreaList) { serverList.AddRange(item.ServerList); } foreach (ServerDto item in serverList) { if (AllDisItems.Exists(a => a.DisCode == item.SId)) { disList.Add(new MultiSelectDto { DisCode = item.SId, DisName = item.SName, IsChecked = true }); } else { disList.Add(new MultiSelectDto { DisCode = item.SId, DisName = item.SName, IsChecked = false }); } } List <DepartmentDto> departmentList = new List <DepartmentDto>(); departmentList.AddRange(CommonContext.Account.DepartmentList); foreach (DepartmentDto item in departmentList) { if (AllDepItems.Exists(a => a.DisCode == item.DId)) { depList.Add(new MultiSelectDto { DisCode = item.DId, DisName = item.DName, IsChecked = true }); } else { depList.Add(new MultiSelectDto { DisCode = item.DId, DisName = item.DName, IsChecked = false }); } } } else { disList = AllDisItems; depList = AllDepItems; } } else if (CommonContext.Account.UserType == "S") { disList.Add(new MultiSelectDto { DisCode = CommonContext.Account.OrgServerId, DisName = CommonContext.Account.OrgServerName, IsChecked = true }); List <DepartmentDto> departmentList = new List <DepartmentDto>(); departmentList.AddRange(CommonContext.Account.DepartmentList); foreach (DepartmentDto item in departmentList) { if (AllDepItems.Exists(a => a.DisCode == item.DId)) { depList.Add(new MultiSelectDto { DisCode = item.DId, DisName = item.DName, IsChecked = true }); } else { depList.Add(new MultiSelectDto { DisCode = item.DId, DisName = item.DName, IsChecked = false }); } } } else { disList.Add(new MultiSelectDto { DisCode = CommonContext.Account.OrgServerId, DisName = CommonContext.Account.OrgServerName, IsChecked = true }); depList.Add(new MultiSelectDto { DisCode = CommonContext.Account.OrgDepartmentId, DisName = CommonContext.Account.OrgDepartmentName, IsChecked = true }); } MessagingCenter.Send <List <MultiSelectDto> >(disList, MessageConst.NOTICE_DISTRIBUTOR_SHOW); MessagingCenter.Send <List <MultiSelectDto> >(depList, MessageConst.NOTICE_DEPARTMENT_SHOW); if (AllDisItems != null && AllDisItems.Count > 0) { NoticeReadersSelect = string.Format("共选择{0}项", AllDisItems.Count); NoticeReadersColor = Color.FromHex("3998C0"); DisHasSelect = true; } else { NoticeReadersSelect = "选择经销商"; NoticeReadersColor = StaticColor.ContentFontColor; DisHasSelect = false; } if (AllDepItems != null && AllDepItems.Count > 0) { NoticeSelectDep = string.Format("共选择{0}项", AllDepItems.Count); NoticeColorDep = Color.FromHex("3998C0");// DepHasSelect = true; } else { NoticeSelectDep = "选择角色"; NoticeColorDep = StaticColor.ContentFontColor; DepHasSelect = false; } _noticeId = ResultDto.NoticeId; } else { _commonFun.HideLoading(); ResultDto = new NoticeDetailDto(); _commonFun.ShowToast("没有数据"); } } else { _commonFun.HideLoading(); ResultDto = new NoticeDetailDto(); _commonFun.AlertLongText("查询失败,请重试。 " + result.Msg); } } catch (OperationCanceledException) { _commonFun.HideLoading(); ResultDto = new NoticeDetailDto(); _commonFun.AlertLongText("请求超时。"); } catch (Exception) { _commonFun.HideLoading(); ResultDto = new NoticeDetailDto(); _commonFun.AlertLongText("查询异常,请重试。"); } finally { _commonFun.HideLoading(); } }
private async void GetImproveDistributionDetail(ImprovementMngDto improvementMng) { try { string improvementId = improvementMng.ImprovementId.ToString(); string impResultId = improvementMng.ImpResultId.ToString(); string tPId = improvementMng.TPId.ToString(); string itemId = improvementMng.ItemId.ToString(); if (_commonHelper.IsNetWorkConnected() == true) { try { _commonFun.ShowLoading("查询中..."); var result = await improveService.GetImpPlanOrResultDetail(improvementId, "0", impResultId, tPId, itemId); if (result.ResultCode == Module.ResultType.Success) { _commonFun.HideLoading(); var impAllocateData = CommonHelper.DecodeString <ImpAllocateDto>(result.Body); if (impAllocateData != null) { if (CommonContext.Account.UserType == "S") { if (impAllocateData.PlanStatus == "A") { IsEdit = true; IsShow = false; } else { IsEdit = false; IsShow = true; } } else { IsEdit = false; IsShow = true; } ExecDepartmentName = impAllocateData.ExecDepartmentName; AllocateYN = impAllocateData.AllocateYN; PlanApproal = impAllocateData.PlanApproalYN == true ? "评估师" : "总经理"; ResultApproal = impAllocateData.ResultApproalYN == true ? "评估师" : "总经理"; StandardList = impAllocateData.StandardList; PicList = impAllocateData.PicList; LossImageList = impAllocateData.PicList.Count * 40; PicDescList = impAllocateData.PicDescList; if (PicDescList != null) { foreach (var item in PicDescList) { item.IsPreview = string.IsNullOrEmpty(item.Url) ? false : true; } } ImprovementCaption = impAllocateData.ImprovementCaption; LostDescription = impAllocateData.LostDescription; Score = impAllocateData.Score.ToString(); PlanFinishDate = impAllocateData.PlanFinishDate; ResultFinishDate = impAllocateData.ResultFinishDate; PicDescLstHeight = 40 * PicDescList.Count + 45; StandardLstHeight = 40 * StandardList.Count + 45; } else { _commonFun.HideLoading(); _commonFun.ShowToast("查无数据"); } } else { _commonFun.HideLoading(); _commonFun.AlertLongText("查询失败,请重试。 " + result.Msg); } } catch (OperationCanceledException) { _commonFun.HideLoading(); _commonFun.AlertLongText("请求超时。"); } catch (Exception) { _commonFun.HideLoading(); _commonFun.AlertLongText("查询异常,请重试。"); } finally { _commonFun.HideLoading(); } } else { _commonFun.AlertLongText("网络连接异常"); } } catch (Exception) { _commonFun.AlertLongText("操作异常,请重试。-->ImproveDistributionViewModel"); return; } }
public async void GetImproveResultOrResultApproval() { try { if (CommonContext.Account.UserType == "A" || CommonContext.Account.UserType == "R") { return; } _commonFun.ShowLoading("查询中..."); //TO-DO APIResult result = new APIResult(); if (CommonContext.Account.UserType == "D") { result = await improveService.GetResult("", "19000101", "99991231", Convert.ToInt32(CommonContext.Account.UserId), "R", "A,D", 0, 0, 0); } else if (CommonContext.Account.UserType == "S") { result = await improveService.GetResult("", "19000101", "99991231", Convert.ToInt32(CommonContext.Account.UserId), "R", "C,F", 0, 0, 0); } else if (CommonContext.Account.UserType == "Z") { result = await improveService.GetResult("", "19000101", "99991231", Convert.ToInt32(CommonContext.Account.UserId), "R", "E", 0, 0, 0); } if (result.ResultCode == Module.ResultType.Success) { List <ImprovementMngDto> improveResultInfo = CommonHelper.DecodeString <List <ImprovementMngDto> >(result.Body); if (improveResultInfo != null && improveResultInfo.Count > 0) { _commonFun.HideLoading(); //ImproveResults = improveResultInfo; ImprovePlansOrResults = improveResultInfo; } else { _commonFun.HideLoading(); ImprovePlansOrResults = new List <ImprovementMngDto>(); _commonFun.ShowToast("没有数据"); } } else { _commonFun.HideLoading(); ImprovePlansOrResults = new List <ImprovementMngDto>(); _commonFun.AlertLongText("查询失败,请重试。 " + result.Msg); } } catch (OperationCanceledException) { _commonFun.HideLoading(); ImprovePlansOrResults = new List <ImprovementMngDto>(); _commonFun.AlertLongText("请求超时。"); } catch (Exception) { _commonFun.HideLoading(); ImprovePlansOrResults = new List <ImprovementMngDto>(); _commonFun.AlertLongText("查询异常,请重试。"); } finally { _commonFun.HideLoading(); } }
private async void GetNoticeList(List <RequestParameter> param) { try { _commonFun.ShowLoading("查询中..."); string fromDate = param.Find(p => p.Name == "StartDate").Value.Replace("-", ""); string toDate = param.Find(p => p.Name == "EndDate").Value.Replace("-", ""); string noticeReaders = param.Find(p => p.Name == "NoticeReaders").Value; string status = param.Find(p => p.Name == "StatusSelectIndex").Value; string needReply = param.Find(p => p.Name == "ReplySelected").Value; string title = param.Find(p => p.Name == "NoticeTitle").Value; string noticeNo = param.Find(p => p.Name == "NoticeNo").Value; string inUserId = CommonContext.Account.UserId; //TO-DO var result = await _noticeMngService.SearchMadeNotifiList(fromDate, toDate, noticeReaders, status, needReply, title, noticeNo, inUserId); if (result.ResultCode == Module.ResultType.Success) { List <NoticeListInfoDto> noticeList = CommonHelper.DecodeString <List <NoticeListInfoDto> >(result.Body); if (noticeList != null && noticeList.Count > 0) { _commonFun.HideLoading(); NoticeList = noticeList; } else { _commonFun.HideLoading(); NoticeList = new List <NoticeListInfoDto>(); _commonFun.ShowToast("没有数据"); } } else { _commonFun.HideLoading(); NoticeList = new List <NoticeListInfoDto>(); _commonFun.AlertLongText("查询失败,请重试。 " + result.Msg); } } catch (OperationCanceledException) { _commonFun.HideLoading(); NoticeList = new List <NoticeListInfoDto>(); _commonFun.AlertLongText("请求超时。"); } catch (Exception) { _commonFun.HideLoading(); NoticeList = new List <NoticeListInfoDto>(); _commonFun.AlertLongText("查询异常,请重试。"); } finally { _commonFun.HideLoading(); } }