public bool DeleteHub(Hub hub) { if (hub == null) return false; _unitOfWork.HubRepository.Delete(hub); _unitOfWork.Save(); return true; }
public static HubViewModel BindHubViewModel(Cats.Models.Hub hub) { return(new HubViewModel() { HubID = hub.HubID, HubName = hub.Name, HubOwnerID = hub.HubOwnerID }); }
public static HubViewModel BindHubViewModel(Hub hub) { return new HubViewModel() { HubID = hub.HubID, HubName = hub.Name, HubOwnerID = hub.HubOwnerID }; }
public ActionResult Hub_Update([DataSourceRequest] DataSourceRequest request, Hub hub) { if (hub != null && ModelState.IsValid) { var target = _hubService.FindById(hub.HubID); _hubService.EditHub(target); } return Json(new[] { hub }.ToDataSourceResult(request, ModelState)); }
public ActionResult Hub_Create([DataSourceRequest] DataSourceRequest request, HubViewModel hubViewModel) { var hub = new Hub(); if (hubViewModel != null && ModelState.IsValid) { hub = HubViewModelBinder.BindHub(hubViewModel); _hubService.AddHub(hub); } return Json(new[] { hub }.ToDataSourceResult(request, ModelState)); }
public bool EditHub(Hub hub) { _unitOfWork.HubRepository.Edit(hub); _unitOfWork.Save(); return true; }
public bool AddHub(Hub hub) { _unitOfWork.HubRepository.Add(hub); _unitOfWork.Save(); return true; }