Exemple #1
0
        public ActionResult AddJobTitle(Jobtitles jobs, string returnUrl)
        {
            if (ModelState.IsValid)
            {
                Jobtitles job = jobs;
                job.createdby    = null;
                job.modifieddate = DateTime.Now;
                JobRepo.addJobTitles(job);
                TempData["Success"] = string.Format($"{job.jobtitlename} has been created");
                ModelState.Clear();
                return(Redirect(returnUrl));
            }

            TempData["Error"] = "Something went wrong. please make sure you fill all the appropriate details";
            return(PartialView(jobs));
        }
 public void addJobTitles(Jobtitles jobs)
 {
     unitOfWork.jobTitles.Insert(jobs);
     unitOfWork.Save();
 }