public static CandidateProfile SaveCandidate(CandidateProfile CPOBJ) { CandidateProfile OBJ = null; String connstring = Connection.GetConnectionString(); using (SqlConnection dbCon = new SqlConnection(connstring)) { dbCon.Open(); using (SqlCommand dbCom = new SqlCommand(StoredProcedure.USP_PERSON_CANDIDATEINSERTUPDATE, dbCon)) { dbCom.CommandType = CommandType.StoredProcedure; dbCom.Parameters.AddWithValue(CandidateName, CPOBJ.Name); dbCom.Parameters.AddWithValue(CandidateGender, CPOBJ.Gender); dbCom.Parameters.AddWithValue(CandidateDOB, CPOBJ.DOB); dbCom.Parameters.AddWithValue(CandidateAddress, CPOBJ.Address); dbCom.Parameters.AddWithValue(CandidateEmail, CPOBJ.Email); dbCom.Parameters.AddWithValue(CandidateMobile, CPOBJ.Mobile); dbCom.Parameters.AddWithValue(CandidateQual, CPOBJ.Qualification); dbCom.Parameters.AddWithValue(CandidateExp, CPOBJ.Experiance); dbCom.Parameters.AddWithValue(CandidateIntrst, CPOBJ.Interests); dbCom.Parameters.AddWithValue(CandidateImage, CPOBJ.ImgValue); dbCom.ExecuteNonQuery(); } } return(OBJ); }
public ActionResult CandidateProfileIndex(CandidateProfileIndexViewModel model) { if (!ModelState.IsValid) { return(View(model)); } using (var context = new ApplicationDbContext()) { var profile = new CandidateProfile { Title = model.Title, FirstName = model.FirstName, LastName = model.LastName, PhoneNumber = model.PhoneNumber, MobileNumber = model.MobileNumber, City = model.City, Country = model.Country, PostCode = model.PostCode, Summary = model.Summary, Skills = model.Skills, Languages = model.Languages }; context.CandidateProfile.Add(profile); context.SaveChanges(); } return(View(model)); }
//preview a candidate profile public ActionResult Preview(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } CandidateProfile candidateProfile = db.CandidateProfiles.Find(id); //get contact data details for logged in user //get the list of all the experiences for the logged in user candidateProfile.CandidateExperience = db.CandidateExperiences.Where(x => x.Id_candidate == id).ToList(); //get the list of all the studies for the logged user candidateProfile.CandidateStudies = db.CandidateStudies.Where(x => x.id_candidate == id).ToList(); //get the list of all the technologies for the logged user candidateProfile.CandidateTechnologies = db.CandidateTechnologies.Where(x => x.id_candidate == id).ToList(); //get the list of all the languages for the logged user candidateProfile.CandidateLanguages = db.CandidateLanguages.Where(x => x.id_candidate == id).ToList(); if (candidateProfile == null) { return(HttpNotFound()); } return(View(candidateProfile)); }
public bool updateCandidateProfile(CandidateProfile candidate) { string query1 = "spCandidateContactData"; using (SqlConnection conn = new SqlConnection(connString)) { SqlCommand cmd = new SqlCommand(query1, conn); cmd.CommandType = System.Data.CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@id_candidate", candidate.Id_candidate); cmd.Parameters.AddWithValue("@email", candidate.Email); cmd.Parameters.AddWithValue("@firstname", candidate.First_name); cmd.Parameters.AddWithValue("@lastname", candidate.Last_name); cmd.Parameters.AddWithValue("@phone", candidate.Phone); cmd.Parameters.AddWithValue("@address", candidate.Address); cmd.Parameters.AddWithValue("@city", candidate.City); cmd.Parameters.AddWithValue("@country", candidate.Country); cmd.Parameters.AddWithValue("@aboutme", candidate.AboutMe); conn.Open(); int i = cmd.ExecuteNonQuery(); conn.Close(); if (i > 1) { return(true); } else { return(false); } } }
/// <summary> /// /// </summary> /// <param name="candidateprofileId"></param> /// <param name="vacancyId"></param> /// <returns></returns> public ICandidateProfile CreateCandidateProfile(int candidateprofileId, int vacancyId) { ICandidateProfile candidateprofile = new CandidateProfile(); candidateprofile.CandidateProfileID = candidateprofileId; candidateprofile.VacancyID = vacancyId; return(candidateprofile); }
/// <summary> /// /// </summary> /// <param name="candidateprofileId"></param> /// <param name="bgcteststatus"></param> /// <returns></returns> public ICandidateProfile CreateCandidateProfile(int candidateprofileId, bool bgcteststatus) { ICandidateProfile candidateprofile = new CandidateProfile(); candidateprofile.CandidateProfileID = candidateprofileId; candidateprofile.BgcTestStatus = bgcteststatus; return(candidateprofile); }
/// <summary> /// /// </summary> /// <param name="candidateprofileId"></param> /// <param name="teststatus"></param> /// <returns></returns> public ICandidateProfile CreateCandidateProfile1(int candidateprofileId, int teststatus) { ICandidateProfile candidateprofile = new CandidateProfile(); candidateprofile.CandidateProfileID = candidateprofileId; candidateprofile.TestStatus = teststatus; return(candidateprofile); }
public ActionResult DeleteConfirmed(int id) { CandidateProfile candidateProfile = db.CandidateProfiles.Find(id); db.CandidateProfiles.Remove(candidateProfile); db.SaveChanges(); return(RedirectToAction("Index")); }
public ResponseOut AddUpdateCandidateProfile(CandidateProfile model) { ResponseOut responseOut = new ResponseOut(); using (PortalEntities _context = new PortalEntities()) { try { portal_user_candidate_info candidate_Info = new portal_user_candidate_info(); var is_Candidate_exist = _context.portal_user_candidate_info.Where(x => x.fk_user_id == model.fk_user_id).Any(); if (is_Candidate_exist) { candidate_Info = _context.portal_user_candidate_info.Where(x => x.fk_user_id == model.fk_user_id).FirstOrDefault(); } portal_user portal_User = _context.portal_user.Where(x => x.pk_user_id == model.fk_user_id).FirstOrDefault(); candidate_Info.availability = model.availability; candidate_Info.fk_user_id = model.fk_user_id; candidate_Info.resume = model.resume; candidate_Info.technologies = model.selected_technologies_name; candidate_Info.preferred_city = model.city_listing; candidate_Info.preferred_country = model.country_listing; candidate_Info.preferred_state = model.state_listing; candidate_Info.head_line = model.head_line; if (!is_Candidate_exist) { _context.portal_user_candidate_info.Add(candidate_Info); } portal_User.fk_country_id = model.candidate_fk_country_id; portal_User.fk_state_id = model.candidate_fk_state_id; portal_User.fk_city_id = model.candidate_fk_city_id; portal_User.profile_pic = model.profile_pic; portal_User.firstname = model.first_name; portal_User.lastname = model.last_name; portal_User.email = model.email; portal_User.contact = model.contact; int result = _context.SaveChanges(); if (result > 0) { responseOut.status = ActionStatus.Success; responseOut.message = ActionMessage.RequirementPost; } } catch (EntityException ex) { responseOut.status = ActionStatus.Fail; responseOut.message = ActionMessage.ApplicationException; } catch (Exception ex) { responseOut.status = ActionStatus.Fail; responseOut.message = ActionMessage.ApplicationException; } } return(responseOut); }
public ActionResult Edit([Bind(Include = "Id_candidate,Last_name,First_name,Email,Phone,Address,City,Country,AboutMe")] CandidateProfile candidateProfile) { if (ModelState.IsValid) { db.Entry(candidateProfile).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(candidateProfile)); }
public CandidateProfile ProfileSave(CandidateProfileModel Profilemodel) { string ResponesUrl = string.Empty; CandidateProfile profilemd = new CandidateProfile(); try { CandidateProfile Profiles = repository.FindByCondition(x => x.EmailId == Profilemodel.EmailId && x.IsActive == true).FirstOrDefault(); if (Profiles != null) { throw new HttpException((int)HttpStatusCode.NotFound, "EmailId Already exist,Please Try Again"); } if (Profilemodel.FileExist) { using (var fileStream = Profilemodel.FileUpload.OpenReadStream()) { byte[] fileData = new byte[Profilemodel.FileUpload.Length]; string mimeType = Profilemodel.FileUpload.ContentType; string strContainerName = "fileconatiner"; BlobStorageService objBlobService = new BlobStorageService(); ResponesUrl = objBlobService.UploadFileToBlob(Profilemodel.FileUpload.FileName, fileData, mimeType, strContainerName); } } profilemd.FirstName = Profilemodel.FirstName; profilemd.LastName = Profilemodel.LastName; profilemd.MobileNumber = Profilemodel.MobileNumber; profilemd.Skills = Profilemodel.Skills; profilemd.NoticePeriod = Profilemodel.NoticePeriod; profilemd.CreateDate = DateTime.Now.ToString(); profilemd.CurrentCompany = Profilemodel.CurrentCompany; profilemd.CurrentCtc = Profilemodel.CurrentCtc; profilemd.Designation = Profilemodel.Designation; profilemd.DesiredLocation = Profilemodel.DesiredLocation; profilemd.EmailId = Profilemodel.EmailId; profilemd.ExpectedCtc = Profilemodel.ExpectedCtc; profilemd.Experience = Profilemodel.Experience; profilemd.Userid = Profilemodel.Userid; profilemd.IsActive = true; profilemd.Resumeattachment = ResponesUrl; repository.Insert(profilemd); repository.Save(); } catch (HttpException ex) { throw ex; } catch (Exception ex) { throw ex; } return(profilemd); }
// GET: CandidateProfiles/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } CandidateProfile candidateProfile = db.CandidateProfiles.Find(id); if (candidateProfile == null) { return(HttpNotFound()); } return(View(candidateProfile)); }
public void Delete(int Id) { _log.LogInformation($"Searching Candidate Profile {Id}"); CandidateProfile CandidateProfile = _CandidateProfileRepository.Query().Where(_ => _.Id == Id).FirstOrDefault(); if (CandidateProfile == null) { throw new DeleteCandidateProfileNotFoundException(Id); } _log.LogInformation($"Deleting Candidate Profile {Id}"); _CandidateProfileRepository.Delete(CandidateProfile); _unitOfWork.Complete(); }
private void ValidateExistence(int Id, string name) { try { CandidateProfile CandidateProfile = _CandidateProfileRepository.Query().Where(_ => _.Name == name && _.Id != Id).FirstOrDefault(); if (CandidateProfile != null) { throw new InvalidCandidateProfileException("The Profile already exists ."); } } catch (ValidationException ex) { throw new CreateContractInvalidException(ex.ToListOfMessages()); } }
public IActionResult Post([FromForm] CandidateProfileModel candidateProfile) { try { CandidateProfile Profile = _repository.ProfileSave(candidateProfile); return(Ok(new { Status = StatusCodes.Status200OK, Message = "success", Profile })); } catch (HttpException ex) { return(new ObjectResult(new { Status = ex.StatusCode, Message = ex.StatusDescription })); } catch (Exception ex) { return(new ObjectResult(new { Status = StatusCodes.Status500InternalServerError, Message = ex.Message })); } }
public ActionResult AddUpdateCandidateProfile(CandidateProfile data) { ICandidateBL candidateBL = new CandidateEngine(); ResponseOut responseOut = new ResponseOut(); try { responseOut = candidateBL.AddUpdateCandidateProfile(data); } catch (Exception ex) { Log.Error("Error in CandidateController/AddUpdateCandidateProfile", ex); responseOut.message = ActionMessage.ApplicationException; responseOut.status = ActionStatus.Fail; } return(Json(responseOut, JsonRequestBehavior.AllowGet)); }
public ActionResult UserProfile(CandidateProfile candidateProfile) { NoBordersDB db = new NoBordersDB(); ModelState.Clear(); if (ModelState.IsValid) { //update candidate contact data db.Entry(candidateProfile).State = System.Data.Entity.EntityState.Modified; Session["user_name"] = candidateProfile.First_name + " " + candidateProfile.Last_name; //loop through every candidate experience and update in database //for (int i = 0; i < candidateProfile.CandidateExperience.Count(); i++) //{ // db.Entry(candidateProfile.CandidateExperience[i]).State = System.Data.Entity.EntityState.Modified; //} ////loop through every candidate studies and update in database //for (int i = 0; i < candidateProfile.CandidateStudies.Count(); i++) //{ // db.Entry(candidateProfile.CandidateStudies[i]).State = System.Data.Entity.EntityState.Modified; //} ////loop through every candidate tech and update in database //for (int i = 0; i < candidateProfile.CandidateTechnologies.Count(); i++) //{ // db.Entry(candidateProfile.CandidateTechnologies[i]).State = System.Data.Entity.EntityState.Modified; //} ////loop through every candidate languages and update in database //for (int i = 0; i < candidateProfile.CandidateLanguages.Count(); i++) //{ // db.Entry(candidateProfile.CandidateLanguages[i]).State = System.Data.Entity.EntityState.Modified; //} //perform the update in all the tables try { db.SaveChanges(); } catch (DbUpdateException ex) { string error = ex.Message; } return(RedirectToAction("UserProfile")); } return(View(candidateProfile)); }
//remove experience row public JsonResult DeleteExperience(int?Id_candidate, int?Id_experience) { NoBordersDB db = new NoBordersDB(); CandidateProfile candidateProfile = db.CandidateProfiles.Find(Id_candidate); CandidateExperience candidateExperience = db.CandidateExperiences.SingleOrDefault(x => x.Id_candidate == Id_candidate && x.Id_experience == Id_experience); bool result = false; if (candidateExperience != null) { db.CandidateExperiences.Remove(candidateExperience); db.SaveChanges(); result = true; } return(Json(result, JsonRequestBehavior.AllowGet)); }
//remove studies row public JsonResult DeleteStudies(int?Id_candidate, int?id_education) { NoBordersDB db = new NoBordersDB(); CandidateProfile candidateProfile = db.CandidateProfiles.Find(Id_candidate); CandidateStudies candidateStudies = db.CandidateStudies.SingleOrDefault(x => x.id_candidate == Id_candidate && x.id_education == id_education); bool result = false; if (candidateStudies != null) { db.CandidateStudies.Remove(candidateStudies); db.SaveChanges(); result = true; } return(Json(result, JsonRequestBehavior.AllowGet)); }
public static CandidateProfile FetchCandidateDetails(string phoneno) { CandidateProfile OBJ = new CandidateProfile(); String connstring = Connection.GetConnectionString(); using (SqlConnection dbCon = new SqlConnection(connstring)) { dbCon.Open(); using (SqlCommand dbCom = new SqlCommand(StoredProcedure.USP_PERSON_GETPERSONDETAILS, dbCon)) { dbCom.CommandType = CommandType.StoredProcedure; dbCom.Parameters.AddWithValue(Phoneno, phoneno); using (SqlDataReader wizReader = dbCom.ExecuteReader()) { while (wizReader.Read()) { OBJ.Name = Convert.ToString(wizReader["NAME"]); OBJ.Gender = Convert.ToString(wizReader["GENDER"]); OBJ.DOB = Convert.ToDateTime(wizReader["DOB"]); OBJ.Address = Convert.ToString(wizReader["ADDRESS"]); OBJ.Email = Convert.ToString(wizReader["EMAIL"]); OBJ.Qualification = Convert.ToString(wizReader["QUALIFICATION"]); OBJ.Experiance = Convert.ToString(wizReader["EXPERIANCE"]); OBJ.Interests = Convert.ToString(wizReader["INTEREST"]); OBJ.ImgValue = Convert.ToString(wizReader["IMGPATH"]); } } if (String.IsNullOrEmpty(OBJ.ImgValue)) { OBJ.ImgValue = "NoImage.png"; } } } return(OBJ); }
public CandidateProfile GetCandidateProfile(int user_id) { using (PortalEntities _context = new PortalEntities()) { CandidateProfile candidate_data = new CandidateProfile(); bool candidate = _context.portal_user_candidate_info.Where(x => x.fk_user_id == user_id).Any(); if (candidate) { candidate_data = _context.portal_user_candidate_info.Where(x => x.fk_user_id == user_id).AsEnumerable().Select(x => new CandidateProfile { fk_user_id = x.portal_user.pk_user_id, about_us = x.portal_user.about_us, email = x.portal_user.email, first_name = x.portal_user.firstname, last_name = x.portal_user.lastname, candidate_fk_city_id = Convert.ToInt32(x.portal_user.fk_city_id), candidate_fk_state_id = Convert.ToInt32(x.portal_user.fk_state_id), candidate_fk_country_id = Convert.ToInt32(x.portal_user.fk_country_id), availability = x.availability, city_listing = x.preferred_city, country_listing = x.preferred_country, state_listing = x.preferred_state, resume = x.resume, profile_headline = x.head_line, profile_pic = x.portal_user.profile_pic, contact = x.portal_user.contact, selected_technologies_name = x.technologies, }).FirstOrDefault(); } else { candidate_data.fk_user_id = user_id; } return(candidate_data); } }
/// <summary> /// /// </summary> /// <returns></returns> public ICandidateProfile CreateCandidateProfile() { ICandidateProfile candidateprofile = new CandidateProfile(); return(candidateprofile); }