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