Ejemplo n.º 1
0
        public ActionResult Grid(GridParams gridParams)
        {
            var waves = _waveService.GetWavesForGrid(new GetWavesRequest
            {
                Skip = gridParams.DisplayStart,
                Take = gridParams.DisplayLength,
                Search = gridParams.Search,
                SortingDictionary = gridParams.SortingDictionary
            });
            var data = new
            {
                sEcho = gridParams.Echo + 1,
                iTotalDisplayRecords = waves.TotalRecords,
                iTotalRecords = waves.Waves.Count,
                aaData = waves.Waves.Select(x => new
                {
                    x.Id,
                    PeriodeType = x.PeriodeType.ToString(),
                    Date = x.Date.ToString(DateFormat.DateForGrid),
                    x.Value,
                    x.Speed,
                    x.Tide
                })
            };

            return Json(data, JsonRequestBehavior.AllowGet);
        }
Ejemplo n.º 2
0
        public ActionResult Grid(GridParams gridParams)
        {
            var periode = _periodeService.GetPeriodesForGrid(new GetPeriodesRequest
                {
                    Skip = gridParams.DisplayStart,
                    Take = gridParams.DisplayLength,
                    Search = gridParams.Search,
                    SortingDictionary = gridParams.SortingDictionary
                });
            var data = new
            {
                sEcho = gridParams.Echo + 1,
                iTotalDisplayRecords = periode.TotalRecords,
                iTotalRecords = periode.Periodes.Count,
                aaData = periode.Periodes.Select(x => new
                {
                    x.Id,
                    x.IsActive,
                    Name = x.Name.ToString(),
                    x.Remark
                })

            };
            return Json(data, JsonRequestBehavior.AllowGet);
        }
Ejemplo n.º 3
0
 public ActionResult Grid(GridParams gridParams)
 {
     var method = _methodService.GetMethods(new GetMethodsRequest
         {
             Skip = gridParams.DisplayStart,
             Take = gridParams.DisplayLength,
             Search = gridParams.Search,
             SortingDictionary = gridParams.SortingDictionary
         });
     var data = new
     {
         sEcho = gridParams.Echo + 1,
         iTotalDisplayRecords = method.TotalRecords,
         iTotalRecords = method.Methods.Count,
         aaData = method.Methods
     };
     return Json(data, JsonRequestBehavior.AllowGet);
 }
Ejemplo n.º 4
0
        public ActionResult Grid(GridParams gridParams)
        {
            var templates = _templateService.GetTemplates(new GetTemplatesRequest
            {
                Skip = gridParams.DisplayStart,
                Take = gridParams.DisplayLength,
                SortingDictionary = gridParams.SortingDictionary,
                Search = gridParams.Search
            });

            var data = new
            {
                sEcho = gridParams.Echo + 1,
                iTotalRecords = templates.Artifacts.Count,
                iTotalDisplayRecords = templates.TotalRecords,
                aaData = templates.Artifacts
            };
            return Json(data, JsonRequestBehavior.AllowGet);
        }
Ejemplo n.º 5
0
 public ActionResult Grid(GridParams gridParams)
 {
     var measurements = _measurementService.GetMeasurements(new GetMeasurementsRequest
         {
             Skip = gridParams.DisplayStart,
             Take = gridParams.DisplayLength,
             SortingDictionary = gridParams.SortingDictionary,
             Search = gridParams.Search
         });
     IList<GetMeasurementsResponse.Measurement> measurementsResponse = measurements.Measurements;
     var data = new
     {
         sEcho = gridParams.Echo + 1,
         iTotalDisplayRecords = measurements.TotalRecords,
         iTotalRecords = measurements.Measurements.Count,
         aaData = measurementsResponse
     };
     return Json(data, JsonRequestBehavior.AllowGet);
 }
