コード例 #1
0
        /// <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();
            }
        }
コード例 #2
0
 /// <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();
     }
 }
コード例 #3
0
        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);
        }
コード例 #4
0
ファイル: View.aspx.cs プロジェクト: simoncwu/CAccess
        /// <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();
            }
        }