示例#1
0
 // GET: Registros/Create
 public ActionResult Create()
 {
     ViewBag.idaporte     = new SelectList(AporteBLL.List(), "idaporte", "descripcion");
     ViewBag.idevento     = new SelectList(EventoBLL.ListToNames(), "idevento", "nombre");
     ViewBag.idvoluntario = new SelectList(VoluntarioBLL.ListToNames(), "idvoluntario", "nombres");
     return(View());
 }
示例#2
0
 public ActionResult Edit([Bind(Include = "idregistro,idvoluntario,idevento,idaporte")] Registro registro)
 {
     if (ModelState.IsValid)
     {
         RegistroBLL.Update(registro);
         return(RedirectToAction("Index"));
     }
     ViewBag.idaporte     = new SelectList(AporteBLL.List(), "idaporte", "descripcion", registro.idaporte);
     ViewBag.idevento     = new SelectList(EventoBLL.ListToNames(), "idevento", "nombre", registro.idevento);
     ViewBag.idvoluntario = new SelectList(VoluntarioBLL.ListToNames(), "idvoluntario", "nombres", registro.idvoluntario);
     return(View(registro));
 }
示例#3
0
        // GET: Registros/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Registro registro = RegistroBLL.Get(id);

            if (registro == null)
            {
                return(HttpNotFound());
            }
            ViewBag.idaporte     = new SelectList(AporteBLL.List(), "idaporte", "descripcion", registro.idaporte);
            ViewBag.idevento     = new SelectList(EventoBLL.ListToNames(), "idevento", "nombre", registro.idevento);
            ViewBag.idvoluntario = new SelectList(VoluntarioBLL.ListToNames(), "idvoluntario", "nombres", registro.idvoluntario);
            return(View(registro));
        }