/// <summary> /// Raises the <see cref="Control.DataBind()"/> event. /// </summary> /// <param name="e">An <see cref="EventArgs"/> object that contains the event data.</param> protected override void OnDataBinding(EventArgs e) { string cid = CPProfile.Cid; if (!string.IsNullOrEmpty(cid)) { this._newMessageCount = CmoMailbox.GetMailbox(cid, this.Elections).CountUnopened(); } }
/// <summary> /// Handles the <see cref="Control.OnLoad" /> event that occurs as an instance of the page is being created. /// </summary> /// <param name="e">An <see cref="EventArgs" /> that contains the event data.</param> protected override void OnLoad(EventArgs e) { base.OnLoad(e); this.DataSource = CmoMailbox.GetMailbox(CPProfile.Cid, CPProfile.Elections); this.DataSource.Username = User.Identity.Name; this.DataSource.ParseQueryString(Request.QueryString); if (!Page.IsPostBack) { this.DataBind(); } }
private CmoMailbox GetMailbox(CmoMailboxView?view = null) { var mailbox = CmoMailbox.GetMailbox(CPProfile.Cid, CPProfile.Elections); mailbox.Username = User.Identity.Name; if (view.HasValue) { mailbox.GetMessages(view.Value); } return(mailbox); }
/// <summary> /// Handles the <see cref="Control.OnLoad" /> event that occurs as an instance of the page is being created. /// </summary> /// <param name="e">An <see cref="EventArgs" /> that contains the event data.</param> protected override void OnLoad(EventArgs e) { base.OnLoad(e); string UniqueID = Request.QueryString[CmoMailboxMessageList.MessageIdParameterName]; _mailbox = CmoMailbox.GetMailbox(CPProfile.Cid, CPProfile.Elections, Request.QueryString); _mailbox.Username = User.Identity.Name; if (!Page.IsPostBack) { _datasource = GetMessage(UniqueID); this.DataBind(); } Messages master = this.Master as Messages; if (master != null) { master.DataSource = _mailbox; master.DataBind(); } }