public ActionResult GetNotices(int page = 1, int type=0, string request="") { List<Notice> noticesList = new List<Notice>(); TViewSummary view = new TViewSummary(); view.CurrentPage = page; if (!request.Equals("")) { view.SearchStr = request; } TNotice[] notices = new TNotice[0]; TAuthHeader header = new TAuthHeader(); header.SessionID = (String)Session["sessionID"]; header.SessionKey = (String)Session["sessionKey"]; client.TAuthHeaderValue = header; try { client.GetNotices(type, ref view, ref notices); } catch (Exception ex) { return Json(ex.Message); } bool isRead = type == ciNoticeStatusUnread ? false : true; foreach (TNotice notice in notices) { noticesList.Add(new Notice(DateTimeUtils.DoubleToDateTime(notice.NoticeDate).ToString("dd.MM.yyyy HH:mm:ss"), notice.Title, notice.HyperText.Equals("") ? notice.Text : notice.HyperText, notice.NoticeID, isRead, notice.IsSigned == 1 ? true : false)); } PageStateStruc p; p.notices = noticesList; p.viewSummary = view; return Json(p); }
/// <remarks/> public void GetNoticesAsync(int NoticeStatus, TViewSummary ViewSummary, TNotice[] Notices) { this.GetNoticesAsync(NoticeStatus, ViewSummary, Notices, null); }
/// <remarks/> public void GetNoticesAsync(int NoticeStatus, TViewSummary ViewSummary, TNotice[] Notices, object userState) { if ((this.GetNoticesOperationCompleted == null)) { this.GetNoticesOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetNoticesOperationCompleted); } this.InvokeAsync("GetNotices", new object[] { NoticeStatus, ViewSummary, Notices}, this.GetNoticesOperationCompleted, userState); }
public bool GetNotices(int NoticeStatus, ref TViewSummary ViewSummary, ref TNotice[] Notices) { object[] results = this.Invoke("GetNotices", new object[] { NoticeStatus, ViewSummary, Notices}); ViewSummary = ((TViewSummary)(results[1])); Notices = ((TNotice[])(results[2])); return ((bool)(results[0])); }