Esempio n. 1
0
        public ActionResult Add(JobTitle newJobTitle)
        {
            if (!ModelState.IsValid)
                return View(newJobTitle);

            _repository.Add(newJobTitle);
            return RedirectToAction("Index");
        }
Esempio n. 2
0
        public ActionResult Edit(JobTitle title)
        {
            if (!ModelState.IsValid)
                return View(title);

            _repository.Update(title);
            return RedirectToAction("Index");
        }
Esempio n. 3
0
        public void SetUp()
        {
            _dbcontext = new OrgChartDbContext();
            _jobTitle = new JobTitle
            {
                Description = "test",
            };

            _dbcontext.JobTitles.Add(_jobTitle);
            _dbcontext.SaveChanges();
        }