Example #1
0
        private async Task <List <NoticeListInfoDto> > GetMessageData()
        {
            try
            {
                var result = await _noticeMngService.SearchMadeNotifiList("19000101",
                                                                          "21001231",
                                                                          "",
                                                                          "U",
                                                                          "1",
                                                                          "",
                                                                          "",
                                                                          CommonContext.Account.UserId);

                if (result.ResultCode == Module.ResultType.Success)
                {
                    List <NoticeListInfoDto> noticeList = CommonHelper.DecodeString <List <NoticeListInfoDto> >(result.Body);
                    int i = 1;
                    noticeList.Select(c => { c.SeqNo = i++; return(c); }).ToList();
                    return(noticeList);
                }
            }
            catch (Exception)
            {
            }
            return(null);
        }
        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();
            }
        }