Exemple #1
0
 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));
 }
Exemple #2
0
 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)));
 }