public ActionResult PatientsGridViewPartialUpdate([ModelBinder(typeof(DevExpressEditorsBinder))] Models.Patients item, [ModelBinder(typeof(DevExpressEditorsBinder))] Models.BatchNumbers batchNumbers) { if (ModelState.IsValid) { try { // Insert here a code to update the item in your model } catch (Exception e) { ViewData["EditError"] = e.Message; } } else { ViewData["EditError"] = "Please, correct all errors."; } var model = unitOfWork.PatientsRepo.Get(x => x.BatchId == batchNumbers.Id); ViewBag.batchNumbers = batchNumbers; return(PartialView("_PatientsGridViewPartial", model)); }
public PartialViewResult SearchPatientGridViewPartial([ModelBinder(typeof(DevExpressEditorsBinder))] Models.Patients patients, [ModelBinder(typeof(DevExpressEditorsBinder))] bool isSearch = false) { ViewBag.patients = patients; var firstName = patients.FirstName ?? ""; var middleName = patients.MiddleName ?? ""; var model = unitOfWork.PatientsRepo.Get(x => x.LastName.Contains(patients.LastName) && x.FirstName.Contains(firstName) && x.MiddleName.Contains(middleName)); ViewBag.counter = model.Count(); ViewBag.isSearch = isSearch; return(PartialView("_SearchPatientGridViewPartial", model)); }
public ActionResult SearchPatientGridViewPartialUpdate([ModelBinder(typeof(DevExpressEditorsBinder))] Models.Patients item) { var model = new object[0]; if (ModelState.IsValid) { try { // Insert here a code to update the item in your model } catch (Exception e) { ViewData["EditError"] = e.Message; } } else { ViewData["EditError"] = "Please, correct all errors."; } return(PartialView("_SearchPatientGridViewPartial", model)); }