public ActionResult Create(FormCollection collection) { try { // TODO: Add insert logic here var model = new RecruitmentCandidate(); TryUpdateModel(model); model.Insert(); return(RedirectToAction("Index")); } catch { return(View()); } }
public ActionResult saveRecruitmentData(List <CandidateWorkExperience> work, List <CandidateTraining> train, List <CandidateEducation> edu, List <CandidateLanguage> lang, List <CandidateSkill> skill, List <CandidateReference> reference, RecruitmentCandidate candidate) { try { if (work != null && work.Count > 0) { foreach (CandidateWorkExperience w in work) { w.Insert(); } } if (train != null && train.Count > 0) { foreach (CandidateTraining t in train) { t.Insert(); } } if (edu != null && edu.Count > 0) { foreach (CandidateEducation e in edu) { e.Insert(); } } if (lang != null && lang.Count > 0) { foreach (CandidateLanguage l in lang) { l.Insert(); } } if (skill != null && skill.Count > 0) { foreach (CandidateSkill s in skill) { s.Insert(); } } if (reference != null && reference.Count > 0) { foreach (CandidateReference r in reference) { r.Insert(); } } candidate.Insert(); } catch (Exception e) { return(new JsonResult() { Data = new ResultModel() { StringResult = e.Message + e.StackTrace, ObjectResult = candidate } }); } return(new JsonResult() { Data = new ResultModel() { JavascriptResult = "window.location.href = '/'" } }); }