Example #1
0
        public void Delete(int id)
        {
            CaseModeModel model = this._context.CaseMode.Where(x => x.Id == id).FirstOrDefault();

            this._context.CaseMode.Remove(model);
            this._context.SaveChanges();
        }
        public IActionResult Create(CaseModeModel model)
        {
            if (!ModelState.IsValid)
            {
                return(View());
            }
            this._caseModeRepository.Save(model);

            return(RedirectToAction("Index"));
        }
        public IActionResult Update(CaseModeModel model)
        {
            var id = model.Id;

            if (!ModelState.IsValid)
            {
                return(View(model));
            }
            this._caseModeRepository.Update(model);
            return(RedirectToAction("Index"));
        }
Example #4
0
 public void Update(CaseModeModel model)
 {
     this._context.CaseMode.Update(model);
     this._context.SaveChanges();
 }
Example #5
0
 public void Save(CaseModeModel model)
 {
     this._context.CaseMode.Add(model);
     this._context.SaveChanges();
 }