private void setInitialValues()
        {
            ViewRegistryPresenterState state = session["{F48C43C9-6723-4a30-B114-A40295BDE72A}"] as ViewRegistryPresenterState;

            view.IsInDateChoosingState = false;

            if (state == null)
            {
                view.CurrentPage      = 1;
                view.PageSize         = 20;
                view.CurrentDateRange = "tydzien";
                dateRangeChanging(null, null);
                return;
            }
            view.CurrentDateRange = state.currentDateRange;
            view.StartDate        = state.startDate;
            view.EndDate          = state.endDate;
            dateRangeChanging(null, null);
            if (view.CurrentDateRange == "zakres")
            {
                dateRangeChanged(null, null);
            }
            view.PageSize     = state.pageSize;
            view.CurrentPage  = state.currentPage;
            view.ShowInvoices = state.browsingRF;
        }
Exemple #2
0
        private void getData()
        {
            int currentPage = -1;
            ViewRegistryPresenterState state = session["{F48C43C9-6723-4a30-B114-A40295BDE72A}"] as ViewRegistryPresenterState;

            if (state != null && view.PageSize != state.pageSize && view.CurrentPage == view.PageCount)
            {
                currentPage = (int)(view.CurrentPage * state.pageSize / view.PageSize);
            }

            view.RegistryItems = service.GetItemsPage(view.UserID, registryId, (currentPage != -1) ? currentPage : view.CurrentPage, view.PageSize, view.StartDate, view.EndDate, view.ShowInvoices);
            view.PageCount     = service.TotalItemsCount / view.PageSize + (service.TotalItemsCount % view.PageSize > 0 ? 1 : 0);
            if (currentPage != -1)
            {
                view.CurrentPage = currentPage;
            }

            saveState();
        }
        private void getData()
        {
            int currentPage = -1;
            ViewRegistryPresenterState state = session["{F48C43C9-6723-4a30-B114-A40295BDE72A}"] as ViewRegistryPresenterState;

            if (state != null && view.PageSize != state.pageSize && view.CurrentPage == view.PageCount)
            {
                currentPage = (int)(view.CurrentPage * state.pageSize / view.PageSize);
            }

            view.RegistryItems = service.GetItemsPage(view.UserID, registryId, (currentPage != -1) ? currentPage : view.CurrentPage, view.PageSize, view.StartDate, view.EndDate,
                                                      view.SearchIncomeDate, view.SearchDocumentDate, view.SearchDocumentNumber, view.SearchSenderName,
                                                      view.SearchCorrespondenceCategory, view.SearchCorrespondenceType, view.SearchTypeValue,
                                                      view.SearchCorrespondenceKind, view.SearchCategoryValue,
                                                      view.SearchCorrespondenceStatus, view.SearchCorrespondenceDept, view.SearchCorrespondenceWorker, view.ShowInvoices);
            view.PageCount = service.TotalItemsCount / view.PageSize + (service.TotalItemsCount % view.PageSize > 0 ? 1 : 0);
            if (currentPage != -1)
            {
                view.CurrentPage = currentPage;
            }

            saveState();
        }
 private void saveState()
 {
     session["{F48C43C9-6723-4a30-B114-A40295BDE72A}"] = new ViewRegistryPresenterState(view.CurrentPage, view.PageSize, view.CurrentDateRange, view.StartDate, view.EndDate, view.ShowInvoices);
 }