public override void parse(int sid, string str) { this.sid = sid; string[] strArr = str.Split('|'); checkLength(strArr.Length, 9); this.entranceId = StringKit.toInt(strArr[1]); this.icon = strArr[2]; parse_timeLimit(strArr[3]); this.name = strArr[4]; this.activiteDesc = strArr[5]; this.levelLimit = StringKit.toInt(strArr[6]); this.order = StringKit.toInt(strArr[7]); this.type = StringKit.toInt(strArr[8]); if (this.type == NoticeType.XIANSHI_FANLI) { RebateInfoManagement.Instance.rebateNoticeID = sid; } this.content = getContent(type); parse_content(strArr[9]); }
private async void SaveNoticeInfo(string saveType) { try { if (_noticeId == 0 && saveType.Equals("C")) { await Navigation.PopAsync(); return; } //通知标题 if (string.IsNullOrEmpty(NoticeTitle) || NoticeTitle.Trim() == "") { _commonFun.AlertLongText("请输入通知标题"); return; } //通知有效期 if (Convert.ToDateTime(StartNoticeDate.ToString("yyyy-MM-dd")) > Convert.ToDateTime(EndNoticeDate.ToString("yyyy-MM-dd"))) { _commonFun.AlertLongText("开始日期不能大于结束日期"); return; } //通知对象 if (!DisHasSelect) { _commonFun.AlertLongText("请选择经销商"); return; } //if (!DepHasSelect) //{ // _commonFun.AlertLongText("请选择部门"); // return; //} //结果反馈 //通知内容 if (string.IsNullOrEmpty(NoticeContent) || NoticeContent.Trim() == "") { _commonFun.AlertLongText("请输入通知内容"); return; } _commonFun.ShowLoading("保存中..."); if (_commonHelper.IsNetWorkConnected() == true) { try { List <MultiSelectDto> saveDepList = new List <MultiSelectDto>(); if (AllDepItems == null || AllDepItems.Count == 0) { saveDepList.Add(new MultiSelectDto() { DisCode = "0", DisName = "" }); } else { saveDepList = AllDepItems; } string disdepList = CommonUtil.DisAndDepToString(AllDisItems, saveDepList); var result = await _notifiMngService.SaveMadeNotifi(NoticeTitle, StartNoticeDate.ToString("yyyyMMdd"), EndNoticeDate.ToString("yyyyMMdd"), disdepList, ReplySelected == 0? "0" : "1", NoticeContent, NotifiAttachmentList, saveType.ToString(), _noticeId, Convert.ToInt32(CommonContext.Account.UserId)); if (result.ResultCode == Module.ResultType.Success) { _noticeId = 0; //发条消息让 审批查询,通知结果查询查询 MessagingCenter.Send <string>("", MessageConst.NOTIFI_SAVEREFRESH_GO); await Navigation.PopAsync(true); _commonFun.AlertLongText("保存成功"); } 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("操作异常,请重试。-->NotifiMngViewModel"); return; } }