Exemple #1
0
        public JsonResult GetDemandAggregationDataOnEmployer(DemandAggregationSearchItems search)
        {
            bool isSuccess = true;
            IList <DemandAggregationOnEmployersViewModel> data = new List <DemandAggregationOnEmployersViewModel>();
            var user = HttpContext.Session.Get <UserViewModel>(Constants.SessionKeyUserInfo);

            user = user ?? new UserViewModel();
            try
            {
                data = dashboardHandler.GetDemandAggregationDataOnEmployer(user.UserId, search);
            }

            catch (DataNotUpdatedException ex)
            {
                Logger.Logger.WriteLog(Logger.Logtype.Error, ex.Message, user.UserId, typeof(DashboardController), ex);
                isSuccess = false;
            }
            return(new JsonResult(
                       new { isSuccess = isSuccess, data = data },
                       ContractSerializer.JsonInPascalCase()
                       ));
        }
Exemple #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);
        }
Exemple #3
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));
        }
Exemple #4
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);
        }