public void Display(Domain.Attribute attribute)
 {
     this.Attribute  = Attribute;
     this.Title      = attribute.name;
     Filter          = new BrowserDataFilter();
     Filter.page     = 0;
     Filter.pageSize = BrowserDataFilter.DEFAULT_PAGE_SIZE;
     Filter.groupOid = attribute.oid.Value;
     Search();
 }
 public void Display(Domain.PeriodInterval interval)
 {
     this.PeriodName = interval.periodName;
     this.Title      = interval.name;
     Filter          = new BrowserDataFilter();
     Filter.page     = 0;
     Filter.pageSize = BrowserDataFilter.DEFAULT_PAGE_SIZE;
     Filter.groupOid = interval.oid.Value;
     Search();
 }
 public void Display(Domain.Measure measure)
 {
     this.Measure    = measure;
     Filter          = new BrowserDataFilter();
     Filter.page     = 0;
     Filter.pageSize = BrowserDataFilter.DEFAULT_PAGE_SIZE;
     if (measure != null)
     {
         this.Title      = measure.name;
         Filter.groupOid = measure.oid.Value;
     }
     Search();
 }
Exemple #4
0
        public BrowserDataFilter BuildFilter(int page = 0)
        {
            BrowserDataFilter filter = new BrowserDataFilter();

            filter.page     = page;
            filter.pageSize = (int)NavigationBar.pageSizeComboBox.SelectedItem;
            if (filter.pageSize <= 0)
            {
                filter.pageSize = BrowserDataFilter.DEFAULT_PAGE_SIZE;
            }
            //foreach (FilterData data in Grid.FilterData.Datas)
            //{
            //    if (data.IsEmpty()) continue;
            //    filter.items.Add(new BrowserDataFilterItem(data.ValuePropertyBindingPath, data.QueryString, data.Operator));
            //}
            return(filter);
        }
Exemple #5
0
 protected void OnSelectedAttributeChange(object sender, DevExpress.Xpf.Grid.SelectedItemChangedEventArgs e)
 {
     Kernel.Domain.Attribute selection = attributeTreeList.GetSelectedValue();;
     if (selection != null && !selection.isCompleted && selection.oid.HasValue)
     {
         BrowserDataFilter filter = new BrowserDataFilter();
         filter.groupOid = selection.oid.Value;
         filter.page     = 1;
         filter.pageSize = 10;
         BrowserDataPage <Kernel.Domain.AttributeValue> page = ModelService.getRootAttributeValuesByAttribute(filter);
         selection.valueListChangeHandler.originalList = page.rows;
         selection.isCompleted = true;
         filter.page           = page.currentPage;
         filter.totalPages     = page.pageCount;
         selection.DataFilter  = filter;
     }
     attributeValueTreeList.DisplayAttribute(selection);
 }
Exemple #6
0
 public BrowserDataPage <Kernel.Domain.Measure> getAllDescendents(BrowserDataFilter filter, bool showPostingMeasure = true)
 {
     try
     {
         var request = new RestRequest(ResourcePath + "/all-descendents/" + showPostingMeasure, Method.POST);
         JavaScriptSerializer serializer = new JavaScriptSerializer();
         request.RequestFormat    = DataFormat.Json;
         serializer.MaxJsonLength = int.MaxValue;
         string json = serializer.Serialize(filter);
         request.AddParameter("application/json", json, ParameterType.RequestBody);
         RestResponse queryResult = (RestResponse)RestClient.Execute(request);
         BrowserDataPage <Kernel.Domain.Measure> values = RestSharp.SimpleJson.DeserializeObject <BrowserDataPage <Kernel.Domain.Measure> >(queryResult.Content);
         return(values);
     }
     catch (Exception e)
     {
         throw new BcephalException("Unable to Return measures.", e);
     }
 }
Exemple #7
0
        /// <summary>
        /// effectue la recherche
        /// </summary>
        /// <returns></returns>
        public virtual OperationState FilterByCategory(String category)
        {
            if (String.IsNullOrEmpty(category))
            {
                return(Search());
            }
            try
            {
                BrowserDataFilter             filter = GetBrowser().BuildFilter(0);
                BrowserDataPage <BrowserData> page   = ((GroupService)this.Service).getBrowserDatasByCategory(filter, category);
                GetBrowser().DisplayPage(page);
                return(OperationState.CONTINUE);
            }
            catch (ServiceExecption e)
            {
                DisplayError("error", e.Message);
            }

            return(OperationState.STOP);
        }
