예제 #1
0
        public ActionResult Create([Bind(Include = "LanguageCode,EnglishName,NativeLanguage")] Language language)
        {
            if (ModelState.IsValid)
            {
                db.Languages.Add(language);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(language));
        }
        public ActionResult Create([Bind(Include = "JobSkillId,JobSkillName,SkillType,SkillCategory")] JobSkill jobSkill)
        {
            if (ModelState.IsValid)
            {
                jobSkill.JobSkillId = Guid.NewGuid();
                db.JobSkill.Add(jobSkill);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(jobSkill));
        }
예제 #3
0
        public ActionResult Create([Bind(Include = "BusinessId,BusinessName,BusinessIndustry,ShortBusinessDescription,LongBusinessDescription,State,City,StreetAddress,EmailAddress,PhoneNumber,Image")] BusinessProfile businessProfile)
        {
            if (ModelState.IsValid)
            {
                db.BusinessProfiles.Add(businessProfile);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.IndustryId = new SelectList(db.Industries, "IndustryId", "IndustryName");
            return(View(businessProfile));
        }
        public ActionResult Create([Bind(Include = "EthnicityId,EthnicityName")] Ethnicity ethnicity)
        {
            if (ModelState.IsValid)
            {
                ethnicity.EthnicityId = Guid.NewGuid();
                db.Ethnicities.Add(ethnicity);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(ethnicity));
        }
        public ActionResult Create([Bind(Include = "ResumeId,FirstName,LastName,PhoneNumber,Email")] Resume resume)
        {
            if (ModelState.IsValid)
            {
                resume.ResumeId = Guid.NewGuid();
                db.Resumes.Add(resume);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(resume));
        }
예제 #6
0
        public ActionResult Create([Bind(Include = "WorkExperienceId,ResumeId,BusinessName,StartDate,EndDate,JobTitle,Description")] WorkExperience workExperience)
        {
            if (ModelState.IsValid)
            {
                workExperience.WorkExperienceId = Guid.NewGuid();
                db.WorkExperiences.Add(workExperience);
                db.SaveChanges();
                return(RedirectToAction("Edit", "Resume", new { id = workExperience.ResumeId }));
            }

            return(View(workExperience));
        }
예제 #7
0
 public ActionResult Edit(Guid resumeId, IEnumerable <JobSkillInfo> skills)
 {
     if (ModelState.IsValid)
     {
         // Remove rows from ResumeSkill
         // Add rows to ResumeSkill
         foreach (var item in skills.Where(s => s.Checked))
         {
             db.ResumeSkills.AddOrUpdate(new ResumeSkill
             {
                 ResumeId        = resumeId,
                 SkillCategoryId = item.JobSkillId
             });
         }
         // Save changes
         db.SaveChanges();
         return(RedirectToAction("Edit", "Resume", new { id = resumeId }));
     }
     ViewBag.ResumeId = resumeId;
     return(View(skills.ToList()));
 }