Exemplo n.º 1
0
        //
        // GET: /DataSet/Details/5

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

            return(View(saconfig_tdataset));
        }
Exemplo n.º 2
0
        public ActionResult DeleteConfirmed(long id)
        {
            Guid userID = GetUserID();
            saconfig_tDataSet saconfig_tdataset = db.saconfig_tDataSet.Single(s => s.ID == id && s.DataOwnerID == userID);

            db.saconfig_tDataSet.DeleteObject(saconfig_tdataset);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemplo n.º 3
0
        //
        // GET: /DataSet/Edit/5

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

            ViewBag.OwnerType = new SelectList(db.saconfig_DataSetOwnerType, "ID", "OwnerType", saconfig_tdataset.OwnerType);
            ViewBag.LN        = new SelectList(db.saconfig_tLN.Where(t => t.DataOwnerID == userID).ToList(), "ID", "desc", saconfig_tdataset.LN);
            ViewBag.LN0       = new SelectList(db.saconfig_tLN0.Where(t => t.DataOwnerID == userID).ToList(), "ID", "desc", saconfig_tdataset.LN0);
            return(View(saconfig_tdataset));
        }
Exemplo n.º 4
0
        public ActionResult Edit(saconfig_tDataSet saconfig_tdataset)
        {
            Guid userID = GetUserID();

            if (ModelState.IsValid)
            {
                saconfig_tdataset.DataOwnerID = userID;
                db.saconfig_tDataSet.Attach(saconfig_tdataset);
                db.ObjectStateManager.ChangeObjectState(saconfig_tdataset, EntityState.Modified);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }
            ViewBag.OwnerType = new SelectList(db.saconfig_DataSetOwnerType, "ID", "OwnerType", saconfig_tdataset.OwnerType);
            ViewBag.LN        = new SelectList(db.saconfig_tLN.Where(t => t.DataOwnerID == userID).ToList(), "ID", "desc", saconfig_tdataset.LN);
            ViewBag.LN0       = new SelectList(db.saconfig_tLN0.Where(t => t.DataOwnerID == userID).ToList(), "ID", "desc", saconfig_tdataset.LN0);
            return(View(saconfig_tdataset));
        }