コード例 #1
0
 public ActionResult DatosMascota(Mascota model)
 {
     if (ModelState.IsValid)
     {
         bool resultado = AD_Mascota.ActualizarDatosMascota(model);
         if (resultado)
         {
             return(RedirectToAction("ListadoMascotas", "Mascota"));
         }
         else
         {
             return(View(model));
         }
     }
     return(View());
 }
コード例 #2
0
 public ActionResult AgregarMascota(Mascota model)
 {
     if (ModelState.IsValid)
     {
         bool resultado = AD_Mascota.InsertarNuevaMascota(model);
         if (resultado)
         {
             return(RedirectToAction("ListadoMascotas", "Mascota"));
         }
         else
         {
             return(View(model));
         }
     }
     else
     {
         return(View(model));
     }
 }
コード例 #3
0
        public ActionResult ListadoMascotas()
        {
            List <Mascota> lista = AD_Mascota.ObtenerListasMascotas();

            return(View(lista));
        }
コード例 #4
0
        // GET: Mascota
        public ActionResult DatosMascota(int idMascota)
        {
            Mascota resultado = AD_Mascota.ObtenerMascota(idMascota);

            return(View(resultado));
        }