public ActionResult Edit(Donor donor) { if (ModelState.IsValid && _donorService.IsCodeValid(donor.DonorCode, donor.DonorID)) { _donorService.EditDonor(donor); return(Json(new { success = true })); } return(PartialView(donor)); }
public ActionResult Donor_Update([DataSourceRequest] DataSourceRequest request, DonorModel model) { if (model != null && ModelState.IsValid) { var origin = _donorService.FindById(model.DonorID); origin.DonorCode = model.DonorCode; origin.Name = model.Name; origin.IsResponsibleDonor = model.IsResponsibleDonor; origin.IsSourceDonor = model.IsSourceDonor; origin.LongName = model.LongName; _donorService.EditDonor(origin); } return(Json(new[] { model }.ToDataSourceResult(request, ModelState))); }