Пример #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            CITA cITA = db.CITAS.Find(id);

            db.CITAS.Remove(cITA);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Пример #2
0
 public ActionResult Edit([Bind(Include = "Id,Fecha,Nombre_Pac,DOCTORESId")] CITA cITA)
 {
     if (ModelState.IsValid)
     {
         db.Entry(cITA).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.DOCTORESId = new SelectList(db.DOCTORES, "Id", "Nombre", cITA.DOCTORESId);
     return(View(cITA));
 }
Пример #3
0
        public ActionResult Create([Bind(Include = "Id,Fecha,Nombre_Pac,DOCTORESId")] CITA cITA)
        {
            if (ModelState.IsValid)
            {
                db.CITAS.Add(cITA);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.DOCTORESId = new SelectList(db.DOCTORES, "Id", "Nombre", cITA.DOCTORESId);
            return(View(cITA));
        }
Пример #4
0
        // GET: CITAs/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            CITA cITA = db.CITAS.Find(id);

            if (cITA == null)
            {
                return(HttpNotFound());
            }
            return(View(cITA));
        }
Пример #5
0
        // GET: CITAs/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            CITA cITA = db.CITAS.Find(id);

            if (cITA == null)
            {
                return(HttpNotFound());
            }
            ViewBag.DOCTORESId = new SelectList(db.DOCTORES, "Id", "Nombre", cITA.DOCTORESId);
            return(View(cITA));
        }