Esempio n. 1
0
        public void displayPage(GrillePage page)
        {
            throwHandler                = false;
            current                     = page.currentPage;
            total                       = page.pageCount;
            this.currentPage.Content    = page.currentPage;
            this.totalPageLabel.Content = page.pageCount;
            this.label.Content          = "" + page.pageFirstItem + " to " + page.pageLastItem + " / " + page.totalItemCount;

            this.firstPageButton.IsEnabled    = page.currentPage > 1;
            this.previousPageButton.IsEnabled = page.currentPage > 1;

            this.nextPageButton.IsEnabled = page.currentPage < page.pageCount;
            this.LastPageButton.IsEnabled = page.currentPage < page.pageCount;

            this.firstPageButton.Foreground    = this.firstPageButton.IsEnabled ? Brushes.Black : Brushes.Gray;
            this.previousPageButton.Foreground = this.previousPageButton.IsEnabled ? Brushes.Black : Brushes.Gray;
            this.nextPageButton.Foreground     = this.nextPageButton.IsEnabled ? Brushes.Black : Brushes.Gray;
            this.LastPageButton.Foreground     = this.LastPageButton.IsEnabled ? Brushes.Black : Brushes.Gray;

            if (!this.showAllCheckBox.IsChecked.Value)
            {
                this.pageSizeComboBox.SelectedItem = page.pageSize;
                this.pageSizeComboBox.IsEnabled    = page.pageCount > 0;
            }

            this.Visibility = page.pageCount > 0 ? Visibility.Visible : Visibility.Hidden;
            throwHandler    = true;
        }
Esempio n. 2
0
 public void displayPage(GrillePage page, bool add = false, String side = null)
 {
     if (page != null)
     {
         displayRows(page.rows, add, side);
     }
 }
        public virtual void Search(int currentPage = 0)
        {
            LinkedAttributeGridEditorItem page = (LinkedAttributeGridEditorItem)getEditor().getActivePage();

            try
            {
                GrilleFilter filter = page.getLinkedAttributeGridForm().FillFilter();
                filter.attribute = page.EditedObject.attribute;
                filter.grid      = new Grille();
                //filter.grid.code = page.EditedObject.code;
                filter.grid.columnListChangeHandler = page.EditedObject.columnListChangeHandler;
                filter.grid.report = page.EditedObject.report;
                filter.grid.oid    = page.EditedObject.oid;
                filter.grid.name   = page.EditedObject.name;
                filter.page        = currentPage;
                filter.pageSize    = (int)page.getLinkedAttributeGridForm().Toolbar.pageSizeComboBox.SelectedItem;
                filter.showAll     = page.getLinkedAttributeGridForm().Toolbar.showAllCheckBox.IsChecked.Value;
                GrillePage rows = this.GetLinkedAttributeGridService().getGridRows(filter);
                page.getLinkedAttributeGridForm().DisplayPage(rows);
            }
            catch (ServiceExecption)
            {
                GrillePage rows = new GrillePage();
                rows.rows = new List <object[]>(0);
                page.getLinkedAttributeGridForm().DisplayPage(rows);
            }
        }
Esempio n. 4
0
 private void Search(List <long> oids, String side)
 {
     try
     {
         this.IsBussy = true;
         GrilleFilter filter = new GrilleFilter();
         filter.grid = new Grille();
         filter.grid.columnListChangeHandler = this.EditedObject.columnListChangeHandler;
         filter.grid.report         = this.EditedObject.report;
         filter.grid.reconciliation = this.EditedObject.reconciliation;
         filter.oids     = oids;
         filter.page     = 1;
         filter.pageSize = int.MaxValue;
         filter.showAll  = true;
         GrillePage rows = this.Service.getGridRows(filter);
         this.GridBrowser.displayPage(rows, true, side);
         this.GridBrowser.gridControl.SelectAll();
         this.IsBussy = false;
     }
     catch (ServiceExecption)
     {
         GrillePage rows = new GrillePage();
         rows.rows = new List <object[]>(0);
         this.GridBrowser.displayPage(rows);
         this.IsBussy = false;
     }
 }
