public ActionResult GridViewPartialUpdate([ModelBinder(typeof(DevExpressEditorsBinder))] Qiyas.BusinessLogicLayer.Entity.PPM.ExamSpeciality item) { if (ModelState.IsValid) { try { if (!ExamSpecialityExists(item.Name, item.ExamTypeID.Value, item.ExamSpecialityID)) { BusinessLogicLayer.Entity.PPM.ExamSpeciality speciality = new BusinessLogicLayer.Entity.PPM.ExamSpeciality(item.ExamSpecialityID); speciality.ExamTypeID = item.ExamTypeID; speciality.Name = item.Name; speciality.IsActive = item.IsActive; speciality.ModifiedDate = DateTime.Now; speciality.Save(); } else { ViewData["EditError"] = Resources.MainResource.ExamSpecialityExists; } } catch (Exception e) { ViewData["EditError"] = e.Message; } } else { ViewData["EditError"] = Resources.MainResource.PleaseCorrectErrors; } var model = new BusinessLogicLayer.Components.PPM.ExamSpecialityLogic().GetAll(); return(PartialView("_GridViewPartial", model)); }
public Qiyas.BusinessLogicLayer.Entity.PPM.ExamSpeciality GetByNameandType(string name, int TypeID) { Qiyas.BusinessLogicLayer.Entity.PPM.ExamSpeciality examType = null; var ex = db.ExamSpecialities.Where(c => c.Name == name && c.ExamTypeID == TypeID).FirstOrDefault(); if (ex != null) { examType = new Entity.PPM.ExamSpeciality(ex); } return(examType); }