Exemplo n.º 1
0
 public bool DeleteHub(Hub hub)
 {
     if (hub == null) return false;
     _unitOfWork.HubRepository.Delete(hub);
     _unitOfWork.Save();
     return true;
 }
Exemplo n.º 2
0
 public static HubViewModel BindHubViewModel(Cats.Models.Hub hub)
 {
     return(new HubViewModel()
     {
         HubID = hub.HubID,
         HubName = hub.Name,
         HubOwnerID = hub.HubOwnerID
     });
 }
Exemplo n.º 3
0
 public static HubViewModel BindHubViewModel(Hub hub)
 {
     return new HubViewModel()
     {
         HubID = hub.HubID,
         HubName = hub.Name,
         HubOwnerID = hub.HubOwnerID
     };
 }
Exemplo n.º 4
0
        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));
        }
Exemplo n.º 5
0
 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));
 }
Exemplo n.º 6
0
 public bool EditHub(Hub hub)
 {
     _unitOfWork.HubRepository.Edit(hub);
     _unitOfWork.Save();
     return true;
 }
Exemplo n.º 7
0
 public bool AddHub(Hub hub)
 {
     _unitOfWork.HubRepository.Add(hub);
     _unitOfWork.Save();
     return true;
 }