public bool Edit([FromBody] ProfileViewModel model) { Data.AppTrackEntities.profileinfo candidate = new Data.AppTrackEntities.profileinfo { CreateDate = DateTime.Now, AppliedPositionFor = model.AppliedPositionFor, CandidateId = model.CandidateId, CompanyContact = model.CompanyContact, CompanyDetails = model.CompanyDetails, ContactOfRecruiter = model.RecruiterContact, CreatedBy = 0, CurrentStatus = model.CurrentStatus, DateOfInterview = Convert.ToDateTime(model.DateOfInterview), HRCopy = model.HRCopy, Interviewer = model.Interviewer, InterviewerMobile = model.InterviewerContact, NameOfRecruiter = model.RecruiterName, ReferenceType = model.ReferenceType, TeamLeadName = model.TeamLeadName, ModifiedBy = null, ModifiedDate = null }; try { // _businessLayer.AddCandidate(candidate); return(true); } catch (Exception ex) { return(false); } }
public bool UpdateProfile([FromBody] ProfileViewModel model) { // return true; var userName = RequestContext.Principal.Identity.Name; var user = _businessLayer.GetAllEmployeesAsync().Result.Where(x => x.Email == userName).FirstOrDefault(); //var statusId = _businessLayer.GetAllCandStatusAsync().Result.Where(x => x.Name.ToUpper() == "CREATED").First().CanStatusId; Data.AppTrackEntities.profileinfo profile = new Data.AppTrackEntities.profileinfo { ProfileId = model.ProfileId, //CreateDate = DateTime.Now, AppliedPositionFor = model.AppliedPositionFor, CompanyId = model.CompanyId, IndustryId = model.IndustryId.Value, CandidateId = model.CandidateId, CompanyContact = model.CompanyContact, CompanyDetails = model.CompanyDetails, ContactOfRecruiter = model.RecruiterContact, CreatedBy = user.UserId, CurrentStatus = model.CurrentStatus, DateOfInterview = !string.IsNullOrEmpty(model.DateOfInterview) ? Convert.ToDateTime(model.DateOfInterview) : default(DateTime?), HRCopy = model.HRCopy, Interviewer = model.Interviewer, InterviewerMobile = model.InterviewerContact, NameOfRecruiter = model.RecruiterName, ReferenceType = model.ReferenceType, TeamLeadName = model.TeamLeadName, ModifiedBy = user.UserId, ModifiedDate = DateTime.Now, }; try { _businessLayer.UpdateProfile(profile); return(true); } catch (Exception ex) { return(false); } }
public void RemoveProfile(Data.AppTrackEntities.profileinfo profile) { _profileRepository.Remove(profile); }
public void UpdateProfile(Data.AppTrackEntities.profileinfo profile) { _profileRepository.Update(profile); }
public void AddProfile(Data.AppTrackEntities.profileinfo profile) { //TO DO: Validation and error handling _profileRepository.Add(profile); }
public Task RemoveProfileAsync(Data.AppTrackEntities.profileinfo profile) { throw new NotImplementedException(); }