public async Task <IActionResult> Create([Bind("LastName,FirstName,Address,PhoneNumber")] Applicant applicant) { try { if (ModelState.IsValid) { _context.Add(applicant); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } } catch (DbUpdateException) { ModelState.AddModelError("", "Unable to save changes."); } if (ModelState.IsValid) //check for validation and add and save changes { _context.Add(applicant); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(applicant)); }
public async Task <IActionResult> Create([Bind("Name,DateOfBirth,Address,Email,Phone")] Resume resume) { if (ModelState.IsValid) { resume.ResumeId = GetNewId(); resume.Picture = "noPic.jpg"; _context.Add(resume); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(resume)); }
public async Task <IActionResult> Create([Bind("Id,Firstname,Surname,DateOfBirth,Title,Description,Address,Email,PhoneNumber,Location")] Information information) { if (ModelState.IsValid) { _context.Add(information); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(information)); }
public async Task <IActionResult> Create([Bind("ID,FirstName,LastName,DateOfBirth,Address,Contact,Email")] Applicant applicant) { if (ModelState.IsValid) { _context.Add(applicant); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(applicant)); }
public async Task <IActionResult> Create([Bind("ID,FirstName,MiddleName,LastName,Employer,JobTitle,Relationship,PhoneNumber,EmailAddr")] Reference reference) { if (ModelState.IsValid) { _context.Add(reference); await _context.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(reference)); }
public async Task <IActionResult> Create([Bind("ID,firstName,lastName,companyName,mailingAddress,city,state,emailAddress,phone, applicantID")] references references) { if (ModelState.IsValid) { _context.Add(references); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(references)); }
public async Task <IActionResult> Create([Bind("Id,Name,Percent")] Skill skill) { if (ModelState.IsValid) { _context.Add(skill); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View()); }
public async Task <IActionResult> Create([Bind("ID,FirstName,LastName,City,State,Phone,Email,WebAddress,skillsId,educationID,referenceID")] applicant applicant) { if (ModelState.IsValid) { _context.Add(applicant); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(applicant)); }
public async Task <IActionResult> Create([Bind("ID,degreeType,subject,institution,city,state,gradDate,applicantID")] education education) { if (ModelState.IsValid) { _context.Add(education); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(education)); }
public async Task <IActionResult> Create([Bind("ID,skillName,experienceLevel,yearsUsed,applicantID")] skills skills) { if (ModelState.IsValid) { _context.Add(skills); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(skills)); }
public async Task <IActionResult> Create([Bind("Id,Name")] Technology technology) { if (ModelState.IsValid) { _context.Add(technology); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(technology)); }
public async Task <IActionResult> Create([Bind("ID,FirstName,MiddleName,LastName,StreetNumber,Street,City,State,ZipCode,PhoneNumber,EmailAddr,Website")] Contact contact) { if (ModelState.IsValid) { _context.Add(contact); await _context.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(contact)); }
public async Task <IActionResult> Create([Bind("ID,summary,experienceID")] duties duties) { if (ModelState.IsValid) { _context.Add(duties); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(duties)); }
public async Task <IActionResult> Create([Bind("ID,ContactID,InstitutionName,State,City,StartDate,EndDate,Graduation")] Education education) { if (ModelState.IsValid) { _context.Add(education); await _context.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(education)); }
public async Task <IActionResult> Create([Bind("Id,CompanyName,DepartmentName,Title,DateOfStart,DateOfEnd,Description,IsCurrent")] Experience experience) { if (ModelState.IsValid) { _context.Add(experience); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(experience)); }
//I removed Reference ID public async Task <IActionResult> Create([Bind("ApplicantID,FirstName,MiddleInit,LastName,Phone,Email,ReferenceDesc")] Reference reference //,int ApplicantID ) { if (ModelState.IsValid) { // currentApplicant = _context.Applicants.Where(a => a.ID == ApplicantID).FirstOrDefault(); /*reference.ApplicantID = ApplicantID;*/ _context.Add(reference); await _context.SaveChangesAsync(); return(RedirectToAction("Index")); } //THIS IS WHAT adding a controller "gave" me - I changed Address1 to FullName ViewData["ApplicantID"] = new SelectList(_context.Applicants, "ID", "FullName", reference.ApplicantID); //But this is what the tutorial indicates should be here? https://docs.microsoft.com/en-us/aspnet/core/data/ef-mvc/update-related-data#customize-the-create-and-edit-pages-for-courses //PopulateApplicantDropDownList(reference.ApplicantID); return(View(reference)); }
public async Task <IActionResult> Create([Bind("ID,SkillDescrption,Date,InstitutionName,State,City,ZipCode")] ProfessionalSkill professionalSkill) { if (ModelState.IsValid) { _context.Add(professionalSkill); await _context.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(professionalSkill)); }
public async Task <IActionResult> Create([Bind("ReferenceID,LastName,FirstName,PhoneNumber,ApplicantID")] Reference reference) { if (ModelState.IsValid) { _context.Add(reference); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["ApplicantID"] = new SelectList(_context.Applicants, "ApplicantID", "LastName", reference.ApplicantID); return(View(reference)); }
public async Task <IActionResult> Create([Bind("ApplicantID,AffilOrg,Role,Type,From,To,AffilURL,IsCurrent")] Affiliation affiliation) { if (ModelState.IsValid) { _context.Add(affiliation); await _context.SaveChangesAsync(); return(RedirectToAction("Index")); } ViewData["ApplicantID"] = new SelectList(_context.Applicants, "ID", "FullName", affiliation.ApplicantID); return(View(affiliation)); }
public async Task <IActionResult> Create([Bind("ID,FirstName,LastName,CompanyName,Position,Address,Contact,Email,ApplicantID")] Reference reference) { if (ModelState.IsValid) { _context.Add(reference); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["ApplicantID"] = new SelectList(_context.Applicant, "ID", "FirstName", reference.ApplicantID); return(View(reference)); }
public async Task <IActionResult> Create([Bind("Id,SchoolName,FacultyName,DepartmentName,DateOfStart,DateOfEnd,Description,GPA,ImageFile")] Education education) { if (ModelState.IsValid) { education.ImageUrl = UploadImage(education); _context.Add(education); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(education)); }
public async Task <IActionResult> Create([Bind("ID,InstituteUniversity,Title,Degree,FromYear,ToYear,City,Country,ApplicantID")] Education education) { if (ModelState.IsValid) { _context.Add(education); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["ApplicantID"] = new SelectList(_context.Applicant, "ID", "FirstName", education.ApplicantID); return(View(education)); }
public async Task <IActionResult> Create([Bind("ApplicantID,CertName,CertAuthority,LicenseNum,From,To,IsEternal,CertURL")] Certification certification) { if (ModelState.IsValid) { _context.Add(certification); await _context.SaveChangesAsync(); return(RedirectToAction("Index")); } ViewData["ApplicantID"] = new SelectList(_context.Applicants, "ID", "FullName", certification.ApplicantID); return(View(certification)); }
public async Task <IActionResult> Create([Bind("ApplicantID,OrgName,Location,From,To,isCurrent,DegreeAttained,ConcentrationIn")] Education education) { if (ModelState.IsValid) { _context.Add(education); await _context.SaveChangesAsync(); return(RedirectToAction("Index")); } ViewData["ApplicantID"] = new SelectList(_context.Applicants, "ID", "FullName", education.ApplicantID); return(View(education)); }
public async Task <IActionResult> Create([Bind("ID,Company,Position,Address,Contact,FromYear,ToYear,ApplicantID")] Job job) { if (ModelState.IsValid) { _context.Add(job); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["ApplicantID"] = new SelectList(_context.Applicant, "ID", "FirstName", job.ApplicantID); return(View(job)); }
public async Task <IActionResult> Create([Bind("ID,ExperieceDescription,WorkId,JobID")] Workexperience workexperience) { if (ModelState.IsValid) { _context.Add(workexperience); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["JobID"] = new SelectList(_context.Job, "ID", "Company", workexperience.JobID); return(View(workexperience)); }
public async Task <IActionResult> Create([Bind("EducationID,ApplicantID,SchoolName,SchoolAddress,Major,Minor,GPA,GraduationDate")] Education education) { if (ModelState.IsValid) { _context.Add(education); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["ApplicantID"] = new SelectList(_context.Applicants, "ApplicantID", "LastName", education.ApplicantID); return(View(education)); }
public async Task <IActionResult> Create([Bind("DutyID,DutiesPerformed,JobID")] Duty duty) { if (ModelState.IsValid) { _context.Add(duty); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["JobID"] = new SelectList(_context.Jobs, "JobID", "CompanyName", duty.JobID); return(View(duty)); }
public async Task <IActionResult> Create([Bind("Id,Name,DateOfIssue,SchoolName,Description,ImageFile")] Certificate certificate) { if (ModelState.IsValid) { certificate.ImageUrl = UploadImage(certificate); _context.Add(certificate); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(certificate)); }
public async Task <IActionResult> Create([Bind("JobID,Position,CompanyName,CompanyLocation,WorkStartDate,WorkEndDate,ApplicantID")] Job job) { if (ModelState.IsValid) { _context.Add(job); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["ApplicantID"] = new SelectList(_context.Applicants, "ApplicantID", "LastName", job.ApplicantID); return(View(job)); }