示例#1
0
        public async Task <ActionResult> DeleteConfirmed(int id)
        {
            caso caso = await db.caso.FindAsync(id);

            db.caso.Remove(caso);
            await db.SaveChangesAsync();

            return(RedirectToAction("Index"));
        }
示例#2
0
        public async Task <ActionResult> Edit([Bind(Include = "id,referencia,fecha_creacion,responsableId,avanceId,aperturaPersonaId")] caso caso)
        {
            if (ModelState.IsValid)
            {
                db.Entry(caso).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            ViewBag.avanceId = new SelectList(db.avance, "id", "tipo_avance", caso.avanceId);
            return(View(caso));
        }
示例#3
0
        // GET: casos/Details/5
        public async Task <ActionResult> Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            caso caso = await db.caso.FindAsync(id);

            if (caso == null)
            {
                return(HttpNotFound());
            }
            return(View(caso));
        }
示例#4
0
        // GET: casos1/Edit/5
        public async Task <ActionResult> Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            caso caso = await db.caso.FindAsync(id);

            if (caso == null)
            {
                return(HttpNotFound());
            }
            ViewBag.avanceId = new SelectList(db.avance, "id", "tipo_avance", caso.avanceId);
            return(View(caso));
        }
示例#5
0
        public async Task <ActionResult> Create([Bind(Include = "id,referencia,fecha_creacion,responsableId,avanceId,aperturaPersonaId")] caso caso)
        {
            if (ModelState.IsValid)
            {
                db.caso.Add(caso);
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }

            ViewBag.avanceId          = new SelectList(db.avance, "id", "tipo_avance", caso.avanceId);
            ViewBag.responsableId     = new SelectList(db.persona, "id", "nombre", caso.responsableId);
            ViewBag.aperturaPersonaId = new SelectList(db.persona, "id", "nombre", caso.aperturaPersonaId);

            return(View(caso));
        }