예제 #1
0
        internal GetDashboardResponse GetDashboard(GetDashboardRequest request)
        {
            var marshaller   = new GetDashboardRequestMarshaller();
            var unmarshaller = GetDashboardResponseUnmarshaller.Instance;

            return(Invoke <GetDashboardRequest, GetDashboardResponse>(request, marshaller, unmarshaller));
        }
예제 #2
0
        /// <summary>
        /// Initiates the asynchronous execution of the GetDashboard operation.
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the GetDashboard operation.</param>
        /// <param name="cancellationToken">
        ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
        /// </param>
        /// <returns>The task object representing the asynchronous operation.</returns>
        /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/GetDashboard">REST API Reference for GetDashboard Operation</seealso>
        public Task <GetDashboardResponse> GetDashboardAsync(GetDashboardRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller   = new GetDashboardRequestMarshaller();
            var unmarshaller = GetDashboardResponseUnmarshaller.Instance;

            return(InvokeAsync <GetDashboardRequest, GetDashboardResponse>(request, marshaller,
                                                                           unmarshaller, cancellationToken));
        }
예제 #3
0
        public string ExportCustTotalByStatusData(GetDashboardRequest model)
        {
            var    table    = GetTotalCustFuelOrdersByStatusDataTable(model.ClientID, model.StartDateFilter.ToShortDateString(), model.EndDateFilter.ToShortDateString());
            string filePath = ExportHelper.CreateFilePath("FuelOrdersTotalByStatus.csv", model.ClientName);

            CSVGenerator.GenerateCSV(table, filePath);
            return(ExportHelper.GetFilePathFromRoot(filePath));
        }
예제 #4
0
        /// <summary>
        /// Initiates the asynchronous execution of the GetDashboard operation.
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the GetDashboard operation.</param>
        /// <param name="cancellationToken">
        ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
        /// </param>
        /// <returns>The task object representing the asynchronous operation.</returns>
        /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/GetDashboard">REST API Reference for GetDashboard Operation</seealso>
        public virtual Task <GetDashboardResponse> GetDashboardAsync(GetDashboardRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = GetDashboardRequestMarshaller.Instance;
            options.ResponseUnmarshaller = GetDashboardResponseUnmarshaller.Instance;

            return(InvokeAsync <GetDashboardResponse>(request, options, cancellationToken));
        }
예제 #5
0
        internal virtual GetDashboardResponse GetDashboard(GetDashboardRequest request)
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = GetDashboardRequestMarshaller.Instance;
            options.ResponseUnmarshaller = GetDashboardResponseUnmarshaller.Instance;

            return(Invoke <GetDashboardResponse>(request, options));
        }
예제 #6
0
        /// <summary>
        /// Get the json that represents the dashboard.
        /// </summary>
        /// <param name="client">An initialized CloudWatch client.</param>
        /// <param name="dashboardName">The name of the dashboard.</param>
        /// <returns>The string containing the json value describing the
        /// contents and layout of the CloudWatch dashboard.</returns>
        public static async Task <string> GetDashboardAsync(IAmazonCloudWatch client, string dashboardName)
        {
            var request = new GetDashboardRequest
            {
                DashboardName = dashboardName,
            };

            var response = await client.GetDashboardAsync(request);

            return(response.DashboardBody);
        }
