コード例 #1
0
 public ActionResult Edit([Bind(Include = "idmateria,nombre,nrc,creditos,idarea")] Materia materia)
 {
     if (ModelState.IsValid)
     {
         MateriaBLL.Update(materia);
         return(RedirectToAction("Index"));
     }
     ViewBag.idarea = new SelectList(AreaBLL.List(), "idarea", "nombre", materia.idarea);
     return(View(materia));
 }
コード例 #2
0
 public IHttpActionResult Get()
 {
     try
     {
         List <Area> todos = AreaBLL.List();
         return(Content(HttpStatusCode.OK, todos));
     }
     catch (Exception ex) {
         return(Content(HttpStatusCode.BadRequest, ex));
     }
 }
コード例 #3
0
        public ActionResult Create([Bind(Include = "idmatricula,nombre,nrc,creditos,idarea")] matricula matricula)
        {
            if (ModelState.IsValid)
            {
                MatriculaBLL.Create(matricula);
                return(RedirectToAction("Index"));
            }

            ViewBag.idarea = new SelectList(AreaBLL.List(), "idarea", "nombre", matricula.idalumno);
            return(View(matricula));
        }
コード例 #4
0
        // GET: Materias/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Materia materia = MateriaBLL.Get(id);

            if (materia == null)
            {
                return(HttpNotFound());
            }
            ViewBag.idarea = new SelectList(AreaBLL.List(), "idarea", "nombre", materia.idarea);
            return(View(materia));
        }
コード例 #5
0
 // GET: Materias/Create
 public ActionResult Create()
 {
     ViewBag.idarea = new SelectList(AreaBLL.List(), "idarea", "nombre", "coordinador");
     return(View());
 }
コード例 #6
0
 // GET: Area
 public ActionResult Index()
 {
     return(View(AreaBLL.List()));
 }