public ActionResult Create(SetOfBookModel model) { if (ModelState.IsValid) { SetOfBook duplicateRecord = service.GetSetOfBook(AuthenticationHelper.User.CompanyId, model.Name); if (duplicateRecord == null) { string result = service.Insert(MapModel(model)); return(RedirectToAction("Index")); } else { ModelState.AddModelError("Error", "Set of Book Already exists."); } } return(View(model)); }
public static string Insert(SetOfBookModel model) { return(service.Insert(getEntityByModel(model))); }