private void MonthRangePickerUpdate(object sender, EventArgs e)
 {
     if (SessionWrapper.Instance.Get.IsCustomerSelected)
     {
         TransactionGridView.ResetPaginationAndFocus();
         presenter.LoadTransactionArchive(MonthRangePicker.DateRange, SessionWrapper.Instance.Get.CustomerFromQueryString.Id, ChkBoxTransactionInvoices.Checked);
     }
 }
        protected override void ScopeChanged(object sender, EventArgs e)
        {
            base.ScopeChanged(sender, e);

            presenter.InitializeForScope(SessionWrapper.Instance.Get.Scope);

            TransactionGridView.ResetPaginationAndFocus();
            presenter.LoadCurrentTransactions(SessionWrapper.Instance.Get.CustomerFromQueryString.Id);
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            int selectedIndex = RetentionGridView.FocusedRowIndex;

            if (Request.UserAgent.IndexOf("AppleWebKit") > 0)
            {
                Request.Browser.Adapters.Clear();
            }

            ConfigureGridColumns();
            datePicker.Update += DatePickerUpdate;
            presenter          = RetentionSchedulePresenter.Create(this);
            DetailView.Visible = true;

            // start related ref:CFF-18
            if (SessionWrapper.Instance.Get != null)
            {
                if (SessionWrapper.Instance.Get.ClientFromQueryString != null)
                {
                    //targetName = ": " + SessionWrapper.Instance.Get.ClientFromQueryString.Name;
                    String LoginClientName = SessionWrapper.Instance.Get.ClientFromQueryString.Name;

                    if (SessionWrapper.Instance.Get.ClientFromQueryString.ClientFacilityType == 0)
                    {
                        RetnSchedulesLiteral.Text          = "Retentions/Fees & Charges";
                        RetnSchedulesLiteral2.Text         = "Retention/Fees & Charges Schedules: " + LoginClientName;
                        PageDescription.DescriptionContent = "Retention/Fees & Charges Schedules";
                        varRepurchases = "Repurch/Prepay"; //testName = "facilityType == 1";
                    }
                    else if (SessionWrapper.Instance.Get.ClientFromQueryString.ClientFacilityType == 1)
                    {
                        RetnSchedulesLiteral.Text          = "Retentions";
                        RetnSchedulesLiteral2.Text         = "Retention Schedules: " + LoginClientName;
                        PageDescription.DescriptionContent = "Retention Schedules"; //testName = "facilityType == 1";
                        varRepurchases = "Repurchases";
                    }
                    else
                    {
                        RetnSchedulesLiteral.Text          = "Monthly Fees & Charges";
                        RetnSchedulesLiteral2.Text         = "Monthly Fee Schedules: " + LoginClientName;
                        PageDescription.DescriptionContent = "Monthly Fees & Charges Schedules"; //testName = "facilityType != 1";
                        varRepurchases = "Prepayments";
                    }
                }
            }
            else if (QueryString.ViewIDValue != null)
            {
                if ((SessionWrapper.Instance.GetSession(QueryString.ViewIDValue)) != null)
                {
                    if (SessionWrapper.Instance.GetSession(QueryString.ViewIDValue).ClientFromQueryString != null)
                    {
                        //targetName = ": " + SessionWrapper.Instance.Get.ClientFromQueryString.Name;
                        String LoginClientName = SessionWrapper.Instance.GetSession(QueryString.ViewIDValue).ClientFromQueryString.Name;

                        if (SessionWrapper.Instance.GetSession(QueryString.ViewIDValue).ClientFromQueryString.ClientFacilityType == 0)
                        {
                            RetnSchedulesLiteral.Text          = "Retentions/Fees & Charges";
                            RetnSchedulesLiteral2.Text         = "Retention/Fees & Charges Schedules: " + LoginClientName;
                            PageDescription.DescriptionContent = "Retention/Fees & Charges Schedules";
                            varRepurchases = "Repurch/Prepay"; //testName = "facilityType == 1";
                        }
                        else if (SessionWrapper.Instance.GetSession(QueryString.ViewIDValue).ClientFromQueryString.ClientFacilityType == 1)
                        {
                            RetnSchedulesLiteral.Text          = "Retentions";
                            RetnSchedulesLiteral2.Text         = "Retention Schedules: " + LoginClientName;
                            PageDescription.DescriptionContent = "Retention Schedules"; //testName = "facilityType == 1";
                            varRepurchases = "Repurchases";
                        }
                        else
                        {
                            RetnSchedulesLiteral.Text          = "Monthly Fees & Charges";
                            RetnSchedulesLiteral2.Text         = "Monthly Fee Schedules: " + LoginClientName;
                            PageDescription.DescriptionContent = "Monthly Fees & Charges Schedules"; //testName = "facilityType != 1";
                            varRepurchases = "Prepayments";
                        }
                    }
                }
            }


            if (IsPostBack)
            {
                string  cArgs = "";
                Control c     = GetPostBackControl(this.Page, out cArgs);
                if (c != null)
                {
                    eventTarget = c.ID;
                }

                if (eventTarget == "retentionGridView")
                { //if this is a post back from retention grid then hide the grid
                    showRetentionGridView = false;
                }

                DisplayRetentionSchedules(ViewState["RetentionSchedules"] as IList <RetentionSchedule>);
                ToggleRetentionGridVisibility();
            }
            else
            {
                showRetentionGridView = true;
                if (presenter != null)
                {
                    LoadRetentionSchedules();
                }
                TabMenu.Items[0].Selected       = true;
                PreviousRetentionButton.Visible = (RetentionGridView.Rows.Count == 1) ? false : ((RetentionGridView.FocusedRowIndex <= 0) ? false : true);
                NextRetentionButton.Visible     = (RetentionGridView.Rows.Count == 1) ? false : ((RetentionGridView.FocusedRowIndex < (RetentionGridView.Rows.Count - 1)) ? true : false);

                if (RetentionGridView.Rows.Count > 0)
                {
                    RetentionGridView.ResetPaginationAndFocus();
                    RetentionGridView.FocusedRowIndex = 0;
                    LoadSelectedRetention(0);
                }
            }

            RetentionGridView.RowCommand       += RetentionGridView_RowCommand;
            RetentionGridView.PagerCommand     += RetentionGridView_PagerCommand;
            RetentionGridView.SelectionChanged += RetentionGridViewSelectionChanged;
            MonthRangePicker.Update            += MonthRangePickerUpdate;
        }
 public override void ResetPaginationAndFocus()
 {
     ReportGridView.ResetPaginationAndFocus();
 }