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

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

            _hubOwnerService.DeleteHubOwner(HubOwner);
            return(RedirectToAction("Index"));
        }
Exemple #3
0
 public virtual ActionResult Edit(HubOwner HubOwner)
 {
     if (ModelState.IsValid)
     {
         _hubOwnerService.EditHubOwner(HubOwner);
         return(Json(new { success = true }));
     }
     return(PartialView(HubOwner));
 }
Exemple #4
0
 public bool DeleteHubOwner(HubOwner hubOwner)
 {
     if (hubOwner == null)
     {
         return(false);
     }
     _unitOfWork.HubOwnerRepository.Delete(hubOwner);
     _unitOfWork.Save();
     return(true);
 }
Exemple #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"]);
        }
Exemple #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;
 }
Exemple #9
0
        //
        // GET: /HubOwners/Delete/5

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

            return(View(HubOwner));
        }
Exemple #10
0
        //
        // GET: /HubOwners/Edit/5

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

            return(PartialView(HubOwner));
        }
Exemple #11
0
        //
        // GET: /HubOwners/Details/5

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

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