public void E_EliminarBusiness() { ListBusinessViewModel a = new ListBusinessViewModel(); a.fill(); int codigo = a.ListBusiness[a.ListBusiness.Count - 1].idBusiness; Business objBusiness = new Business(); objBusiness.idBusiness = codigo; AddEditBusinessViewModel objViewModel = new AddEditBusinessViewModel(); objViewModel.EliminarBusiness(objBusiness.idBusiness); Assert.True(true); }
public ActionResult DeleteBusiness(int businessid) { AddEditBusinessViewModel objViewModel = new AddEditBusinessViewModel(); try { objViewModel.EliminarBusiness(businessid); TempData["Mensaje"] = "El negocio se se eliminó correctamente"; return(RedirectToAction("ListBusiness")); } catch (Exception e) { TempData["MensajeError"] = "Error! " + e.Message.ToList(); return(RedirectToAction("ListBusiness")); } }