// GET: Principal public ActionResult Index() { ViewBag.Title = "Mascotas"; ViewBag.Opcion = "Registradas"; List <Mascota> mascota = new List <Mascota>(); mascota = DALittlePets.ObtenerMascota(); return(View("Mascota", mascota)); }
public ActionResult AgregarMascotaDB(string duenio, string nombre, int cuidador, string especie, string raza, string color, float peso, string sexo, string nacimiento) { ViewBag.Title = "Mascotas"; ViewBag.Opcion = "Registradas"; DALittlePets.AgregarMascota(duenio, nombre, cuidador, especie, raza, color, peso, sexo, nacimiento); List <Mascota> mascota = new List <Mascota>(); mascota = DALittlePets.ObtenerMascota(); return(View("Mascota", mascota)); }
public ActionResult EliminarMascota(int idmascota) { ViewBag.Title = "Mascotas"; ViewBag.Opcion = "Registradas"; DALittlePets.EliminarMascota(idmascota); List <Mascota> mascota = new List <Mascota>(); mascota = DALittlePets.ObtenerMascota(); return(View("Mascota", mascota)); }
public ActionResult EditarMascota(string idmascota, string color, float peso) { int Idmascota = Convert.ToInt32(idmascota); DALittlePets.EditarMascota(Idmascota, color, peso); ViewBag.Title = "Mascotas"; ViewBag.Opcion = "Registradas"; List <Mascota> mascota = new List <Mascota>(); mascota = DALittlePets.ObtenerMascota(); return(View("Mascota", mascota)); }
// GET: Principal public ActionResult Index() { ViewBag.Message = "Mascotas"; List <Mascota> mascotas = new List <Mascota>(); mascotas = DALittlePets.ObtenerMascota(); if (mascotas == null) { mascotas = new List <Mascota>(); Mascota vacio = new Mascota(); vacio.IdMascota = 123; vacio.Dueño = "ABC"; vacio.Nombre = "DEF"; vacio.Especie = "ABGHIC"; vacio.Raza = "ZXCV"; mascotas.Add(vacio); } return(View("Mascota", mascotas)); }