public ActionResult AddEditRecruiterProfile(RecruiterViewModel recruiterViewModel) { ResponseOut responseOut = new ResponseOut(); IRecruiterBL recruiterBL = new RecruiterEngine(); try { if (recruiterViewModel != null) { int user_id = Convert.ToInt32(HttpContext.Session[SessionKey.CurrentUserID]); responseOut = recruiterBL.AddUpdateRecruiter(recruiterViewModel, user_id); } else { responseOut.message = ActionMessage.ProbleminData; responseOut.status = ActionStatus.Fail; } } catch (Exception ex) { responseOut.message = ActionMessage.ApplicationException; responseOut.status = ActionStatus.Fail; } return(Json(responseOut, JsonRequestBehavior.AllowGet)); }
public JsonResult GetCandidateProfile(int id) { RecruiterViewModel candidateProfile = new RecruiterViewModel(); IRecruiterBL recruiterBL = new RecruiterEngine(); try { candidateProfile = recruiterBL.GetCandidateProfile(id); } catch (Exception ex) { throw ex; } return(Json(candidateProfile, JsonRequestBehavior.AllowGet)); }
public ActionResult InterestredUsers() { List <InterestedToCandidateViewModel> interestedUserList = new List <InterestedToCandidateViewModel>(); IRecruiterBL recruiterBL = new RecruiterEngine(); try { int user_id = Convert.ToInt32(HttpContext.Session[SessionKey.CurrentUserID]); interestedUserList = recruiterBL.GetInterestedUsers(user_id); } catch (Exception ex) { throw ex; } return(View(interestedUserList)); }
public JsonResult SaveInterestedToCandidate(InterestedToCandidateViewModel model) { ResponseOut responseOut = new ResponseOut(); IRecruiterBL recruiterBL = new RecruiterEngine(); try { int user_id = Convert.ToInt32(HttpContext.Session[SessionKey.CurrentUserID]); responseOut = recruiterBL.SaveInterestedCandidate(model, user_id); } catch (Exception ex) { throw ex; } return(Json(responseOut, JsonRequestBehavior.AllowGet)); }
public ActionResult GetRecruitersList(string candidate_name = null, string candidate_technology = null, string candidate_experience = null) { List <RecruiterResultSet> recruitersResultSet = new List <RecruiterResultSet>(); IRecruiterBL recruiterBL = new RecruiterEngine(); try { int user_id = Convert.ToInt32(HttpContext.Session[SessionKey.CurrentUserID]); recruitersResultSet = recruiterBL.GetRecruitersList(user_id, candidate_name, candidate_technology, candidate_experience); } catch (Exception ex) { throw ex; } //return Json(recruitersResultSet, JsonRequestBehavior.AllowGet); return(PartialView(recruitersResultSet)); }
public ResponseOut UploadVendorCandidate(ImportVendorCandidateViewModel data) { using (PortalEntities _context = new PortalEntities()) { ResponseOut parentResponseOut = new ResponseOut(); try { ResponseOut vendorResponseOut = new ResponseOut(); //Insert or Get Country int country_id = _context.portal_country.Where(x => x.country_name.ToLower() == data.country.ToLower()).Select(x => x.pk_country_id).FirstOrDefault(); int state_id = _context.portal_state.Where(x => x.state_name.ToLower() == data.state.ToLower()).Select(x => x.pk_state_id).FirstOrDefault(); int city_id = _context.portal_city.Where(x => x.city_name.ToLower() == data.city.ToLower()).Select(x => x.pk_city_id).FirstOrDefault(); int vendor_id = _context.portal_user.Where(x => x.user_name.ToLower() == data.vendor_user_name.ToLower()).Select(x => x.pk_user_id).FirstOrDefault(); int experience_level_id = _context.portal_experience.Where(x => x.level.ToLower() == data.experience_level.ToLower()).Select(x => x.pk_experience_level_id).FirstOrDefault(); string technology_id = _context.portal_experise.Where(x => x.expertise_name.ToLower() == data.candidate_technology.ToLower()).Select(x => x.pk_expertise_id.ToString()).FirstOrDefault(); if (country_id == 0) { portal_country _country = new portal_country(); _country.country_name = data.country; _context.portal_country.Add(_country); _context.SaveChanges(); country_id = _country.pk_country_id; } if (state_id == 0) { portal_state _state = new portal_state(); _state.state_name = data.state; _state.fk_country_id = country_id; _context.portal_state.Add(_state); _context.SaveChanges(); state_id = _state.pk_state_id; } if (city_id == 0) { portal_city _city = new portal_city(); _city.city_name = data.city; _city.fk_state_id = state_id; _context.portal_city.Add(_city); _context.SaveChanges(); city_id = _city.pk_city_id; } if (vendor_id == 0) { UserViewModel _user = new UserViewModel(); IUserBL _userbl = new UserEngine(); _user.user_name = data.vendor_user_name; _user.password = data.vendor_password; _user.firstname = data.vendor_name; _user.fk_country_id = country_id; _user.fk_state_id = state_id; _user.fk_city_id = city_id; _user.fk_user_type = 2; vendorResponseOut = _userbl.AddUserProfile(_user); } else { vendorResponseOut.trnId = vendor_id; } if (string.IsNullOrEmpty(technology_id)) { portal_experise _expertise = new portal_experise(); _expertise.expertise_name = data.candidate_technology; _context.portal_experise.Add(_expertise); _context.SaveChanges(); technology_id = _expertise.pk_expertise_id.ToString(); } //Recruiter name have to change Candidate IRecruiterBL _candidatebl = new RecruiterEngine(); RecruiterViewModel _candidate = new RecruiterViewModel(); _candidate.firstname = data.candidate_firstname; _candidate.expertise_profession = technology_id; _candidate.about_us = data.candidate_one_liner_headline; _candidate.fk_experience_level = experience_level_id; _candidate.fk_country_id = country_id; _candidate.fk_state_id = state_id; _candidate.fk_city_id = city_id; _candidate.availability = data.availability; _candidatebl.AddUpdateRecruiter(_candidate, vendorResponseOut.trnId); parentResponseOut.status = ActionStatus.Success; parentResponseOut.status = ActionMessage.RecordSaved; } catch (Exception ex) { parentResponseOut.status = ActionStatus.Fail; parentResponseOut.message = ActionMessage.ApplicationException; } return(parentResponseOut); } }