Ejemplo n.º 6
0
        public ActionResult Grid(GridParams gridParams)
        {
            var inputDatas = _inputDataService.GetInputData(new GetInputDatasRequest
            {
                Skip = gridParams.DisplayStart,
                Take = gridParams.DisplayLength,
                SortingDictionary = gridParams.SortingDictionary,
                Search = gridParams.Search
            });
            inputDatas.InputDatas.Add(new GetInputDatasResponse.InputData { Name = "Input Data DER", PeriodeType = "Daily" });

            IList<GetInputDatasResponse.InputData> inputDatasResponse = inputDatas.InputDatas;
            var data = new
            {
                sEcho = gridParams.Echo + 1,
                iTotalDisplayRecords = inputDatas.TotalRecords + 1,
                iTotalRecords = inputDatas.InputDatas.Count,
                aaData = inputDatasResponse
            };
            return Json(data, JsonRequestBehavior.AllowGet);
        }
Ejemplo n.º 7
0
        public ActionResult GridESCategory(GridParams gridParams)
        {
            var esCategory = _planningBlueprintService.GetESCategories(new GetESCategoriesRequest
            {
                Skip = gridParams.DisplayStart,
                Take = gridParams.DisplayLength,
                Search = gridParams.Search,
                SortingDictionary = gridParams.SortingDictionary
            });
            var data = new
            {
                sEcho = gridParams.Echo + 1,
                iTotalDisplayRecords = esCategory.TotalRecords,
                iTotalRecords = esCategory.ESCategories.Count,
                aaData = esCategory.ESCategories.Select(x => new
                {
                    x.Id,
                    x.IsActive,
                    x.Name,
                    Type = x.Type.ToString()
                })
            };

            return Json(data, JsonRequestBehavior.AllowGet);
        }
Ejemplo n.º 8
0
        public ActionResult Grid(GridParams gridParams)
        {
            var mirConfiguration = _mirConfigurationService.Gets(new GetMirConfigurationsRequest
                {
                    Skip = gridParams.DisplayStart,
                    Take = gridParams.DisplayLength,
                    SortingDictionary = gridParams.SortingDictionary,
                    Search = gridParams.Search
                });

            IList<GetsMirConfigurationsResponse.MirConfiguration> mirConfigurationResponse = mirConfiguration.MirConfigurations;
            var data = new
            {
                sEcho = gridParams.Echo + 1,
                iTotalDisplayRecords = mirConfiguration.TotalRecords,
                iTotalRecords = mirConfiguration.MirConfigurations.Count,
                aaData = mirConfigurationResponse
            };
            return Json(data, JsonRequestBehavior.AllowGet);
        }
Ejemplo n.º 9
0
 public ActionResult Grid(GridParams gridParams)
 {
     var planningBlueprintData = _planningBlueprintService.GetPlanningBlueprints(new GetPlanningBlueprintsRequest
     {
         Skip = gridParams.DisplayStart,
         Take = gridParams.DisplayLength,
         Search = gridParams.Search,
         SortingDictionary = gridParams.SortingDictionary
     });
     IList<GetPlanningBlueprintsResponse.PlanningBlueprint> DatasResponse = planningBlueprintData.PlanningBlueprints;
     var data = new
     {
         sEcho = gridParams.Echo + 1,
         iTotalDisplayRecords = planningBlueprintData.TotalRecords,
         iTotalRecords = planningBlueprintData.PlanningBlueprints.Count,
         aaData = DatasResponse
     };
     return Json(data, JsonRequestBehavior.AllowGet);
 }
Ejemplo n.º 10
0
        public ActionResult Grid(GridParams gridParams)
        {
            var operational = _operationDataService.GetOperationalDatas(new GetOperationalDatasRequest
                {
                    Skip = gridParams.DisplayStart,
                    Take = gridParams.DisplayLength,
                    Search = gridParams.Search,
                    SortingDictionary = gridParams.SortingDictionary
                });
            var data = new
            {
                sEcho = gridParams.Echo + 1,
                iTotalDisplayRecords = operational.TotalRecords,
                iTotalRecords = operational.OperationalDatas.Count,
                aaData = operational.OperationalDatas.Select(x => new
                {
                    x.Id,
                    x.KeyOperation,
                    x.Kpi,
                    Periode = x.Periode.ToString(DateFormat.DateForGrid),
                    x.PeriodeType,
                    x.Remark,
                    x.Scenario,
                    x.Value
                })
            };

            return Json(data, JsonRequestBehavior.AllowGet);
        }