Esempio n. 5
0
 public void DisplayPage(GrillePage page)
 {
     if (page != null)
     {
         this.Grid.displayPage(page);
         this.Toolbar.displayPage(page);
     }
 }
Esempio n. 6
0
 public void displayPage(GrillePage page)
 {
     if (page != null)
     {
         this.gridBrowser.displayPage(page);
         this.toolBar.displayPage(page);
     }
 }
 protected virtual void PerformSearch(int currentPage = 0)
 {
     try
     {
         this.IsBussy = true;
         if (this.EditedObject.columnListChangeHandler.Items.Count > 0)
         {
             GrilleFilter filter = this.GrilleBrowserForm.filterForm.Fill();
             filter.creditChecked      = this.CreditCheckBox.IsChecked.Value;
             filter.debitChecked       = this.DebitCheckBox.IsChecked.Value;
             filter.includeRecoChecked = this.RecoCheckBox.IsChecked.Value;
             if (this.Template != null && this.Template.reconciliationType != null)
             {
                 filter.recoType = this.Template.reconciliationType;
             }
             else
             {
                 filter.recoType = null;
             }
             filter.grid = new Grille();
             filter.grid.creditChecked      = this.Template.useDebitCredit != null && this.Template.useDebitCredit.Value && this.CreditCheckBox.IsChecked.Value;
             filter.grid.debitChecked       = this.Template.useDebitCredit != null && this.Template.useDebitCredit.Value && this.DebitCheckBox.IsChecked.Value;
             filter.grid.includeRecoChecked = this.RecoCheckBox.IsChecked.Value;
             filter.grid.code = this.EditedObject.code;
             filter.grid.columnListChangeHandler = this.EditedObject.columnListChangeHandler;
             filter.grid.report         = this.EditedObject.report;
             filter.grid.reconciliation = this.EditedObject.reconciliation;
             filter.grid.oid            = this.EditedObject.oid;
             filter.grid.name           = this.EditedObject.name;
             filter.page     = currentPage;
             filter.pageSize = (int)this.GrilleBrowserForm.toolBar.pageSizeComboBox.SelectedItem;
             filter.showAll  = this.GrilleBrowserForm.toolBar.showAllCheckBox.IsChecked.Value;
             GrillePage rows = this.Service.getGridRows(filter);
             this.GrilleBrowserForm.displayPage(rows);
         }
         else
         {
             GrillePage rows = new GrillePage();
             rows.rows = new List <object[]>(0);
             this.GrilleBrowserForm.displayPage(rows);
         }
         this.IsBussy = false;
     }
     catch (ServiceExecption)
     {
         GrillePage rows = new GrillePage();
         rows.rows = new List <object[]>(0);
         this.GrilleBrowserForm.displayPage(rows);
         this.IsBussy = false;
     }
 }
Esempio n. 8
0
        public GrillePage getGridRows(GrilleFilter filter)
        {
            try
            {
                System.Web.Script.Serialization.JavaScriptSerializer serializer = new System.Web.Script.Serialization.JavaScriptSerializer();
                var request = new RestRequest(ResourcePath + "/rows", Method.POST);
                serializer.MaxJsonLength = int.MaxValue;
                string json = serializer.Serialize(filter);
                request.AddParameter("application/json", json, ParameterType.RequestBody);

                var          response    = RestClient.ExecuteTaskAsync(request);
                RestResponse queryResult = (RestResponse)response.Result;
                GrillePage   objects     = RestSharp.SimpleJson.DeserializeObject <GrillePage>(queryResult.Content);
                return(objects);
            }
            catch (Exception e)
            {
                logger.Error("Unable to retrieve grid rows.", e);
                throw new ServiceExecption("Unable to retrieve grid rows.", e);
            }
        }