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