Ejemplo n.º 11
0
 public ActionResult Grid(GridParams gridParams, int? roleId)
 {
     roleId = roleId.HasValue ? roleId.Value : this.UserProfile().RoleId;
     var rpv = _roleService.GetRolePrivileges(new GetPrivilegesRequest
     {
         RoleId = roleId.Value,
         Take = gridParams.DisplayLength,
         Skip = gridParams.DisplayStart,
         SortingDictionary = gridParams.SortingDictionary,
         Search = gridParams.Search
     });
     List<RolePrivilegeViewModel> DataResponse = rpv.Privileges.MapTo<RolePrivilegeViewModel>();
     var data = new
     {
         sEcho = gridParams.Echo + 1,
         iTotalDisplayRecords = rpv.TotalRecords,
         iTotalRecords = rpv.Privileges.Count,
         aaData = DataResponse
     };
     var jsonResult = Json(data, JsonRequestBehavior.AllowGet);
     jsonResult.MaxJsonLength = int.MaxValue;
     return jsonResult;
 }
Ejemplo n.º 12
0
        public ActionResult Grid(GridParams gridParams)
        {
            var vessel = _vesselService.GetVesselsForGrid(new GetVesselsRequest
                {
                    Skip = gridParams.DisplayStart,
                    Take = gridParams.DisplayLength,
                    Search = gridParams.Search,
                    SortingDictionary = gridParams.SortingDictionary
                });
            var data = new
            {
                sEcho = gridParams.Echo + 1,
                iTotalDisplayRecords = vessel.TotalRecords,
                iTotalRecords = vessel.Vessels.Count,
                aaData = vessel.Vessels
            };

            return Json(data, JsonRequestBehavior.AllowGet);
        }
Ejemplo n.º 13
0
 public ActionResult Grid(GridParams gridParams)
 {
     var conversion = _conversionService.GetConversions(new GetConversionsRequest
         {
             Skip = gridParams.DisplayStart,
             Take = gridParams.DisplayLength,
             Search = gridParams.Search,
             SortingDictionary = gridParams.SortingDictionary
         });
     var data = new
     {
         sEcho = gridParams.Echo + 1,
         iTotalDisplayRecords = conversion.TotalRecords,
         iTotalRecords = conversion.Conversions.Count,
         aaData = conversion.Conversions
     };
     return Json(data, JsonRequestBehavior.AllowGet);
 }
Ejemplo n.º 14
0
 public ActionResult Grid(GridParams gridParams)
 {
     var operation = _operationConfigService.GetOperations(new GetOperationsRequest
         {
             Search = gridParams.Search,
             Skip = gridParams.DisplayStart,
             Take = gridParams.DisplayLength,
             SortingDictionary = gridParams.SortingDictionary
         });
     IList<GetOperationsResponse.Operation> operationsResponse = operation.Operations;
     var data = new
         {
             sEcho = gridParams.Echo + 1,
             iTotalDisplayRecords = operation.TotalRecords,
             iTotalRecords = operation.Operations.Count,
             aaData = operationsResponse
         };
     return Json(data, JsonRequestBehavior.AllowGet);
 }
Ejemplo n.º 15
0
 public ActionResult Grid(GridParams gridParams)
 {
     var ders = _derService.GetDers(new GetDersRequest
     {
         Skip = gridParams.DisplayStart,
         Take = gridParams.DisplayLength,
         Search = gridParams.Search,
         SortingDictionary = gridParams.SortingDictionary
     });
     IList<GetDersResponse.Der> DatasResponse = ders.Ders;
     var data = new
     {
         sEcho = gridParams.Echo + 1,
         iTotalDisplayRecords = ders.TotalRecords,
         iTotalRecords = ders.Ders.Count,
         aaData = DatasResponse
     };
     return Json(data, JsonRequestBehavior.AllowGet);
 }
