示例#1
0
        //
        // GET: /LN/Details/5

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

            return(View(saconfig_tln));
        }
示例#2
0
        public ActionResult DeleteConfirmed(long id)
        {
            Guid         userID       = GetUserID();
            saconfig_tLN saconfig_tln = db.saconfig_tLN.Single(s => s.ID == id && s.DataOwnerID == userID);

            db.saconfig_tLN.DeleteObject(saconfig_tln);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
示例#3
0
        //
        // GET: /LN/Edit/5

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

            ViewBag.OwnerType   = new SelectList(db.saconfig_LNOwnerType, "ID", "OwnerType", saconfig_tln.OwnerType);
            ViewBag.AccessPoint = new SelectList(db.saconfig_tAccessPoint.Where(t => t.DataOwnerID == userID).ToList(), "ID", "desc", saconfig_tln.AccessPoint);
            ViewBag.LDevice     = new SelectList(db.saconfig_tLDevice.Where(t => t.DataOwnerID == userID).ToList(), "ID", "desc", saconfig_tln.LDevice);
            ViewBag.lnClass     = new SelectList(db.saconfig_tLNClassEnum.Where(t => t.DataOwnerID == userID || !t.Extension).ToList(), "ID", "value", saconfig_tln.lnClass);
            return(View(saconfig_tln));
        }
示例#4
0
        public ActionResult Edit(saconfig_tLN saconfig_tln)
        {
            Guid userID = GetUserID();

            if (ModelState.IsValid)
            {
                saconfig_tln.DataOwnerID = userID;
                db.saconfig_tLN.Attach(saconfig_tln);
                db.ObjectStateManager.ChangeObjectState(saconfig_tln, EntityState.Modified);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }
            ViewBag.OwnerType   = new SelectList(db.saconfig_LNOwnerType, "ID", "OwnerType", saconfig_tln.OwnerType);
            ViewBag.AccessPoint = new SelectList(db.saconfig_tAccessPoint.Where(t => t.DataOwnerID == userID).ToList(), "ID", "desc", saconfig_tln.AccessPoint);
            ViewBag.LDevice     = new SelectList(db.saconfig_tLDevice.Where(t => t.DataOwnerID == userID).ToList(), "ID", "desc", saconfig_tln.LDevice);
            ViewBag.lnClass     = new SelectList(db.saconfig_tLNClassEnum.Where(t => t.DataOwnerID == userID || !t.Extension).ToList(), "ID", "value", saconfig_tln.lnClass);
            return(View(saconfig_tln));
        }