public int CreateCancellationTerm(CancellationTermViewModel model) { using (camphorizonEntities db = new camphorizonEntities()) { db.CancellationTerms.Add(new CancellationTerm() { CancellationTerm1 = model.CancellationTerm }); return(db.SaveChanges()); } }
public ActionResult Create(CancellationTermViewModel model) { _commonHelper = new CommonHelper(); if (_commonHelper.CreateCancellationTerm(model) > 0) { Success("The cancellation term added successfully.", true); return(RedirectToAction("Index")); } else { Danger("The cancellation term was not able to add. Please try again", false); return(View(model)); } _commonHelper = null; }