Ejemplo n.º 16
0
 public ActionResult Grid(GridParams gridParams, int? year)
 {
     year = year.HasValue ? year.Value : DateTime.Now.Year;
     var mirData = _fileRepositoryService.GetFiles(new Services.Requests.Files.GetFilesRequest
     {
         Year = year.Value,
         Take = gridParams.DisplayLength,
         Skip = gridParams.DisplayStart,
         SortingDictionary = gridParams.SortingDictionary,
         Search = gridParams.Search
     });
     List<FileRepositoryViewModel> DataResponse = mirData.FileRepositories.MapTo<FileRepositoryViewModel>();
     var data = new
     {
         sEcho = gridParams.Echo + 1,
         iTotalDisplayRecords = mirData.TotalRecords,
         iTotalRecords = mirData.FileRepositories.Count,
         aaData = DataResponse
     };
     var jsonResult = Json(data, JsonRequestBehavior.AllowGet);
     jsonResult.MaxJsonLength = int.MaxValue;
     return jsonResult; //Json(data, JsonRequestBehavior.AllowGet);
 }
Ejemplo n.º 17
0
 public ActionResult Grid(GridParams gridParams)
 {
     var scenario = _scenarioService.GetScenariosForGrid(new GetScenariosRequest
         {
             Skip = gridParams.DisplayStart,
             Take = gridParams.DisplayLength,
             SortingDictionary = gridParams.SortingDictionary,
             Search = gridParams.Search
         });
     IList<GetScenariosResponse.Scenario> scenarioResponse = scenario.Scenarios;
     var data = new
     {
         sEcho = gridParams.Echo + 1,
         iTotalDisplayRecords = scenario.TotalRecords,
         iTotalRecords = scenario.Scenarios.Count,
         aaData = scenarioResponse
     };
     return Json(data, JsonRequestBehavior.AllowGet);
 }
Ejemplo n.º 18
0
        public ActionResult Grid(GridParams gridParams)
        {
            var calculator = _calculatorConstantService.GetCalculatorConstantsForGrid(new GetCalculatorConstantForGridRequest
                {
                    Skip = gridParams.DisplayStart,
                    Take = gridParams.DisplayLength,
                    Search = gridParams.Search,
                    SortingDictionary = gridParams.SortingDictionary
                });
            var data = new
            {
                sEcho = gridParams.Echo + 1,
                iTotalDisplayRecords = calculator.TotalRecords,
                iTotalRecords = calculator.CalculatorConstantsForGrids.Count,
                aaData = calculator.CalculatorConstantsForGrids

            };

            return Json(data, JsonRequestBehavior.AllowGet);
        }
Ejemplo n.º 19
0
        public ActionResult Grid(GridParams gridParams)
        {
            var menus = _menuService.GetMenusForGrid(new GetMenusRequest
            {
                Skip = gridParams.DisplayStart,
                Take = gridParams.DisplayLength,
                SortingDictionary = gridParams.SortingDictionary,
                Search = gridParams.Search
            });

            var data = new
            {
                sEcho = gridParams.Echo + 1,
                iTotalRecords = menus.Menus.Count,
                iTotalDisplayRecords = menus.TotalRecords,
                aaData = menus.Menus
            };
            var list = JsonConvert.SerializeObject(data,
                                                   Formatting.None,
                                                   new JsonSerializerSettings
                                                       {
                                                           ReferenceLoopHandling = ReferenceLoopHandling.Ignore
                                                       });
            return Content(list, "application/json");
        }
Ejemplo n.º 20
0
        public ActionResult Grid(GridParams gridParams)
        {
            var operationGroup = _operationGroupService.GetOperationGroups(new GetOperationGroupsRequest
                {
                    Search = gridParams.Search,
                    Skip = gridParams.DisplayStart,
                    Take = gridParams.DisplayLength,
                    SortingDictionary = gridParams.SortingDictionary
                });

            var data = new
            {
                sEcho = gridParams.Echo + 1,
                iTotalDisplayRecords = operationGroup.TotalRecords,
                iTotalRecords = operationGroup.OperationGroups.Count,
                aaData = operationGroup.OperationGroups
            };
            return Json(data, JsonRequestBehavior.AllowGet);
        }
