Exemplo n.º 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());
 }
Exemplo n.º 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));
 }
Exemplo n.º 3
0
 public IHttpActionResult Get()
 {
     try
     {
         List <Aporte> todos = AporteBLL.List();
         return(Content(HttpStatusCode.OK, todos));
         //return Json(todos);
     }
     catch (Exception ex)
     {
         return(Content(HttpStatusCode.BadRequest, ex));
     }
 }
Exemplo n.º 4
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));
        }