예제 #1
0
        // GET: Mascotas/Details/5
        public ActionResult Details(Guid?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Mascota mascota = db.Mascotas.Find(id);

            if (mascota == null)
            {
                return(HttpNotFound());
            }

            var model = new MascotaViewModel();

            model.LoadModel(mascota);

            return(View(model));
        }
예제 #2
0
        // GET: Mascotas/Edit/5
        public ActionResult Edit(Guid?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Mascota mascota = db.Mascotas.Find(id);

            if (mascota == null)
            {
                return(HttpNotFound());
            }

            var model = new MascotaViewModel();

            model.LoadModel(mascota);

            ViewBag.ClienteId = new SelectList(db.Users, "Id", "Nombre", mascota.ClienteId);
            ViewBag.RazaId    = new SelectList(db.Razas, "Id", "Nombre", mascota.RazaId);
            return(View(model));
        }