예제 #1
0
        //
        // GET: /BDA/Details/5

        public ViewResult Details(long id)
        {
            Guid          userID        = GetUserID();
            saconfig_tBDA saconfig_tbda = db.saconfig_tBDA.Single(s => s.ID == id && s.DataOwnerID == userID);

            return(View(saconfig_tbda));
        }
예제 #2
0
        public ActionResult DeleteConfirmed(long id)
        {
            Guid          userID        = GetUserID();
            saconfig_tBDA saconfig_tbda = db.saconfig_tBDA.Single(s => s.ID == id && s.DataOwnerID == userID);

            db.saconfig_tBDA.DeleteObject(saconfig_tbda);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
예제 #3
0
        //
        // GET: /BDA/Edit/5

        public ActionResult Edit(long id)
        {
            Guid          userID        = GetUserID();
            saconfig_tBDA saconfig_tbda = db.saconfig_tBDA.Single(s => s.ID == id && s.DataOwnerID == userID);

            ViewBag.name    = new SelectList(db.saconfig_tAttributeNameEnum.Where(t => t.DataOwnerID == userID || !t.Extension).ToList(), "ID", "value", saconfig_tbda.name);
            ViewBag.bType   = new SelectList(db.saconfig_tBasicTypeEnum, "ID", "value", saconfig_tbda.bType);
            ViewBag.DAType  = new SelectList(db.saconfig_tDA.Where(t => t.DataOwnerID == userID).ToList(), "ID", "desc", saconfig_tbda.DAType);
            ViewBag.valKind = new SelectList(db.saconfig_tValKindEnum, "ID", "value", saconfig_tbda.valKind);
            return(View(saconfig_tbda));
        }
예제 #4
0
        public ActionResult Edit(saconfig_tBDA saconfig_tbda)
        {
            Guid userID = GetUserID();

            if (ModelState.IsValid)
            {
                saconfig_tbda.DataOwnerID = userID;
                db.saconfig_tBDA.Attach(saconfig_tbda);
                db.ObjectStateManager.ChangeObjectState(saconfig_tbda, EntityState.Modified);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }
            ViewBag.name    = new SelectList(db.saconfig_tAttributeNameEnum.Where(t => t.DataOwnerID == userID || !t.Extension).ToList(), "ID", "value", saconfig_tbda.name);
            ViewBag.bType   = new SelectList(db.saconfig_tBasicTypeEnum, "ID", "value", saconfig_tbda.bType);
            ViewBag.DAType  = new SelectList(db.saconfig_tDA.Where(t => t.DataOwnerID == userID).ToList(), "ID", "desc", saconfig_tbda.DAType);
            ViewBag.valKind = new SelectList(db.saconfig_tValKindEnum, "ID", "value", saconfig_tbda.valKind);
            return(View(saconfig_tbda));
        }