public JsonResult GetStates(string countryCode)
        {
            IEnumerable <StateViewModel> states = null;

            try
            {
                states = _rBuilderHandler.GetStates(countryCode);
                return(new JsonResult(new { isSuccess = true, States = states }, ContractSerializer.JsonInPascalCase()));
            }

            catch (DataNotFound ex)
            {
                Logger.Logger.WriteLog(Logger.Logtype.Error, ex.Message, 0, typeof(ResumeBuilderController), ex);
                return(new JsonResult(new { isSuccess = false }));
            }
        }
        public JsonResult GetCourses(int cCategory)
        {
            IEnumerable <CourseViewModel> courses = null;

            try
            {
                courses = _rBuilderHandler.GetCourses(cCategory);
                return(new JsonResult(new { isSuccess = true, Courses = courses }, ContractSerializer.JsonInPascalCase()));
            }

            catch (DataNotFound ex)
            {
                Logger.Logger.WriteLog(Logger.Logtype.Error, ex.Message, 0, typeof(ResumeBuilderController), ex);
                return(new JsonResult(new { isSuccess = false }));
            }
        }
Esempio n. 3
0
        public IActionResult ProfileData()
        {
            UserDetail model = new UserDetail();
            var        user  = HttpContext.Session.Get <UserViewModel>(Constants.SessionKeyUserInfo);

            user = user ?? new UserViewModel();
            try
            {
                ViewBag.JobIndustryArea  = jobpastHandler.GetJobIndustryAreaDetails();
                ViewBag.EmploymentStatus = jobpastHandler.GetJobJobEmploymentStatusDetails();
                ViewBag.Country          = jobpastHandler.GetCountryDetails();

                model = userProfileHandler.GetJobseekerDetail(user.UserId);
            }
            catch (DataNotFound ex)
            {
                Logger.Logger.WriteLog(Logger.Logtype.Error, ex.Message, user.UserId, typeof(JobSeekerManagementController), ex);
                ModelState.AddModelError("ErrorMessage", string.Format("{0}", ex.Message));
            }
            return(new JsonResult(model, ContractSerializer.JsonInPascalCase()));
        }
        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()
                       ));
        }
        public JsonResult GetUserDetails()
        {
            bool    isSuccess = true;
            dynamic data      = null;
            var     user      = HttpContext.Session.Get <UserViewModel>(Constants.SessionKeyUserInfo);

            user = user ?? new UserViewModel();
            try
            {
                data = _rBuilderHandler.GetUserDetails(user.UserId);
            }

            catch (DataNotUpdatedException ex)
            {
                Logger.Logger.WriteLog(Logger.Logtype.Error, ex.Message, user.UserId, typeof(ResumeBuilderController), ex);
                isSuccess = false;
            }
            return(new JsonResult(
                       new { isSuccess = isSuccess, data = data },
                       ContractSerializer.JsonInPascalCase()
                       ));
        }