コード例 #1
0
 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)));
 }
コード例 #2
0
ファイル: HubOwnerController.cs プロジェクト: nathnael/cats
        public ActionResult HubOwnerCreate([DataSourceRequest] DataSourceRequest request, HubOwnerViewModel hubOwner)
        {
            if (hubOwner != null && ModelState.IsValid)
            {
                _hubOwnerService.AddHubOwner(BindHubOwner(hubOwner));
            }

            return(Json(new[] { hubOwner }.ToDataSourceResult(request, ModelState)));
        }
コード例 #3
0
        public virtual ActionResult Create(HubOwner HubOwner)
        {
            if (ModelState.IsValid)
            {
                _hubOwnerService.AddHubOwner(HubOwner);
                return(Json(new { success = true }));
            }

            return(PartialView(HubOwner));
        }