Ejemplo n.º 21
0
        public ActionResult Grid(GridParams gridParams)
        {
            var popDashboard = _popDashboardService.GetPopDashboards(new GetPopDashboardsRequest
            {
                Take = gridParams.DisplayLength,
                Skip = gridParams.DisplayStart,
                SortingDictionary = gridParams.SortingDictionary,
                Search = gridParams.Search
            });

            IList<GetPopDashboardsResponse.PopDashboard> DatasResponse = popDashboard.PopDashboards;
            var data = new
            {
                sEcho = gridParams.Echo + 1,
                iTotalDisplayRecords = popDashboard.TotalRecords,
                iTotalRecords = popDashboard.PopDashboards.Count,
                aaData = DatasResponse
            };

            return Json(data, JsonRequestBehavior.AllowGet);
        }
Ejemplo n.º 22
0
 public ActionResult Grid(GridParams gridParams)
 {
     var buyer = _buyerService.GetBuyersForGrid(new GetBuyerForGridRequest
         {
             Skip = gridParams.DisplayStart,
             Take = gridParams.DisplayLength,
             Search = gridParams.Search,
             SortingDictionary = gridParams.SortingDictionary
         });
     var data = new
     {
         sEcho = gridParams.Echo + 1,
         iTotalDisplayRecords = buyer.TotalRecords,
         iTotalRecords = buyer.BuyerForGrids.Count,
         aaData = buyer.BuyerForGrids
     };
     return Json(data, JsonRequestBehavior.AllowGet);
 }
Ejemplo n.º 23
0
 public ActionResult Grid(GridParams gridParams)
 {
     var kpis = _kpiService.GetKpis(new GetKpisRequest
         {
             Skip = gridParams.DisplayStart,
             Take = gridParams.DisplayLength,
             SortingDictionary = gridParams.SortingDictionary,
             Search = gridParams.Search
         });
     IList<GetKpisResponse.Kpi> kpisResponse = kpis.Kpis;
     var data = new
     {
         sEcho = gridParams.Echo + 1,
         iTotalDisplayRecords = kpis.TotalRecords,
         iTotalRecords = kpis.Kpis.Count,
         aaData = kpisResponse
     };
     return Json(data, JsonRequestBehavior.AllowGet);
 }
Ejemplo n.º 24
0
 public ActionResult Grid(GridParams gridParams)
 {
     var viewModel = new DerLayoutIndexViewModel();
     var response = _derService.GetDerLayouts();
     viewModel.DerLayouts = response.DerLayouts.Select(x => new DerLayoutViewModel() { Id = x.Id, IsActive = x.IsActive, Title = x.Title })
             .ToList();
     var data = new
     {
         sEcho = gridParams.Echo + 1,
         iTotalDisplayRecords = viewModel.DerLayouts.Count,
         iTotalRecords = viewModel.DerLayouts.Count,
         aaData = viewModel.DerLayouts
     };
     return Json(data, JsonRequestBehavior.AllowGet);
     //// viewModel.DerLayouts.Add(new DerLayoutViewModel{Id = 1, Title = "First Layout"});
     //return View(viewModel);
 }
Ejemplo n.º 25
0
        public ActionResult Grid(GridParams gridParams)
        {
            var outputCategory = _outputCategoryService.GetOutputCategories(new GetOutputCategoriesRequest
                {
                    Skip = gridParams.DisplayStart,
                    Take = gridParams.DisplayLength,
                    Search = gridParams.Search,
                    SortingDictionary = gridParams.SortingDictionary
                });

            var data = new
            {
                sEcho = gridParams.Echo + 1,
                iTotalDisplayRecords = outputCategory.TotalRecords,
                iTotalRecords = outputCategory.OutputCategories.Count,
                aaData = outputCategory.OutputCategories
            };
            return Json(data, JsonRequestBehavior.AllowGet);
        }