Exemple #8
0
        public BrowserDataPage <BrowserData> getBrowserDatasByCategory(BrowserDataFilter filter, String category)
        {
            try
            {
                var request = new RestRequest(ResourcePath + "/browserdatasbycategory/" + category, Method.POST);

                JavaScriptSerializer serializer = new JavaScriptSerializer();
                serializer.MaxJsonLength = int.MaxValue;
                string json = serializer.Serialize(filter);
                request.AddParameter("application/json", json, ParameterType.RequestBody);

                RestResponse queryResult = (RestResponse)RestClient.Execute(request);
                BrowserDataPage <BrowserData> objects = RestSharp.SimpleJson.DeserializeObject <BrowserDataPage <BrowserData> >(queryResult.Content);
                return(objects);
            }
            catch (Exception e)
            {
                logger.Error("Unable to retrieve list of BrowserData.", e);
                throw new ServiceExecption("Unable to retrieve list of BrowserData.", e);
            }
        }
        /// <summary>
        ///
        /// </summary>
        /// <returns>List of BrowserData</returns>
        public override BrowserDataPage <AdvisementBrowserData> getBrowserDatas(BrowserDataFilter filter)
        {
            try
            {
                var request = new RestRequest(ResourcePath + "/browser-data-page", Method.POST);
                request.RequestFormat = DataFormat.Json;

                JavaScriptSerializer serializer = new JavaScriptSerializer();
                serializer.MaxJsonLength = int.MaxValue;
                string json = serializer.Serialize(filter);
                request.AddParameter("application/json", json, ParameterType.RequestBody);

                RestResponse queryResult          = (RestResponse)RestClient.Execute(request);
                AdvisementBrowserDataPage objects = RestSharp.SimpleJson.DeserializeObject <AdvisementBrowserDataPage>(queryResult.Content);
                return(objects);
            }
            catch (Exception e)
            {
                logger.Error("Unable to retrieve list of BrowserData.", e);
                throw new ServiceExecption("Unable to retrieve list of BrowserData.", e);
            }
        }
Exemple #10
0
 /// <summary>
 /// effectue la recherche
 /// </summary>
 /// <returns></returns>
 public override OperationState Search(object item)
 {
     ApplicationManager.MainWindow.IsBussy = true;
     Kernel.Application.Application.Current.Dispatcher.BeginInvoke(DispatcherPriority.Background,
                                                                   new Action(() =>
     {
         try
         {
             int p        = 0;
             BGroup group = null;
             if (item != null && item is int)
             {
                 p = (int)item;
             }
             else if (item != null && item is Kernel.Domain.BGroup)
             {
                 group = (BGroup)item;
             }
             BrowserDataFilter filter = GetBrowser().BuildFilter(p);
             if (group != null && group.oid.HasValue)
             {
                 filter.groupOid = group.oid;
             }
             BrowserDataPage <B> page = this.Service.getBrowserDatas(filter);
             GetBrowser().DisplayPage(page);
         }
         catch (ServiceExecption e)
         {
             DisplayError("error", e.Message);
         }
         finally
         {
             ApplicationManager.MainWindow.IsBussy = false;
         }
     }));
     return(OperationState.CONTINUE);
 }
Exemple #11
0
 public BrowserDataPage <Kernel.Domain.PeriodInterval> getRootIntervalsByPeriodName(BrowserDataFilter filter)
 {
     try
     {
         var request = new RestRequest(ResourcePath + "/root-period-intervals", Method.POST);
         JavaScriptSerializer serializer = new JavaScriptSerializer();
         request.RequestFormat    = DataFormat.Json;
         serializer.MaxJsonLength = int.MaxValue;
         string json = serializer.Serialize(filter);
         request.AddParameter("application/json", json, ParameterType.RequestBody);
         RestResponse queryResult = (RestResponse)RestClient.Execute(request);
         BrowserDataPage <Kernel.Domain.PeriodInterval> values = RestSharp.SimpleJson.DeserializeObject <BrowserDataPage <Kernel.Domain.PeriodInterval> >(queryResult.Content);
         return(values);
     }
     catch (Exception e)
     {
         throw new BcephalException("Unable to Return PeriodInterval.", e);
     }
 }