public bool DeleteHubOwner(HubOwner hubOwner)
 {
     if (hubOwner == null) return false;
     _unitOfWork.HubOwnerRepository.Delete(hubOwner);
     _unitOfWork.Save();
     return true;
 }
Пример #2
0
        //
        // GET: /HubOwners/Delete/5

        public virtual ActionResult Delete(int id)
        {
            HubOwner HubOwner = _hubOwnerService.FindById(id);

            _hubOwnerService.DeleteHubOwner(HubOwner);
            return(RedirectToAction("Index"));
        }
Пример #3
0
 public virtual ActionResult Edit(HubOwner HubOwner)
 {
     if (ModelState.IsValid)
     {
         _hubOwnerService.EditHubOwner(HubOwner);
         return(Json(new { success = true }));
     }
     return(PartialView(HubOwner));
 }
Пример #4
0
 public bool DeleteHubOwner(HubOwner hubOwner)
 {
     if (hubOwner == null)
     {
         return(false);
     }
     _unitOfWork.HubOwnerRepository.Delete(hubOwner);
     _unitOfWork.Save();
     return(true);
 }
Пример #5
0
        public void CanDoEditPostBack()
        {
            //ACT
            var hubOwner = new HubOwner {
                LongName = "Belay Zeleke", Name = "Beze"
            };
            var redirectToRouteResult = _hubOwnerController.Create(hubOwner) as RedirectToRouteResult;

            //Assert
            Assert.NotNull(redirectToRouteResult);
            Assert.AreEqual("Index", redirectToRouteResult.RouteValues["Action"]);
            Assert.AreEqual("HubOwner", redirectToRouteResult.RouteValues["controller"]);
        }
Пример #6
0
        private HubOwner BindHubOwner(HubOwnerViewModel hubOwnerViewModel)
        {
            if (hubOwnerViewModel == null)
            {
                return(null);
            }
            var hubOwner = new HubOwner()
            {
                Name       = hubOwnerViewModel.Name,
                LongName   = hubOwnerViewModel.LongName,
                HubOwnerID = hubOwnerViewModel.HubOwnerID,
            };

            return(hubOwner);
        }
 public bool EditHubOwner(HubOwner hubOwner)
 {
     _unitOfWork.HubOwnerRepository.Edit(hubOwner);
     _unitOfWork.Save();
     return true;
 }
 public bool AddHubOwner(HubOwner hubOwner)
 {
     _unitOfWork.HubOwnerRepository.Add(hubOwner);
     _unitOfWork.Save();
     return true;
 }
Пример #9
0
        //
        // GET: /HubOwners/Delete/5

        public virtual ActionResult Delete(int id)
        {
            HubOwner HubOwner = _hubOwnerService.FindById(id);

            return(View(HubOwner));
        }
Пример #10
0
        //
        // GET: /HubOwners/Edit/5

        public virtual ActionResult Edit(int id)
        {
            HubOwner HubOwner = _hubOwnerService.FindById(id);

            return(PartialView(HubOwner));
        }
Пример #11
0
        //
        // GET: /HubOwners/Details/5

        public virtual ViewResult Details(int id)
        {
            HubOwner HubOwner = _hubOwnerService.FindById(id);

            return(View(HubOwner));
        }
Пример #12
0
 public bool EditHubOwner(HubOwner hubOwner)
 {
     _unitOfWork.HubOwnerRepository.Edit(hubOwner);
     _unitOfWork.Save();
     return(true);
 }
Пример #13
0
 public bool AddHubOwner(HubOwner hubOwner)
 {
     _unitOfWork.HubOwnerRepository.Add(hubOwner);
     _unitOfWork.Save();
     return(true);
 }