public ActionResult CreateJson([DataSourceRequest] DataSourceRequest request, HubOwnerViewModel viewModel) { if (viewModel != null && ModelState.IsValid) { Cats.Models.Hubs.HubOwner original = new Cats.Models.Hubs.HubOwner { Name = viewModel.Name, LongName = viewModel.LongName }; _hubOwnerService.AddHubOwner(original); } return(Json(new[] { viewModel }.ToDataSourceResult(request, ModelState))); }
public ActionResult HubOwnerCreate([DataSourceRequest] DataSourceRequest request, HubOwnerViewModel hubOwner) { if (hubOwner != null && ModelState.IsValid) { _hubOwnerService.AddHubOwner(BindHubOwner(hubOwner)); } return(Json(new[] { hubOwner }.ToDataSourceResult(request, ModelState))); }
public virtual ActionResult Create(HubOwner HubOwner) { if (ModelState.IsValid) { _hubOwnerService.AddHubOwner(HubOwner); return(Json(new { success = true })); } return(PartialView(HubOwner)); }