예제 #7
0
        public IList <Dashboard> Handle(GetDashboardRequest query)
        {
            var dashboard = (from project in this.repository.Query <Entity.Project>()
                             join associate in this.repository.Query <Entity.Associate>() on project.Id equals associate.ProjectId into associateTemp
                             from associate in associateTemp.DefaultIfEmpty()
                             join team in this.repository.Query <Entity.Team>() on associate.AssociateDetails.TeamId equals team.Id into teamTemp
                             from team in teamTemp.DefaultIfEmpty()
                             join associateProject in this.repository.Query <Entity.AssociateProject>() on new { projectId = associate.ProjectId, associateId = associate.Id, status = true } equals new { projectId = associateProject.ProjectId, associateId = associateProject.AssociateId, status = associateProject.Status } into associateProjectTemp
                             from associateProject in associateProjectTemp.DefaultIfEmpty()
                             where associate.Role.Name != RoleConstant.Other
                             group new { associate, associateProject } by new
            {
                projectId = project.Id,
                projectName = project.Name,
                teamId = team.Id,
                teamName = team.Name,
                roleId = associate.Role.Id,
                roleName = associate.Role.Name,
                associateId = associate.Code,
                associateName = associate.Name,
                fse = associate.AssociateDetails.Fse,
                fseEligibility = associate.AssociateDetails.FseEligibility
            } into groupby
                             select new Dashboard
            {
                ProjectId = groupby.Key.projectId,
                ProjectName = groupby.Key.projectName,
                TeamId = groupby.Key.teamId,
                TeamName = groupby.Key.teamName,
                RoleId = groupby.Key.roleId,
                RoleName = groupby.Key.roleName,
                AssociateId = groupby.Key.associateId,
                AssociateName = groupby.Key.associateName,
                Fse = groupby.Key.fse,
                FseEligibility = groupby.Key.fseEligibility,
                Count = groupby.Where(i => i.associate != null).Select(i => i.associate.Id).Distinct().Count(),
                CompletedCount = groupby.Where(i => i.associateProject != null).Select(i => i.associateProject.Id).Distinct().Count()
            }).ToList();

            dashboard.ForEach(associate =>
            {
                associate.PodCompletionPercentage = getPodCompletionPercentage(associate.AssociateId);
            });
            return(dashboard);
        }
        private void HandleOutput(GetDashboardRequest request)
        {
            var waiterConfig = new WaiterConfiguration
            {
                MaxAttempts           = MaxWaitAttempts,
                GetNextDelayInSeconds = (_) => WaitIntervalSeconds
            };

            switch (ParameterSetName)
            {
            case LifecycleStateParamSet:
                response = client.Waiters.ForDashboard(request, waiterConfig, WaitForLifecycleState).Execute();
                break;

            case Default:
                response = client.GetDashboard(request).GetAwaiter().GetResult();
                break;
            }
            WriteOutput(response, response.Dashboard);
        }
        protected override void ProcessRecord()
        {
            base.ProcessRecord();
            GetDashboardRequest request;

            try
            {
                request = new GetDashboardRequest
                {
                    DashboardId    = DashboardId,
                    OpcRequestId   = OpcRequestId,
                    OpcCrossRegion = OpcCrossRegion
                };

                HandleOutput(request);
                FinishProcessing(response);
            }
            catch (Exception ex)
            {
                TerminatingErrorDuringExecution(ex);
            }
        }
예제 #10
0
        public string GetGeneralSummaryData(GetDashboardRequest model)
        {
            var table = GetFuelOrdersGeneralSummaryDataTable(model.ClientID, model.StartDateFilter.ToShortDateString(), model.EndDateFilter.ToShortDateString());

            return(Newtonsoft.Json.JsonConvert.SerializeObject(table));
        }
예제 #11
0
        public string GetCustTotalByStatusData(GetDashboardRequest model)
        {
            var table = GetTotalCustFuelOrdersByStatusDataTable(model.ClientID, model.StartDateFilter.ToShortDateString(), model.EndDateFilter.ToShortDateString());

            return(Newtonsoft.Json.JsonConvert.SerializeObject(table));
        }
예제 #12
0
        public string GetFuelOrderHistory(GetDashboardRequest model)
        {
            var table = GetTransactionHistory(model.ClientID, model.StartDateFilter.ToShortDateString(), model.EndDateFilter.ToShortDateString());

            return(Newtonsoft.Json.JsonConvert.SerializeObject(table));
        }
예제 #13
0
        public string GetCustomerRankingData(GetDashboardRequest model)
        {
            var table = GetCustomerRankingDataTable(model.ClientID, model.StartDateFilter.ToShortDateString(), model.EndDateFilter.ToShortDateString());

            return(Newtonsoft.Json.JsonConvert.SerializeObject(table));
        }