예제 #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            CUSTOM_UNIT cUSTOM_UNIT = db.CUSTOM_UNIT.Find(id);

            db.CUSTOM_UNIT.Remove(cUSTOM_UNIT);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
예제 #2
0
 public ActionResult Edit([Bind(Include = "ID_CUSTOM_UNIT,ID_PORTIONED_BY,NAME,QUANTITY,ACTIVE")] CUSTOM_UNIT cUSTOM_UNIT)
 {
     if (ModelState.IsValid)
     {
         db.Entry(cUSTOM_UNIT).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.ID_PORTIONED_BY = new SelectList(db.MEDIDAs, "ID_MEDIDA", "NOMBRE", cUSTOM_UNIT.ID_PORTIONED_BY);
     return(View(cUSTOM_UNIT));
 }
예제 #3
0
        // GET: CustomUnit/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            CUSTOM_UNIT cUSTOM_UNIT = db.CUSTOM_UNIT.Find(id);

            if (cUSTOM_UNIT == null)
            {
                return(HttpNotFound());
            }
            return(View(cUSTOM_UNIT));
        }
예제 #4
0
        // GET: CustomUnit/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            CUSTOM_UNIT cUSTOM_UNIT = db.CUSTOM_UNIT.Find(id);

            if (cUSTOM_UNIT == null)
            {
                return(HttpNotFound());
            }
            ViewBag.ID_PORTIONED_BY = new SelectList(db.MEDIDAs, "ID_MEDIDA", "NOMBRE", cUSTOM_UNIT.ID_PORTIONED_BY);
            return(View(cUSTOM_UNIT));
        }