Ejemplo n.º 26
0
        public ActionResult Grid(GridParams gridParams, string periodeType)
        {
            var highlight = _highlightService.GetHighlightsForGrid(new GetHighlightsRequest
                {
                    Skip = gridParams.DisplayStart,
                    Take = gridParams.DisplayLength,
                    Search = gridParams.Search,
                    SortingDictionary = gridParams.SortingDictionary
                });
            var data = new
            {
                sEcho = gridParams.Echo + 1,
                iTotalDisplayRecords = highlight.TotalRecords,
                iTotalRecords = highlight.Highlights.Count,
                aaData = highlight.Highlights.Where(x => x.PeriodeType == (PeriodeType)Enum.Parse(typeof(PeriodeType),periodeType)).Select(x => new
                {
                    x.Id,
                    Date = x.Date.ToString(DateFormat.DateForGrid),
                    x.IsActive,
                    PeriodeType = x.PeriodeType.ToString(),
                    x.Type,
                    x.Title,
                    x.Message
                })
            };

            return Json(data, JsonRequestBehavior.AllowGet);
        }
Ejemplo n.º 27
0
        public ActionResult LogGrid(int id, GridParams gridParams)
        {
            var templates = _kpiTransformationScheduleService.Get(new GetKpiTransformationSchedulesRequest
            {
                Skip = gridParams.DisplayStart,
                Take = gridParams.DisplayLength,
                SortingDictionary = gridParams.SortingDictionary,
                Search = gridParams.Search,
                KpiTransformationId = id
            });

            var data = new
            {
                sEcho = gridParams.Echo + 1,
                iTotalRecords = templates.Schedules.Count,
                iTotalDisplayRecords = templates.TotalRecords,
                aaData = templates.Schedules
            };
            return Json(data, JsonRequestBehavior.AllowGet);
        }
Ejemplo n.º 28
0
 public ActionResult Grid(GridParams gridParams)
 {
     var vessel = _vesselScheduleService.GetVesselSchedulesForGrid(new GetVesselSchedulesRequest
         {
             Skip = gridParams.DisplayStart,
             Take = gridParams.DisplayLength,
             Search = gridParams.Search,
             SortingDictionary = gridParams.SortingDictionary
         });
     var data = new
     {
         sEcho = gridParams.Echo + 1,
         iTotalDisplayRecords = vessel.TotalRecords,
         iTotalRecords = vessel.VesselSchedules.Count,
         aaData = vessel.VesselSchedules.Select(x => new
             {
                 x.Vessel,
                 ETA = x.ETA.HasValue ? x.ETA.Value.ToString(DateFormat.DateForGrid) : string.Empty,
                 ETD = x.ETD.HasValue ? x.ETD.Value.ToString(DateFormat.DateForGrid) : string.Empty,
                 x.Buyer,
                 x.Location,
                 x.SalesType,
                 x.Type,
                 x.Cargo,
                 x.IsActive,
                 x.id
             })
     };
     return Json(data, JsonRequestBehavior.AllowGet);
 }
Ejemplo n.º 29
0
        public ActionResult Grid(GridParams gridParams)
        {
            var economic = _economicSummaryService.GetEconomicSummariesForGrid(new GetEconomicSummariesRequest
                {
                    Skip = gridParams.DisplayStart,
                    Take = gridParams.DisplayLength,
                    Search = gridParams.Search,
                    SortingDictionary = gridParams.SortingDictionary
                });
            var data = new
            {
                sEcho = gridParams.Echo + 1,
                iTotalDisplayRecords = economic.TotalRecords,
                iTotalRecords = economic.EconomicSummaries.Count,
                aaData = economic.EconomicSummaries
            };

            return Json(data, JsonRequestBehavior.AllowGet);
        }
Ejemplo n.º 30
0
 public ActionResult Grid(GridParams gridParams)
 {
     var assumptionCategory = _assumptionCategoryService.GetAssumptionCategories(new GetAssumptionCategoriesRequest
         {
             Skip = gridParams.DisplayStart,
             Take = gridParams.DisplayLength,
             SortingDictionary = gridParams.SortingDictionary,
             Search = gridParams.Search
         });
     IList<GetAssumptionCategoriesResponse.AssumptionCategory> CategoriesResponse = assumptionCategory.AssumptionCategorys;
     var data = new
     {
         sEcho = gridParams.Echo + 1,
         iTotalDisplayRecords = assumptionCategory.TotalRecords,
         iTotalRecords = assumptionCategory.AssumptionCategorys.Count,
         aaData = CategoriesResponse
     };
     return Json(data, JsonRequestBehavior.AllowGet);
 }