Пример #1
0
        private void BindGrid(string mode)
        {
            if (mode == Global.ModeAllTime)
            {
                gvAcknowledgementsReceived.DataSource = acknowledgementDtoService.ReadReceived(username);
                gvAcknowledgementsReceived.DataBind();

                gvAcknowledgementsGiven.DataSource = acknowledgementDtoService.ReadGiven(username);
                gvAcknowledgementsGiven.DataBind();
            }
            else if (mode == Global.ModeAllTimeRec)
            {
                gvAcknowledgementsReceived.DataSource = acknowledgementDtoService.ReadReceived(username);
                gvAcknowledgementsReceived.DataBind();

                fldsAcknowledgementsGiven.Visible = false;
            }
            else if (mode == Global.ModeThisMonth)
            {
                ltrMonth.Text = $" for {DateTime.Today.ToString("MMMM yyyy", CultureInfo.InvariantCulture)}";

                gvAcknowledgementsReceived.DataSource = acknowledgementDtoService.ReadReceivedThisMonth(username);
                gvAcknowledgementsReceived.DataBind();

                fldsAcknowledgementsGiven.Visible = false;
            }
        }
Пример #2
0
        protected void gvUserAcknowledgements_PageIndexChanging(object sender, GridViewPageEventArgs e)
        {
            username = HttpContext.Current.User.Identity.Name;

            gvUserAcknowledgements.DataSource = acknowledgementDtoService.ReadReceived(username);
            gvUserAcknowledgements.PageIndex  = e.NewPageIndex;
            gvUserAcknowledgements.DataBind();
        }