public ActionResult ExamModelGridViewPartialUpdate([ModelBinder(typeof(DevExpressEditorsBinder))] Qiyas.BusinessLogicLayer.Entity.PPM.ExamModel item) { if (ModelState.IsValid) { try { if (!ExamModelExists(item.Name, item.ExamModelID)) { BusinessLogicLayer.Entity.PPM.ExamModel entity = new BusinessLogicLayer.Entity.PPM.ExamModel(item.ExamModelID); entity.Name = item.Name; entity.IsActive = item.IsActive; entity.ModifiedDate = DateTime.Now; entity.Save(); } else { ViewData["EditError"] = Resources.MainResource.ExamModelExists; } } catch (Exception e) { ViewData["EditError"] = e.Message; } } else { ViewData["EditError"] = Resources.MainResource.PleaseCorrectErrors; } var model = new BusinessLogicLayer.Components.PPM.ExamModelLogic().GetAll(); return(PartialView("_ExamModelGridViewPartial", model)); }
public Entity.PPM.ExamModel GetByName(string name) { Qiyas.BusinessLogicLayer.Entity.PPM.ExamModel examModel = null; var ex = db.ExamModels.Where(c => c.Name == name).FirstOrDefault(); if (ex != null) { examModel = new Entity.PPM.ExamModel(ex); } return(examModel); }