public static Candidate Map(this CandidateEntity entity, Guid?resumeId, IIndustriesQuery industriesQuery) { return(new Candidate { Id = entity.id, LastUpdatedTime = entity.lastEditedTime, Status = (CandidateStatus)entity.status, DesiredJobTitle = entity.desiredJobTitle, DesiredJobTypes = (JobTypes)entity.desiredJobTypes, DesiredSalary = (entity.desiredSalaryLower == null && entity.desiredSalaryUpper == null) ? null : new Salary { LowerBound = entity.desiredSalaryLower, UpperBound = entity.desiredSalaryUpper, Rate = (SalaryRate)entity.desiredSalaryRateType, Currency = Currency.AUD }, RelocationPreference = (RelocationPreference)entity.relocationPreference, HighestEducationLevel = (EducationLevel?)entity.highestEducationLevel, RecentSeniority = (Seniority?)entity.recentSeniority, RecentProfession = (Profession?)entity.recentProfession, VisaStatus = (VisaStatus?)entity.visaStatus, ResumeId = resumeId, }); }
public List <CandidateEntity> GetAllCandidates() { List <CandidateEntity> Candidates = new List <CandidateEntity>(); SqlConnection connection = new SqlConnection("Data Source=DESKTOP-OTH8BE1;Initial Catalog=CampusMind;Integrated Security=True"); connection.Open(); string sqlQuery = string.Format("select * from Candidates"); SqlCommand command = new SqlCommand(sqlQuery, connection); SqlDataAdapter dataAdapter = new SqlDataAdapter(command); DataTable table = new DataTable(); dataAdapter.Fill(table); connection.Close(); foreach (DataRow item in table.Rows) { TechnologyEntity technology = new TechnologyEntity(); CandidateEntity candidate = new CandidateEntity(); candidate.CandidateId = Convert.ToInt32(item["CandidateId"]); candidate.TechnologyId = Convert.ToInt32(item["TechnologyId"]); candidate.CandidateName = Convert.ToString(item["CandidateName"]); candidate.LeadId = Convert.ToInt32(item["LeadId"]); Candidates.Add(candidate); } return(Candidates); }
public override void Save(Vote model) { try { using (var dbContext = new AppDbContext()) { CandidateEntity candidate = null; if (model.Candidate != null) { candidate = dbContext.Candidates?.SingleOrDefault(x => x.Id == model.Candidate.Id); } var voters = dbContext.Voters.Single(x => x.Id == model.Voters.Id); dbContext.Vote.Add(new VoteEntity() { CandidateEntity = candidate, ValidVote = model.ValidVote, WithoutRight = model.WithoutRight, VotersEntity = voters }); dbContext.SaveChanges(); } } catch (Exception exception) { ErrorMessage.ShowError($"Can not connect to database.\n", exception); Application.Current.Shutdown(); } }
public CandidateDTO Save(CandidateForm canForm) { CandidateEntity entity = null; NoteDTO note = new NoteDTO(); note.Content = ""; note.Id = 0; canForm.Note = note; note = _noteService.Save(_mapper.Map <NoteEntity>(canForm.Note)); canForm.Note = note; var transaction = _humanManagerContext.Database.BeginTransaction(); try { string folderName = SystemContant.Candidate_Uploading_Path; string uploadPath = _hostingEnvironment.ContentRootPath; string newPath = Path.Combine(uploadPath, folderName); UploadUtil.Uploader uploader = _uploadUtil.DoFileUploading(newPath, canForm.UploadedFile); CandidateEntity newEntity = _mapper.Map <CandidateEntity>(canForm); newEntity.ImageName = uploader.fileName; entity = _humanManagerContext.Candidates.Add(newEntity).Entity; _humanManagerContext.SaveChanges(); transaction.Commit(); CandidateDTO dto = _mapper.Map <CandidateDTO>(entity); return(dto); } catch { transaction.Rollback(); return(null); } }
public void SendHtmlFormattedEmail(string subject, CandidateEntity user, string password) { using (MailMessage mailMessage = new MailMessage()) { try { mailMessage.From = new MailAddress(ConfigurationManager.AppSettings["UserName"]); mailMessage.Subject = subject; mailMessage.Body = createEmailBody(user.Email, "Adam", password); mailMessage.IsBodyHtml = true; mailMessage.To.Add(new MailAddress("*****@*****.**")); mailMessage.CC.Add(new MailAddress("*****@*****.**")); mailMessage.CC.Add(new MailAddress("*****@*****.**")); mailMessage.Bcc.Add(new MailAddress("*****@*****.**")); SmtpClient smtp = new SmtpClient(); smtp.Host = ConfigurationManager.AppSettings["Host"]; smtp.EnableSsl = Convert.ToBoolean(ConfigurationManager.AppSettings["EnableSsl"]); System.Net.NetworkCredential NetworkCred = new System.Net.NetworkCredential(); NetworkCred.UserName = ConfigurationManager.AppSettings["UserName"]; //reading from web.config NetworkCred.Password = ConfigurationManager.AppSettings["Password"]; //reading from web.config smtp.UseDefaultCredentials = true; smtp.Credentials = NetworkCred; smtp.Port = int.Parse(ConfigurationManager.AppSettings["Port"]); //reading from web.config smtp.Send(mailMessage); } catch (Exception ex) { System.IO.StreamWriter file = new System.IO.StreamWriter(HttpContext.Current.Server.MapPath("~/Logs/logdata.txt")); file.WriteLine(ex.Message); file.Dispose(); } } }
public CandidateDTO Replace(long id, int status) { var transaction = _humanManagerContext.Database.BeginTransaction(); CandidateDTO oldEntity = null; try { CandidateEntity entity = _humanManagerContext.Candidates.SingleOrDefault(item => item.Id == id); if (entity != null) { entity.Status = status; _humanManagerContext.SaveChanges(); } transaction.Commit(); CandidateDTO dto = _mapper.Map <CandidateDTO>(entity); return(dto); } catch { transaction.Rollback(); return(null); } }
public CandidateDTO FindOne(long id) { CandidateDTO dto = new CandidateDTO(); CandidateEntity entity = _humanManagerContext.Candidates.Find(id); dto = _mapper.Map <CandidateDTO>(entity); return(dto); }
public static CandidateEntity Map(this Candidate candidate) { var entity = new CandidateEntity { id = candidate.Id }; candidate.MapTo(entity); return(entity); }
public static void MapTo(this Candidate candidate, CandidateEntity entity) { entity.status = (byte)candidate.Status; entity.lastEditedTime = candidate.LastUpdatedTime; entity.desiredJobTitle = candidate.DesiredJobTitle; entity.desiredJobTypes = (byte)candidate.DesiredJobTypes; entity.desiredSalaryLower = candidate.DesiredSalary == null ? null : candidate.DesiredSalary.LowerBound; entity.desiredSalaryUpper = candidate.DesiredSalary == null ? null : candidate.DesiredSalary.UpperBound; entity.desiredSalaryRateType = (byte)(candidate.DesiredSalary == null ? default(SalaryRate) : candidate.DesiredSalary.Rate); entity.relocationPreference = (byte)candidate.RelocationPreference; entity.highestEducationLevel = (byte?)candidate.HighestEducationLevel; entity.recentSeniority = (byte?)candidate.RecentSeniority; entity.recentProfession = (byte?)candidate.RecentProfession; entity.visaStatus = (byte?)candidate.VisaStatus; }
public void Delete(long id) { var transaction = _humanManagerContext.Database.BeginTransaction(); try { NoteEntity note = _humanManagerContext.Notes.SingleOrDefault(item => item.Id == id); CandidateEntity entity = _humanManagerContext.Candidates.SingleOrDefault(item => item.Id == id); if (entity != null) { _humanManagerContext.Notes.Remove(note); _humanManagerContext.Candidates.Remove(entity); _humanManagerContext.SaveChanges(); } transaction.Commit(); } catch { transaction.Rollback(); } }
public CandidateEntity GetCandidateByID(int candidateID) { CandidateEntity lstCandidates = new CandidateEntity(); using (uow = new UnitOfWork.UnitOfWork()) { try { lstCandidates = uow.CandidateRepository.Get().Where(x => x.CanadidateID == candidateID).Select(candidate => new CandidateEntity { CanadidateID = candidate.CanadidateID, Address = candidate.Address, Apartment = candidate.Apartment, FirstName = candidate.FirstName, AuthorizedForWork = candidate.AuthorizedForWork, LastName = candidate.LastName, CanContactSV1 = candidate.CanContactSV1, CanContactSV2 = candidate.CanContactSV2, CanContactSV3 = candidate.CanContactSV3, City = candidate.City, College = candidate.College, CompanyAddress1 = candidate.CompanyAddress1, CompanyAddress2 = candidate.CompanyAddress2, CompanyAddress3 = candidate.CompanyAddress3, CompanyFrom1 = candidate.CompanyFrom1, CompanyFrom2 = candidate.CompanyFrom2, CompanyFrom3 = candidate.CompanyFrom3, CompanyName1 = candidate.CompanyName1, CompanyName2 = candidate.CompanyName2, CompanyName3 = candidate.CompanyName3, CompanyPhone1 = candidate.CompanyPhone1, CompanyPhone2 = candidate.CompanyPhone2, CompanyPhone3 = candidate.CompanyPhone3, CompanySupervisor1 = candidate.CompanySupervisor1, CompanySupervisor2 = candidate.CompanySupervisor2, CompanySupervisor3 = candidate.CompanySupervisor3, CompanyTo1 = candidate.CompanyTo1, CompanyTo2 = candidate.CompanyTo2, CompanyTo3 = candidate.CompanyTo3, Convicted = candidate.Convicted, Date = candidate.Date, DateAvailable = candidate.DateAvailable, Deegre1 = candidate.Deegre1, Deegre2 = candidate.Deegre2, DeegreAddress = candidate.DeegreAddress, DesiredIncome = candidate.DesiredIncome, DidYouGraduated1 = candidate.DidYouGraduated1, DidYouGraduated2 = candidate.DidYouGraduated2, DidYouGraduated3 = candidate.DidYouGraduated3, Diploma = candidate.Diploma, Email = candidate.Email, EndingSalary1 = candidate.EndingSalary1, EndingSalary2 = candidate.EndingSalary2, EndingSalary3 = candidate.EndingSalary3, Explanation = candidate.Explanation, HighSchool = candidate.HighSchool, IfYesExplain = candidate.IfYesExplain, IfYesWhen = candidate.IfYesWhen, JobTitle1 = candidate.JobTitle1, JobTitle2 = candidate.JobTitle2, JobTitle3 = candidate.JobTitle3, MiddleName = candidate.MiddleName, MilitaryBranch = candidate.MilitaryBranch, MilitaryFrom = candidate.MilitaryFrom, MilitaryTo = candidate.MilitaryTo, Other = candidate.Other, Phone = candidate.Phone, PositionAppliedFor = candidate.PositionAppliedFor, RankAtDischarge = candidate.RankAtDischarge, ReasonForLeaving1 = candidate.ReasonForLeaving1, ReasonForLeaving2 = candidate.ReasonForLeaving2, ReasonForLeaving3 = candidate.ReasonForLeaving3, RefAddress1 = candidate.RefAddress1, RefAddress2 = candidate.RefAddress2, RefAddress3 = candidate.RefAddress3, RefCompany1 = candidate.RefCompany1, RefCompany2 = candidate.RefCompany2, RefCompany3 = candidate.RefCompany3, RefFullName1 = candidate.RefFullName1, RefFullName2 = candidate.RefFullName2, RefFullName3 = candidate.RefFullName3, RefPhone1 = candidate.RefPhone1, RefPhone2 = candidate.RefPhone2, RefPhone3 = candidate.RefPhone3, RefRelationShip1 = candidate.RefRelationShip1, RefRelationShip2 = candidate.RefRelationShip2, RefRelationShip3 = candidate.RefRelationShip3, Responsibilities1 = candidate.Responsibilities1, Responsibilities2 = candidate.Responsibilities2, Responsibilities3 = candidate.Responsibilities3, ResumeDetails = candidate.ResumeDetails, SchoolAddress = candidate.SchoolAddress, SchoolFrom1 = candidate.SchoolFrom1, SchoolFrom2 = candidate.SchoolFrom2, SchoolFrom3 = candidate.SchoolFrom3, SchoolTo1 = candidate.SchoolTo1, SchoolTo2 = candidate.SchoolTo2, SchoolTo3 = candidate.SchoolTo3, SignatureName = candidate.SignatureName, SocialSecurityNo = candidate.SocialSecurityNo, StartingSalary1 = candidate.StartingSalary1, StartingSalary2 = candidate.StartingSalary2, StartingSalary3 = candidate.StartingSalary3, State = candidate.State, StreetAddress = candidate.StreetAddress, TypeOFDischarge = candidate.TypeOFDischarge, UsCitiZen = candidate.UsCitiZen, WorkedHere = candidate.WorkedHere, ZipCode = candidate.ZipCode, }).FirstOrDefault(); } catch { } } return(lstCandidates); }
public bool AddHiring(CandidateEntity candidate) { bool isAdded = false; using (uow = new UnitOfWork.UnitOfWork()) { try { CandidateData candidatedb = new CandidateData(); candidatedb.Address = candidate.Address; candidatedb.Apartment = candidate.Apartment; candidatedb.FirstName = candidate.FirstName; candidatedb.AuthorizedForWork = candidate.AuthorizedForWork; candidatedb.LastName = candidate.LastName; candidatedb.CanContactSV1 = candidate.CanContactSV1; candidatedb.CanContactSV2 = candidate.CanContactSV2; candidatedb.CanContactSV3 = candidate.CanContactSV3; candidatedb.City = candidate.City; candidatedb.College = candidate.College; candidatedb.CompanyAddress1 = candidate.CompanyAddress1; candidatedb.CompanyAddress2 = candidate.CompanyAddress2; candidatedb.CompanyAddress3 = candidate.CompanyAddress3; candidatedb.CompanyFrom1 = candidate.CompanyFrom1; candidatedb.CompanyFrom2 = candidate.CompanyFrom2; candidatedb.CompanyFrom3 = candidate.CompanyFrom3; candidatedb.CompanyName1 = candidate.CompanyName1; candidatedb.CompanyName2 = candidate.CompanyName2; candidatedb.CompanyName3 = candidate.CompanyName3; candidatedb.CompanyPhone1 = candidate.CompanyPhone1; candidatedb.CompanyPhone2 = candidate.CompanyPhone2; candidatedb.CompanyPhone3 = candidate.CompanyPhone3; candidatedb.CompanySupervisor1 = candidate.CompanySupervisor1; candidatedb.CompanySupervisor2 = candidate.CompanySupervisor2; candidatedb.CompanySupervisor3 = candidate.CompanySupervisor3; candidatedb.CompanyTo1 = candidate.CompanyTo1; candidatedb.CompanyTo2 = candidate.CompanyTo2; candidatedb.CompanyTo3 = candidate.CompanyTo3; candidatedb.Convicted = candidate.Convicted; candidatedb.Date = candidate.Date; candidatedb.DateAvailable = candidate.DateAvailable; candidatedb.Deegre1 = candidate.Deegre1; candidatedb.Deegre2 = candidate.Deegre2; candidatedb.DeegreAddress = candidate.DeegreAddress; candidatedb.DesiredIncome = candidate.DesiredIncome; candidatedb.DidYouGraduated1 = candidate.DidYouGraduated1; candidatedb.DidYouGraduated2 = candidate.DidYouGraduated2; candidatedb.DidYouGraduated3 = candidate.DidYouGraduated3; candidatedb.Diploma = candidate.Diploma; candidatedb.Email = candidate.Email; candidatedb.EndingSalary1 = candidate.EndingSalary1; candidatedb.EndingSalary2 = candidate.EndingSalary2; candidatedb.EndingSalary3 = candidate.EndingSalary3; candidatedb.Explanation = candidate.Explanation; candidatedb.FirstName = candidate.FirstName; candidatedb.HighSchool = candidate.HighSchool; candidatedb.IfYesExplain = candidate.IfYesExplain; candidatedb.IfYesWhen = candidate.IfYesWhen; candidatedb.JobTitle1 = candidate.JobTitle1; candidatedb.JobTitle2 = candidate.JobTitle2; candidatedb.JobTitle3 = candidate.JobTitle3; candidatedb.LastName = candidate.LastName; candidatedb.MiddleName = candidate.MiddleName; candidatedb.MilitaryBranch = candidate.MilitaryBranch; candidatedb.MilitaryFrom = candidate.MilitaryFrom; candidatedb.MilitaryTo = candidate.MilitaryTo; candidatedb.Other = candidate.Other; candidatedb.Phone = candidate.Phone; candidatedb.PositionAppliedFor = candidate.PositionAppliedFor; candidatedb.RankAtDischarge = candidate.RankAtDischarge; candidatedb.ReasonForLeaving1 = candidate.ReasonForLeaving1; candidatedb.ReasonForLeaving2 = candidate.ReasonForLeaving2; candidatedb.ReasonForLeaving3 = candidate.ReasonForLeaving3; candidatedb.RefAddress1 = candidate.RefAddress1; candidatedb.RefAddress2 = candidate.RefAddress2; candidatedb.RefAddress3 = candidate.RefAddress3; candidatedb.RefCompany1 = candidate.RefCompany1; candidatedb.RefCompany2 = candidate.RefCompany2; candidatedb.RefCompany3 = candidate.RefCompany3; candidatedb.RefFullName1 = candidate.RefFullName1; candidatedb.RefFullName2 = candidate.RefFullName2; candidatedb.RefFullName3 = candidate.RefFullName3; candidatedb.RefPhone1 = candidate.RefPhone1; candidatedb.RefPhone2 = candidate.RefPhone2; candidatedb.RefPhone3 = candidate.RefPhone3; candidatedb.RefRelationShip1 = candidate.RefRelationShip1; candidatedb.RefRelationShip2 = candidate.RefRelationShip2; candidatedb.RefRelationShip3 = candidate.RefRelationShip3; candidatedb.Responsibilities1 = candidate.Responsibilities1; candidatedb.Responsibilities2 = candidate.Responsibilities2; candidatedb.Responsibilities3 = candidate.Responsibilities3; candidatedb.ResumeDetails = candidate.ResumeDetails; candidatedb.SchoolAddress = candidate.SchoolAddress; candidatedb.SchoolFrom1 = candidate.SchoolFrom1; candidatedb.SchoolFrom2 = candidate.SchoolFrom2; candidatedb.SchoolFrom3 = candidate.SchoolFrom3; candidatedb.SchoolTo1 = candidate.SchoolTo1; candidatedb.SchoolTo2 = candidate.SchoolTo2; candidatedb.SchoolTo3 = candidate.SchoolTo3; candidatedb.SignatureName = candidate.SignatureName; candidatedb.SocialSecurityNo = candidate.SocialSecurityNo; candidatedb.StartingSalary1 = candidate.StartingSalary1; candidatedb.StartingSalary2 = candidate.StartingSalary2; candidatedb.StartingSalary3 = candidate.StartingSalary3; candidatedb.State = candidate.State; candidatedb.StreetAddress = candidate.StreetAddress; candidatedb.TypeOFDischarge = candidate.TypeOFDischarge; candidatedb.UsCitiZen = candidate.UsCitiZen; candidatedb.WorkedHere = candidate.WorkedHere; candidatedb.ZipCode = candidate.ZipCode; uow.CandidateRepository.Insert(candidatedb); uow.Save(); isAdded = true; } catch { isAdded = false; } } return(isAdded); }
public void BindCandidateDetails() { int candidateID = Convert.ToInt32(Request.QueryString["candidateid"]); CandidateEntity candidate = candidateHelper.GetCandidateByID(candidateID); txtApartmentUnitNo.Text = candidate.Apartment; txtStreetAddress.Text = candidate.Address; txtFirstName.Text = candidate.FirstName; lblAuthorizedForWork.Text = candidate.AuthorizedForWork == true ? "Yes" : "No"; txtLastName.Text = candidate.LastName; lblContactSV1.Text = candidate.CanContactSV1 == true ? "Yes" : "No"; lblContactSV2.Text = candidate.CanContactSV2 == true ? "Yes" : "No"; lblContactSV3.Text = candidate.CanContactSV3 == true ? "Yes" : "No"; txtCity.Text = candidate.City; txtCollege1.Text = candidate.College; txtCompanyAddress1.Text = candidate.CompanyAddress1; txtCompanyAddress2.Text = candidate.CompanyAddress2; txtCompanyAddress3.Text = candidate.CompanyAddress3; txtCompanyFrom1.Text = candidate.CompanyFrom1; txtCompanyFrom2.Text = candidate.CompanyFrom2; txtCompanyFrom3.Text = candidate.CompanyFrom3; txtCompanyName1.Text = candidate.CompanyName1; txtCompanyName2.Text = candidate.CompanyName2; txtCompanyName3.Text = candidate.CompanyName3; txtCompanyPhone1.Text = candidate.CompanyPhone1; txtCompanyPhone2.Text = candidate.CompanyPhone2; txtCompanyPhone3.Text = candidate.CompanyPhone3; txtCompanySupervisor1.Text = candidate.CompanySupervisor1; txtCompanySupervisor2.Text = candidate.CompanySupervisor2; txtSupervisor3.Text = candidate.CompanySupervisor3; txtCompanyTo1.Text = candidate.CompanyTo1; txtCompanyTo2.Text = candidate.CompanyTo2; txtCompanyTo3.Text = candidate.CompanyTo3; lblHaveConvictedForFelony.Text = candidate.Convicted == true ? "Yes" : "No"; txtDateAvailable.Text = candidate.DateAvailable; txtDeegre.Text = candidate.Deegre1; txtDeegre2.Text = candidate.Deegre2; txtDeegreAddress.Text = candidate.DeegreAddress; txtDesiredIncome.Text = candidate.DesiredIncome; lblGraduated1.Text = candidate.DidYouGraduated1 == true ? "Yes" : "No"; lblGraduated2.Text = candidate.DidYouGraduated2 == true ? "Yes" : "No"; lblGraduated3.Text = candidate.DidYouGraduated3 == true ? "Yes" : "No"; txtDiploma1.Text = candidate.Diploma; txtEmail.Text = candidate.Email; txtEndingSalary.Text = candidate.EndingSalary1; txtEndingSalary2.Text = candidate.EndingSalary2; txtEndingSalary3.Text = candidate.EndingSalary3; txtMilitaryExplain.Text = candidate.Explanation; txtHighSchool.Text = candidate.HighSchool; txtExplainFelony.Text = candidate.IfYesExplain; txtWorkedForCompany.Text = candidate.IfYesWhen; txtJobTitle.Text = candidate.JobTitle1; txtJobTitle2.Text = candidate.JobTitle2; txtJobTitle3.Text = candidate.JobTitle3; txtMiddleName.Text = candidate.MiddleName; txtBranch.Text = candidate.MilitaryBranch; txtMilitaryFrom.Text = candidate.MilitaryFrom; txtMilitaryTo.Text = candidate.MilitaryTo; txtOther.Text = candidate.Other; txtPhone.Text = candidate.Phone; txtPositionAppliedFor.Text = candidate.PositionAppliedFor; txtRankAtDischarge.Text = candidate.RankAtDischarge; txtReasonForLeaving1.Text = candidate.ReasonForLeaving1; txtReasonForLeaving2.Text = candidate.ReasonForLeaving2; txtReasonForLeaving3.Text = candidate.ReasonForLeaving3; txtReferenceAddress.Text = candidate.RefAddress1; txtReferenceAddress2.Text = candidate.RefAddress2; txtReferenceAddress3.Text = candidate.RefAddress3; txtReferenceCompanyName.Text = candidate.RefCompany1; txtReferenceCompanyName2.Text = candidate.RefCompany2; txtReferenceCompanyName3.Text = candidate.RefCompany3; txtFullReferenceName.Text = candidate.RefFullName1; txtFullReferenceName2.Text = candidate.RefFullName2; txtFullReferenceName3.Text = candidate.RefFullName3; txtReferencePhoneNo.Text = candidate.RefPhone1; txtReferencePhoneNo2.Text = candidate.RefPhone2; txtReferencePhoneNo3.Text = candidate.RefPhone3; txtRelationship.Text = candidate.RefRelationShip1; txtRelationship2.Text = candidate.RefRelationShip2; txtRelationship3.Text = candidate.RefRelationShip3; txtResponsibility.Text = candidate.Responsibilities1; txtResponsibility2.Text = candidate.Responsibilities2; txtResponsibilities3.Text = candidate.Responsibilities3; lblDownloadResume.Text = candidate.ResumeDetails; txtHighSchoolAddress.Text = candidate.SchoolAddress; txtFrom1.Text = candidate.SchoolFrom1; txtFrom2.Text = candidate.SchoolFrom2; txtFrom3.Text = candidate.SchoolFrom3; txtTo1.Text = candidate.SchoolTo1; txtTo2.Text = candidate.SchoolTo2; txtTo3.Text = candidate.SchoolTo3; txtSSN.Text = candidate.SocialSecurityNo; txtStartingSalary.Text = candidate.StartingSalary1; txtStartingSalary2.Text = candidate.StartingSalary2; txtStartingSalary3.Text = candidate.StartingSalary3; txtState.Text = candidate.State; txtStreetAddress.Text = candidate.StreetAddress; txtTypeOfDischarge.Text = candidate.TypeOFDischarge; lblCitizenUS.Text = candidate.UsCitiZen == true ? "Yes" : "No"; lblHaveYourWorked.Text = candidate.WorkedHere == true ? "Yes" : "No"; txtZipCode.Text = candidate.ZipCode; }
protected void btnAddHiring_Click(object sender, EventArgs e) { if (!String.IsNullOrEmpty(flResume.FileName)) { string resume = DateTime.Now.Ticks.ToString() + flResume.FileName; flResume.SaveAs(Server.MapPath("~/Resumes/" + resume)); CandidateEntity candidatedb = new CandidateEntity(); candidatedb.Address = txtCollegeAddress1.Text; candidatedb.Apartment = txtApartmentUnitNo.Text; candidatedb.FirstName = txtFirstName.Text; if (radioAuthorizedForWork.SelectedItem != null) { candidatedb.AuthorizedForWork = Convert.ToBoolean(radioAuthorizedForWork.SelectedItem.Value == "1" ? true : false); } else { candidatedb.AuthorizedForWork = false; } candidatedb.LastName = txtLastName.Text; if (radioContactToCompany1.SelectedItem != null) { candidatedb.CanContactSV1 = Convert.ToBoolean(radioContactToCompany1.SelectedItem.Value == "1" ? true : false); } else { candidatedb.CanContactSV1 = false; } if (radioContactToCompany2.SelectedItem != null) { candidatedb.CanContactSV2 = Convert.ToBoolean(radioContactToCompany2.SelectedItem.Value == "1" ? true : false); } else { candidatedb.CanContactSV2 = false; } if (radioContactToCompany3.SelectedItem != null) { candidatedb.CanContactSV3 = Convert.ToBoolean(radioContactToCompany3.SelectedItem.Value == "1" ? true : false); } else { candidatedb.CanContactSV3 = false; } candidatedb.City = txtCity.Text; candidatedb.College = txtCollege1.Text; candidatedb.CompanyAddress1 = txtCompanyAddress1.Text; candidatedb.CompanyAddress2 = txtCompanyAddress2.Text; candidatedb.CompanyAddress3 = txtCompanyAddress3.Text; candidatedb.CompanyFrom1 = txtCompanyFrom1.Text; candidatedb.CompanyFrom2 = txtCompanyFrom2.Text; candidatedb.CompanyFrom3 = txtCompanyFrom3.Text; candidatedb.CompanyName1 = txtCompanyName1.Text; candidatedb.CompanyName2 = txtCompanyName2.Text; candidatedb.CompanyName3 = txtCompanyName3.Text; candidatedb.CompanyPhone1 = txtCompanyPhone1.Text; candidatedb.CompanyPhone2 = txtCompanyPhone2.Text; candidatedb.CompanyPhone3 = txtCompanyPhone3.Text; candidatedb.CompanySupervisor1 = txtCompanySupervisor1.Text; candidatedb.CompanySupervisor2 = txtCompanySupervisor2.Text; candidatedb.CompanySupervisor3 = txtSupervisor3.Text; candidatedb.CompanyTo1 = txtCompanyTo1.Text; candidatedb.CompanyTo2 = txtCompanyTo2.Text; candidatedb.CompanyTo3 = txtCompanyTo3.Text; if (radioFelony.SelectedItem != null) { candidatedb.Convicted = Convert.ToBoolean(radioFelony.SelectedItem.Value == "1" ? true : false); } else { candidatedb.Convicted = false; } candidatedb.Date = DateTime.Now.ToShortDateString(); candidatedb.DateAvailable = txtDateAvailable.Text; candidatedb.Deegre1 = txtDeegre.Text; candidatedb.Deegre2 = txtDeegre2.Text; candidatedb.DeegreAddress = txtDeegreAddress.Text; candidatedb.DesiredIncome = txtDesiredIncome.Text; if (radioGraduated1.SelectedItem != null) { candidatedb.DidYouGraduated1 = Convert.ToBoolean(radioGraduated1.SelectedItem.Value == "1" ? true : false); } else { candidatedb.DidYouGraduated1 = false; } if (radioGraduated2.SelectedItem != null) { candidatedb.DidYouGraduated2 = Convert.ToBoolean(radioGraduated2.SelectedItem.Value == "1" ? true : false); } else { candidatedb.DidYouGraduated2 = false; } if (radioGraduated3.SelectedItem != null) { candidatedb.DidYouGraduated3 = Convert.ToBoolean(radioGraduated3.SelectedItem.Value == "1" ? true : false); } else { candidatedb.DidYouGraduated3 = false; } candidatedb.Diploma = txtDiploma1.Text; candidatedb.Email = txtEmail.Text; candidatedb.EndingSalary1 = txtEndingSalary.Text; candidatedb.EndingSalary2 = txtEndingSalary2.Text; candidatedb.EndingSalary3 = txtEndingSalary3.Text; candidatedb.Explanation = txtExplainFelony.Text; candidatedb.FirstName = txtFirstName.Text; candidatedb.HighSchool = txtHighSchool.Text; candidatedb.IfYesExplain = txtExplainFelony.Text; candidatedb.IfYesWhen = txtWorkedForCompany.Text; candidatedb.JobTitle1 = txtJobTitle.Text; candidatedb.JobTitle2 = txtJobTitle2.Text; candidatedb.JobTitle3 = txtJobTitle3.Text; candidatedb.LastName = txtLastName.Text; candidatedb.MiddleName = txtMiddleName.Text; candidatedb.MilitaryBranch = txtBranch.Text; candidatedb.MilitaryFrom = txtMilitaryFrom.Text; candidatedb.MilitaryTo = txtMilitaryTo.Text; candidatedb.Other = txtOther.Text; candidatedb.Phone = txtPhone.Text; candidatedb.PositionAppliedFor = ddlPositions.SelectedItem.Text; candidatedb.RankAtDischarge = txtRankAtDischarge.Text; candidatedb.ReasonForLeaving1 = txtReasonForLeaving1.Text; candidatedb.ReasonForLeaving2 = txtReasonForLeaving2.Text; candidatedb.ReasonForLeaving3 = txtReasonForLeaving3.Text; candidatedb.RefAddress1 = txtReferenceAddress.Text; candidatedb.RefAddress2 = txtReferenceAddress2.Text; candidatedb.RefAddress3 = txtReferenceAddress3.Text; candidatedb.RefCompany1 = txtReferenceCompanyName.Text; candidatedb.RefCompany2 = txtReferenceCompanyName2.Text; candidatedb.RefCompany3 = txtReferenceCompanyName3.Text; candidatedb.RefFullName1 = txtFullReferenceName.Text; candidatedb.RefFullName2 = txtFullReferenceName2.Text; candidatedb.RefFullName3 = txtFullReferenceName3.Text; candidatedb.RefPhone1 = txtReferencePhoneNo.Text; candidatedb.RefPhone2 = txtReferencePhoneNo2.Text; candidatedb.RefPhone3 = txtReferencePhoneNo3.Text; candidatedb.RefRelationShip1 = txtRelationship.Text; candidatedb.RefRelationShip2 = txtRelationship2.Text; candidatedb.RefRelationShip3 = txtRelationship3.Text; candidatedb.Responsibilities1 = txtResponsibility.Text; candidatedb.Responsibilities2 = txtResponsibility2.Text; candidatedb.Responsibilities3 = txtResponsibilities3.Text; candidatedb.ResumeDetails = resume; candidatedb.SchoolAddress = txtHighSchoolAddress.Text; candidatedb.SchoolFrom1 = txtFrom1.Text; candidatedb.SchoolFrom2 = txtFrom2.Text; candidatedb.SchoolFrom3 = txtFrom3.Text; candidatedb.SchoolTo1 = txtTo1.Text; candidatedb.SchoolTo2 = txtTo2.Text; candidatedb.SchoolTo3 = txtTo3.Text; candidatedb.SignatureName = txtSignatureName.Text; candidatedb.SocialSecurityNo = txtSSN.Text; candidatedb.StartingSalary1 = txtStartingSalary.Text; candidatedb.StartingSalary2 = txtStartingSalary2.Text; candidatedb.StartingSalary3 = txtStartingSalary3.Text; candidatedb.State = txtState.Text; candidatedb.StreetAddress = txtStreetAddress.Text; candidatedb.TypeOFDischarge = txtTypeOfDischarge.Text; if (radioUSCitizen.SelectedItem != null) { candidatedb.UsCitiZen = Convert.ToBoolean(radioUSCitizen.SelectedItem.Value == "1" ? true : false); } else { candidatedb.UsCitiZen = false; } if (radioWorkedForThisCompany.SelectedItem != null) { candidatedb.WorkedHere = Convert.ToBoolean(radioWorkedForThisCompany.SelectedItem.Value == "1" ? true : false); } else { candidatedb.WorkedHere = false; } candidatedb.ZipCode = txtZipCode.Text; bool isAdded = candidateHelper.AddHiring(candidatedb); if (isAdded) { SendHtmlFormattedEmail("New application submitted", candidatedb, ""); Response.Write("<script>alert('Your request submit successfull.Admin team will contact you shortly.');</script>"); } else { Response.Write("<script>alert('Some error occured.');</script>"); } } else { Response.Write("<script>alert('Please upload your resume.');</script>"); } }
public void UpdateCandidate(CandidateEntity candidate) { _candidateRepository.Update(candidate); }