private async void RefreshPage(string taskId) { try { _commonFun.ShowLoading("查询中..."); var taskList = await _localScoreService.SearchTaskItem(taskId, ""); if (taskList != null && taskList.Count > 0) { Init(taskList); } else { _commonFun.AlertLongText("没有数据"); } } catch (OperationCanceledException) { _commonFun.HideLoading(); _commonFun.AlertLongText("请求超时,请重试"); } catch (Exception) { _commonFun.HideLoading(); _commonFun.AlertLongText("查询异常,请重试"); } finally { _commonFun.HideLoading(); } }
private void SearchTask() { try { int disId = 0; if (CommonContext.Account.UserType == "D" || CommonContext.Account.UserType == "S") { int.TryParse(CommonContext.Account.OrgServerId, out disId); } else { disId = DisId; } if (disId == 0) { _commonFun.AlertLongText("请选择经销商"); return; } else if (StartDate > EndDate) { _commonFun.AlertLongText("开始日期不能大于结束日期"); return; } Device.BeginInvokeOnMainThread(async() => { await Navigation.PushAsync <TaskListViewModel>( (vm, v) => vm.Init(disId, StartDate.ToString("yyyy-MM-dd"), EndDate.ToString("yyyy-MM-dd"), false, SourceTypeCode), true); }); } catch (Exception) { _commonFun.AlertLongText("操作异常,请重试。-->ViewRecordViewModel"); return; } }
private void GetImproveResultOrPlan(List <RequestParameter> param) { try { string startDate = param.Find(p => p.Name == "StartDate").Value.Replace("-", ""); string endDate = param.Find(p => p.Name == "EndDate").Value.Replace("-", ""); string statue = param.Find(p => p.Name == "Statue").Value; int serviceId = Int32.Parse(param.Find(p => p.Name == "ServiceId").Value); int departmentId = Int32.Parse(param.Find(p => p.Name == "DepartmentId").Value); int userId = Int32.Parse(CommonContext.Account.UserId); string itemName = ItemName; int planid = Int32.Parse(param.Find(p => p.Name == "PlanSelect").Value); string sourceType = param.Find(p => p.Name == "SourceType").Value; if (param.Find(p => p.Name == "StatueType").Value == "A") { GetImprovePlan(itemName, startDate, endDate, userId, "A", statue, serviceId, departmentId, planid, sourceType); } else { GetImproveResult(itemName, startDate, endDate, userId, "R", statue, serviceId, departmentId, planid, sourceType); } } catch (Exception) { _commonFun.AlertLongText("操作异常,请重试。-->ImproveSearchViewModel"); return; } }
private async void ClosePop() { try { await PopupNavigation.PopAsync(); } catch (Exception) { _commonFun.AlertLongText("操作异常,请重试。-->UpdatePopViewModel"); return; } }
public async void GetPushInfo(string Id) { if (_commonHelper.IsNetWorkConnected() == true) { try { _commonFun.ShowLoading("查询中..."); // TO-DO var result = await _reviewPlansService.GetPushInfo(Id); if (result.ResultCode == Module.ResultType.Success) { var List = JsonConvert.DeserializeObject <List <PushInfoDto> >(result.Body); //CasesInfoDto caseInfoDto = CommonHelper.DecodeString<CasesInfoDto>(result.Body); if (List != null) { PushTitle = List[0].Title; PushContent = List[0].Content; _commonFun.HideLoading(); } else { _commonFun.HideLoading(); _commonFun.ShowToast("没有数据"); } } else { _commonFun.HideLoading(); _commonFun.AlertLongText("查询失败,请重试。 " + result.Msg); } } catch (OperationCanceledException) { _commonFun.HideLoading(); _commonFun.AlertLongText("请求超时。"); } catch (Exception e) { _commonFun.HideLoading(); _commonFun.AlertLongText("查询异常,请重试。"); } finally { _commonFun.HideLoading(); } } else { _commonFun.AlertLongText("网络连接异常。"); } }
private void ItemTapped() { try { IsLoading = true; if (SelectedNoticeItem.Status == "T") { GoNoticeMngMadePage(SelectedNoticeItem); } //经销商登陆 else if (CommonContext.Account.UserType == "S") { if (SelectedNoticeItem.FeedbackYN == "Y" && SelectedNoticeItem.NeedReply == "1" && SelectedNoticeItem.Status != "U") { GoNoticeFeedbackPage(SelectedNoticeItem); } else if (SelectedNoticeItem.Status == "U" || SelectedNoticeItem.Status == "R") { GoNoticeMngMadePage(SelectedNoticeItem); } else { GoNotifiMngReaderListPage(SelectedNoticeItem); } } //部门登陆 else if (CommonContext.Account.UserType == "D") { if (SelectedNoticeItem.NeedReply == "1" && SelectedNoticeItem.Status != "U") { GoNoticeFeedbackPage(SelectedNoticeItem); } else { GoNoticeMngMadePage(SelectedNoticeItem); } } else//跳转至通知对象列表 { GoNotifiMngReaderListPage(SelectedNoticeItem); } IsLoading = false; } catch (Exception) { _commonFun.AlertLongText("操作异常,请重试。-->NotifiMngSearchViewModel"); return; } }
public ImproveIndexViewModel() { try { improveService = Resolver.Resolve <IImproveService>(); _commonFun = Resolver.Resolve <ICommonFun>(); _commonHelper = Resolver.Resolve <CommonHelper>(); //MessagingCenter.Unsubscribe<ImproveIndexPage>(this, MessageConst.IMPROVE_RESULT_GET); //MessagingCenter.Subscribe<ImproveIndexPage>(this, MessageConst.IMPROVE_RESULT_GET, (c) => // { // GetImproveResultOrResultApproval(); // }); MessagingCenter.Unsubscribe <string>(this, MessageConst.IMPROVE_PLANLSTDATA_GET); MessagingCenter.Subscribe <string>(this, MessageConst.IMPROVE_PLANLSTDATA_GET, (c) => { if (c == "A") { GetImprovePlanOrPlanApproval(); } else { GetImproveResultOrResultApproval(); } }); } catch (Exception) { _commonFun.AlertLongText("操作异常,请重试。-->ImproveIndexViewModel"); return; } }
public NotifiMngReaderListViewModel() { try { _commonFun = Resolver.Resolve <ICommonFun>(); _commonHelper = Resolver.Resolve <CommonHelper>(); _notifiMngService = Resolver.Resolve <INotifiMngService>(); ItemTappedCommand = new RelayCommand(TappedCommand); //MessagingCenter.Unsubscribe<string>(this, MessageConst.NOTICE_READERLIST_SEARCH); //MessagingCenter.Subscribe<string>(this, MessageConst.NOTICE_READERLIST_SEARCH, (c) => //{ // _paramNotice = c; // SearchNoticeReadersList(c); //}); MessagingCenter.Unsubscribe <string>(this, MessageConst.NOTICE_READERLIST_REFRESH); MessagingCenter.Subscribe <string>(this, MessageConst.NOTICE_READERLIST_REFRESH, (c) => { if (!string.IsNullOrWhiteSpace(_paramNotice) && _paramNotice != "0") { SearchNoticeReadersList(_paramNotice); } }); } catch (Exception) { _commonFun.AlertLongText("操作异常,请重试。-->NotifiMngReaderListViewModel"); return; } }
public CustImproveViewModel() { try { _commonFun = Resolver.Resolve <ICommonFun>(); _commonHelper = Resolver.Resolve <CommonHelper>(); _localScoreService = Resolver.Resolve <ILocalScoreService>(); Device.BeginInvokeOnMainThread(async() => { var cardType = await _localScoreService.LocalGetTypeFromHiddenCode("16"); if (cardType != null && cardType.Count > 0) { foreach (var item in cardType) { _dIcCardType.Add(item.Value, item.Name); } } else { } }); } catch (Exception) { _commonFun.AlertLongText("操作异常,请重试。-->LocalRegistScoreViewModel"); return; } }
public CalendarIndexViewModel() { try { _commonFun = Resolver.Resolve <ICommonFun>(); _commonHelper = Resolver.Resolve <CommonHelper>(); _calendarService = Resolver.Resolve <ICalendarService>(); EventDates = new List <DateTime>(); CalendarBydateList = new ObservableCollection <CalenderListAllDto>(); MessagingCenter.Subscribe <string>( this, "SearchCalendarData", (date) => { SearchCalendarData(date); }); MessagingCenter.Subscribe <string>( this, "SearchDataByDate", (date) => { SearchDataByDate(date); }); } catch (Exception) { _commonFun.AlertLongText("操作异常,请重试。-->CalendarIndexViewModel"); return; } }
public NotifiFeedbackViewModel() { try { _commonFun = Resolver.Resolve <ICommonFun>(); _commonHelper = Resolver.Resolve <CommonHelper>(); _notifiMngService = Resolver.Resolve <INotifiMngService>(); _tourService = Resolver.Resolve <ITourService>(); //Device.BeginInvokeOnMainThread(() => //{ // GetNoticeApproalDetail(NotifiContentItem.NoticeReaderId); //}); MessagingCenter.Unsubscribe <List <RequestParameter> >(this, MessageConst.CASEATTACH_DELETE); MessagingCenter.Subscribe <string>( this, MessageConst.CASEATTACH_DELETE, (SeqNo) => { DeleteCaseAttach(SeqNo); }); } catch (Exception) { _commonFun.AlertLongText("操作异常,请重试。-->NotifiFeedbackViewModel"); return; } }
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(); } }
public LocalRegistScoreViewModel() { try { _tourService = Resolver.Resolve <ITourService>(); _commonFun = Resolver.Resolve <ICommonFun>(); _commonHelper = Resolver.Resolve <CommonHelper>(); _localScoreService = Resolver.Resolve <ILocalScoreService>(); _remoteService = Resolver.Resolve <IRemoteService>(); _tapCommand = new Command(ImageTaped); MessagingCenter.Subscribe <LocalRegistScorePage>(this, "CheckBoxChanged", (obj) => { if (CSList.Any(p => p.IsCheck == true)) { CurrentScore = "0"; CurrentSystem.Score = 0; } else { CurrentScore = "1"; CurrentSystem.Score = 1; } }); MessagingCenter.Subscribe <StandardPic>(this, "DeleteLossImage", (obj) => { //删除失分照片 DeleteImage(obj); }); MessagingCenter.Subscribe <PictureStandard>(this, "RegistScoreItemTapped", (obj) => { UploadStandPic(obj.StandardPicId); }); MessagingCenter.Subscribe <PictureStandard>(this, "PreviewPlanAttechment", (obj) => { if (!string.IsNullOrEmpty(obj.Url)) { PreviewStanderImage(obj.Url); } }); MessagingCenter.Subscribe <PictureStandard>(this, "DeletePlanAttechment", (obj) => { if (!string.IsNullOrEmpty(obj.Url)) { DeleteStanderImage(obj); } }); } catch (Exception) { _commonFun.AlertLongText("操作异常,请重试。-->CustImproveViewModel"); return; } }
private async void GoImproveDistributionPage(ImprovementMngDto improvementMng) { try { CommonContext.ImpPlanStatus = improvementMng.PlanStatus; if (CommonContext.Account.UserType == "S") { await Navigation.PushAsync <ImproveDistributionViewModel>((vm, v) => vm.Init(improvementMng), true); } else { if (improvementMng.PlanStatus == "A") { _commonFun.AlertLongText("未分配,没有分配详细"); } else { await Navigation.PushAsync <ImproveDistributionViewModel>((vm, v) => vm.Init(improvementMng), true); } } } catch (Exception) { } }
public SystemListViewModel() { try { _tourService = Resolver.Resolve <ITourService>(); _commonFun = Resolver.Resolve <ICommonFun>(); if (CommonContext.Account.UserType == "S" || CommonContext.Account.UserType == "D") { //cannot display the set button IsSetVisible = false; } else { IsSetVisible = true; } MessagingCenter.Subscribe <List <ItemOfTaskDto> >(this, "SendSystemList", (obj) => { _taskId = obj.FirstOrDefault().TPId.ToString(); Init(obj); }); MessagingCenter.Subscribe <CommonMessage>(this, "ResetTaskID", (obj) => { if (obj.TaskID == "-1") { _refresh = false; } else { _refresh = true; } }); MessagingCenter.Subscribe <SystemListPage>(this, "RefreshSystem", (obj) => { if (_refresh) { RefreshPage(TaskId); } }); MessagingCenter.Subscribe <ItemOfTaskDto>(this, "GoRegisterPage", (obj) => { GoRegistScore(obj); }); } catch (Exception) { _commonFun.AlertLongText("操作异常,请重试。-->SystemListViewModel"); return; } }
public void Init(List <ApproalLogDto> dtolist, string pageTitle) { try { ApproalLogDtoList = dtolist; PageTitle = pageTitle; } catch (Exception) { _commonFun.AlertLongText("操作异常,请重试。-->NoticeApproalLogViewModel"); return; } }
public UpdatePopViewModel() { try { _tourService = Resolver.Resolve <ITourService>(); _commonFun = Resolver.Resolve <ICommonFun>(); } catch (Exception) { _commonFun.AlertLongText("操作异常,请重试。-->UpdatePopViewModel"); return; } }
public CalendarRegViewModel() { try { _calendarService = Resolver.Resolve <ICalendarService>(); _commonFun = Resolver.Resolve <ICommonFun>(); } catch (Exception) { _commonFun.AlertLongText("操作异常,请重试。-->CalendarRegViewModel"); return; } }
public ReviewPlansViewModel() { try { _commonFun = Resolver.Resolve <ICommonFun>(); _commonHelper = Resolver.Resolve <CommonHelper>(); _reviewPlansService = Resolver.Resolve <IReviewPlansService>(); } catch (Exception) { _commonFun.AlertLongText("操作异常,请重试。-->ReviewPlansViewModel"); return; } }
public ChangePasswordViewModel() { try { _accountService = Resolver.Resolve <IAccountService>(); _commonFun = Resolver.Resolve <ICommonFun>(); _commonHelper = Resolver.Resolve <CommonHelper>(); } catch (Exception) { _commonFun.AlertLongText("操作异常,请重试。-->ChangePasswordViewModel"); return; } }
public NoticeApproalLogViewModel() { try { _commonFun = Resolver.Resolve <ICommonFun>(); _commonHelper = Resolver.Resolve <CommonHelper>(); _notifiMngService = Resolver.Resolve <INotifiMngService>(); } catch (Exception) { _commonFun.AlertLongText("操作异常,请重试。-->NoticeApproalLogViewModel"); return; } }
private async void SearchNoticeReadersList(string noticeId) { try { _commonFun.ShowLoading("查询中..."); var now = DateTime.Now.ToString(); var result = await _notifiMngService.SearchNoticeReaders(noticeId, CommonContext.Account.UserId); if (null != result && result.ResultCode == Module.ResultType.Success) { var noticeReaderList = JsonConvert.DeserializeObject <List <NotifiReadersDto> >(result.Body); if (noticeReaderList != null && noticeReaderList.Count > 0) { NoticeReaderList = noticeReaderList; } else { _commonFun.AlertLongText(result.Msg); } } } catch (OperationCanceledException) { _commonFun.HideLoading(); _commonFun.AlertLongText("请求超时,请重试"); } catch (Exception) { _commonFun.HideLoading(); _commonFun.AlertLongText("查询异常,请重试"); } finally { _commonFun.HideLoading(); } }
public async void SearchReviewPlansList() { try { _commonFun.ShowLoading("查询中..."); var result = await _reviewPlansService.GetReviewPlansList_Mobile(CommonContext.Account.UserId); if (null != result && result.ResultCode == Module.ResultType.Success) { var reviewPlansList = JsonConvert.DeserializeObject <List <ReviewPlansListDto> >(result.Body); if (reviewPlansList != null && reviewPlansList.Count > 0) { ReviewPlansList = reviewPlansList; } else { ReviewPlansList = new List <ReviewPlansListDto>(); //_commonFun.AlertLongText("没有数据."); } } } catch (OperationCanceledException) { _commonFun.HideLoading(); _commonFun.AlertLongText("请求超时,请重试"); } catch (Exception) { _commonFun.HideLoading(); _commonFun.AlertLongText("查询异常,请重试"); } finally { _commonFun.HideLoading(); } }
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(); } }
int _noticeId = 0;//本通知Id #region constructor public NotifiMngViewModel() { try { _tourService = Resolver.Resolve <ITourService>(); _notifiMngService = Resolver.Resolve <INotifiMngService>(); _commonHelper = Resolver.Resolve <CommonHelper>(); _commonFun = Resolver.Resolve <ICommonFun>(); #region MultiSelectDistributor MessagingCenter.Unsubscribe <List <MultiSelectDto> >(this, MessageConst.NOTICE_DISTRIBUTOR_SET); MessagingCenter.Subscribe <List <MultiSelectDto> >( this, MessageConst.NOTICE_DISTRIBUTOR_SET, (paramList) => { SetNoticeDistributor(paramList); }); #endregion #region MultiSelectDepartment MessagingCenter.Unsubscribe <List <MultiSelectDto> >(this, MessageConst.NOTICE_DEPARTMENT_SET); MessagingCenter.Subscribe <List <MultiSelectDto> >( this, MessageConst.NOTICE_DEPARTMENT_SET, (paramList) => { SetNoticeDepartment(paramList); }); #endregion #region Attachment MessagingCenter.Subscribe <string>( this, MessageConst.NOTICE_ATTECHMENT_DELETE, (seqNo) => { DeleteAttechmentNotice(seqNo); }); #endregion } catch (Exception) { _commonFun.AlertLongText("操作异常,请重试。-->NotifiMngViewModel"); return; } }
public NotifiMngSearchConditionViewModel() { try { StatusSelectName = "全部"; StatusSelectIndex = ""; ReplySelected = 0; DateTime now = DateTime.Now; StartDate = new DateTime(now.Year, now.Month, 1); EndDate = DateTime.Now; NoticeSelectDis = "全部"; NoticeColorDis = StaticColor.ContentFontColor; DisSelectList = new List <MultiSelectDto>(); NoticeSelectDep = "请选择"; NoticeColorDep = StaticColor.ContentFontColor; DepSelectList = new List <MultiSelectDto>(); NoticeTitle = ""; NoticeNo = ""; _commonFun = Resolver.Resolve <ICommonFun>(); MessagingCenter.Unsubscribe <NameValueObject>(this, MessageConst.NOTICE_STATUSLIST_SELECT); MessagingCenter.Subscribe <NameValueObject>(this, MessageConst.NOTICE_STATUSLIST_SELECT, statusItem => { StatusSelectName = statusItem.Name; StatusSelectIndex = statusItem.Value; }); MessagingCenter.Unsubscribe <List <MultiSelectDto> >(this, MessageConst.NOTICE_DISTRIBUTOR_SET_LIST); MessagingCenter.Subscribe <List <MultiSelectDto> >( this, MessageConst.NOTICE_DISTRIBUTOR_SET_LIST, (paramList) => { SetDisSelectList(paramList); }); MessagingCenter.Unsubscribe <List <MultiSelectDto> >(this, MessageConst.NOTICE_DEPARTMENT_SET_LIST); MessagingCenter.Subscribe <List <MultiSelectDto> >(this, MessageConst.NOTICE_DEPARTMENT_SET_LIST, paramList => { SetDepSelectList(paramList); }); } catch (Exception) { _commonFun.AlertLongText("操作异常,请重试。-->NotifiMngSearchConditionViewModel"); return; } }
public void Init() { try { DateTime now = DateTime.Now; DisplayedMonth = now; SelectedDate = now.ToString("yyyy-MM-dd"); if (Device.OS == TargetPlatform.iOS) { SearchCalendarData(now.ToString("yyyy-MM-dd")); } } catch (Exception) { _commonFun.AlertLongText("操作异常,请重试。-->CalendarIndexViewModel"); return; } }
public ImproveSearchViewModel() { try { improveService = Resolver.Resolve <IImproveService>(); _commonFun = Resolver.Resolve <ICommonFun>(); _commonHelper = Resolver.Resolve <CommonHelper>(); MessagingCenter.Unsubscribe <string>(this, MessageConst.IMPROVE_IMPPLANORRESULTDATA_GET); MessagingCenter.Subscribe <string>(this, MessageConst.IMPROVE_IMPPLANORRESULTDATA_GET, (c) => { if (paramList != null && paramList.Count > 0) { GetImproveResultOrPlan(paramList); } }); MessagingCenter.Subscribe <List <RequestParameter> >(this, MessageConst.PASS_IMPROVESEARCHCONDITION, (param) => { if (param != null && param.Count > 0) { paramList = param; StatueType = param.Find(p => p.Name == "StatueTypeName").Value; StartDate = param.Find(p => p.Name == "StartDate").Value; EndDate = param.Find(p => p.Name == "EndDate").Value; Statue = param.Find(p => p.Name == "StatueName").Value; Service = param.Find(p => p.Name == "ServiceName").Value; Department = param.Find(p => p.Name == "DepartmentName").Value; ItemName = param.Find(p => p.Name == "ItemName").Value; PlanSelectName = param.Find(p => p.Name == "PlanSelectName").Value; SourceTypeName = param.Find(p => p.Name == "SourceTypeName").Value; GetImproveResultOrPlan(param); } else if (paramList != null && paramList.Count > 0) { GetImproveResultOrPlan(paramList); } }); } catch (Exception) { _commonFun.AlertLongText("操作异常,请重试。-->ImproveSearchViewModel"); return; } }
public NoticeApproalViewModel() { try { _commonFun = Resolver.Resolve <ICommonFun>(); _commonHelper = Resolver.Resolve <CommonHelper>(); _notifiMngService = Resolver.Resolve <INotifiMngService>(); } catch (Exception) { _commonFun.AlertLongText("操作异常,请重试。-->NoticeApproalViewModel"); return; } //Device.BeginInvokeOnMainThread(() => //{ // GetNoticeApproalDetail(NotifiContentItem.NoticeReaderId); //}); }