Beispiel #1
0
 public ActionResult UpdateJson([DataSourceRequest] DataSourceRequest request, HubOwnerViewModel viewModel)
 {
     if (viewModel != null && ModelState.IsValid)
     {
         var original = _hubOwnerService.FindById(viewModel.HubOwnerID);
         original.Name     = viewModel.Name;
         original.LongName = viewModel.LongName;
         _hubOwnerService.EditHubOwner(original);
     }
     return(Json(new[] { viewModel }.ToDataSourceResult(request, ModelState)));
 }
Beispiel #2
0
 public virtual ActionResult Edit(HubOwner HubOwner)
 {
     if (ModelState.IsValid)
     {
         _hubOwnerService.EditHubOwner(HubOwner);
         return(Json(new { success = true }));
     }
     return(PartialView(HubOwner));
 }
Beispiel #3
0
 public ActionResult HubOwnerUpdate([DataSourceRequest] DataSourceRequest request, HubOwnerViewModel hubOwner)
 {
     if (hubOwner != null && ModelState.IsValid)
     {
         var result = _hubOwnerService.FindById(hubOwner.HubOwnerID);
         if (result != null)
         {
             result.Name     = hubOwner.Name;
             result.LongName = hubOwner.LongName;
             _hubOwnerService.EditHubOwner(result);
         }
     }
     return(Json(new[] { hubOwner }.ToDataSourceResult(request, ModelState)));
 }