Пример #1
0
 public DataTable GetDemandAggregationOnState(DemandAggregationSearchFilters filters)
 {
     using (var connection = new SqlConnection(connectionString))
     {
         try
         {
             SqlParameter[] parameters = new SqlParameter[] {
                 new SqlParameter("@states", filters.JobStates),
                 new SqlParameter("@year", filters.FinancialYear),
                 new SqlParameter("@userRole", filters.UserRole),
                 new SqlParameter("@employers", filters.Employers),
                 new SqlParameter("@jobRoles", filters.JobRoles)
             };
             var result =
                 SqlHelper.ExecuteDataset
                 (
                     connection,
                     CommandType.StoredProcedure,
                     "usp_GetDemandAggregationDashboardDataOnState",
                     parameters
                 );
             if (null != result && result.Tables.Count > 0)
             {
                 return(result.Tables[0]);
             }
         }
         finally
         {
             SqlHelper.CloseConnection(connection);
         }
     }
     throw new DataNotFound("Demand aggregation data for this state not found, please contact your tech deck.");
 }
Пример #2
0
        public IList <DemandAggregationOnStatesViewModel> GetDemandAggregationOnState(int userId, DemandAggregationSearchItems search)
        {
            var dataOnState = new List <DemandAggregationOnStatesViewModel>();
            var filters     = new DemandAggregationSearchFilters
            {
                Employers     = search.Employers,
                FinancialYear = search.FinancialYear,
                JobRoles      = search.JobRoles,
                JobStates     = search.JobStates,
                UserId        = userId,
                UserRole      = search.UserRole
            };
            var data = dashboard.GetDemandAggregationOnState(filters);

            foreach (DataRow row in data.Rows)
            {
                dataOnState.Add(new DemandAggregationOnStatesViewModel
                {
                    StateCode = Convert.ToString(row["StateCode"]),
                    State     = Convert.ToString(row["StateName"]),
                    //Month = Convert.ToInt32(row["PostedMonth"]),
                    Year = Convert.ToInt32(row["PostedYear"]),
                    DemandAggregations = SimplifyTotalDemandAggregatedData(row)
                });
            }
            return(dataOnState);
        }
Пример #3
0
        public IList <DemandAggregationOnEmployersViewModel> GetDemandAggregationDataOnEmployer(int userId, DemandAggregationSearchItems search)
        {
            var dataOnEmployer = new List <DemandAggregationOnEmployersViewModel>();
            var filters        = new DemandAggregationSearchFilters
            {
                Employers     = search.Employers,
                FinancialYear = search.FinancialYear,
                JobRoles      = search.JobRoles,
                JobStates     = search.JobStates,
                UserId        = userId,
                UserRole      = search.UserRole
            };
            var data = dashboard.GetDemandAggregationOnEmployer(filters);

            foreach (DataRow row in data.Rows)
            {
                dataOnEmployer.Add(new DemandAggregationOnEmployersViewModel
                {
                    //EmployerId = Convert.ToInt32(row["UserId"]),
                    //EmployerFName = Convert.ToString(row["FirstName"]),
                    // EmployerLName = Convert.ToString(row["LastName"]),
                    Company = Convert.ToString(row["CompanyName"]),
                    //Month = Convert.ToInt32(row["PostedMonth"]),
                    Year = Convert.ToInt32(row["PostedYear"]),
                    DemandAggregations = SimplifyTotalDemandAggregatedData(row)
                });
            }
            return(dataOnEmployer);
        }
Пример #4
0
        public IWorkbook GetDemandAggregationReportData(DemandAggregationSearchItems search, FileExtensions fileExtension)
        {
            var filters = new DemandAggregationSearchFilters
            {
                Employers     = search.Employers,
                FinancialYear = search.FinancialYear,
                JobRoles      = search.JobRoles,
                JobStates     = search.JobStates,
                UserRole      = search.UserRole
            };
            var reportData = dashboard.GetDemandAggregationReportData(filters);

            return(ModifyWorkBook(NPOIManager.CreateExcelWorkBook(reportData, fileExtension, "Demand Aggregation Report")));
        }
Пример #5
0
        public IList <DemandAggregationDetailsViewModel> ViewDemandAggregationDetails(string onBasis, string value, DemandAggregationSearchItems search)
        {
            var filters = new DemandAggregationSearchFilters
            {
                Employers     = search.Employers,
                FinancialYear = search.FinancialYear,
                JobRoles      = search.JobRoles,
                JobStates     = search.JobStates,
                UserRole      = search.UserRole
            };
            var data = dashboard.ViewDemandAggregationDetails(onBasis, value, filters);

            return(SimplifyDemandAggregationDetails(data));
        }