예제 #1
0
        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));
        }
예제 #2
0
        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));
        }
예제 #3
0
        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));
        }
예제 #4
0
        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));
        }
예제 #7
0
        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));
        }
예제 #9
0
        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));
        }
예제 #10
0
        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));
        }
예제 #11
0
        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));
        }
예제 #12
0
        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));
        }
예제 #13
0
        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));
        }
예제 #14
0
        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));
        }
예제 #15
0
        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));
        }
예제 #16
0
        //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));
        }
예제 #18
0
        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));
        }
예제 #21
0
        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));
        }
예제 #22
0
        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));
        }
예제 #23
0
        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));
        }
예제 #24
0
        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));
        }
예제 #29
0
        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));
        }
예제 #30
0
        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));
        }