Beispiel #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            Tbl_Object tbl_Object = db.Tbl_Object.Find(id);

            db.Tbl_Object.Remove(tbl_Object);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Beispiel #2
0
        public ActionResult Create([Bind(Include = "Ob_ID,FK_Ca_ID,Ob_Name,Ob_Purchase_Date,Ob_Est_Value,Ob_Description,,Ob_Quantity,FK_Lo_ID")] Tbl_Object tbl_Object)
        {
            if (ModelState.IsValid)
            {
                db.Tbl_Object.Add(tbl_Object);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.FK_Ca_ID = new SelectList(db.Tbl_Category, "Ca_ID", "Ca_Name", tbl_Object.FK_Ca_ID);
            ViewBag.FK_Lo_ID = new SelectList(db.Tbl_Location, "Lo_ID", "Lo_Name");
            return(View(tbl_Object));
        }
Beispiel #3
0
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Tbl_Object tbl_Object = db.Tbl_Object.Find(id);

            if (tbl_Object == null)
            {
                return(HttpNotFound());
            }
            return(View(tbl_Object));
        }
Beispiel #4
0
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Tbl_Object tbl_Object = db.Tbl_Object.Find(id);

            if (tbl_Object == null)
            {
                return(HttpNotFound());
            }
            ViewBag.FK_Ca_ID = new SelectList(db.Tbl_Category, "Ca_ID", "Ca_Name", tbl_Object.FK_Ca_ID);
            ViewBag.FK_Lo_ID = new SelectList(db.Tbl_Location, "Lo_ID", "Lo_Name");
            return(View(tbl_Object));
        }