// // GET: /SDI/Details/5 public ViewResult Details(long id) { Guid userID = GetUserID(); saconfig_tSDI saconfig_tsdi = db.saconfig_tSDI.Single(s => s.ID == id && s.DataOwnerID == userID); return(View(saconfig_tsdi)); }
public ActionResult DeleteConfirmed(long id) { Guid userID = GetUserID(); saconfig_tSDI saconfig_tsdi = db.saconfig_tSDI.Single(s => s.ID == id && s.DataOwnerID == userID); db.saconfig_tSDI.DeleteObject(saconfig_tsdi); db.SaveChanges(); return(RedirectToAction("Index")); }
// // GET: /SDI/Edit/5 public ActionResult Edit(long id) { Guid userID = GetUserID(); saconfig_tSDI saconfig_tsdi = db.saconfig_tSDI.Single(s => s.ID == id && s.DataOwnerID == userID); ViewBag.OwnerType = new SelectList(db.saconfig_SDIOwnerType, "ID", "OwnerType", saconfig_tsdi.OwnerType); ViewBag.name = new SelectList(db.saconfig_tAttributeNameEnum.Where(t => t.DataOwnerID == userID || !t.Extension).ToList(), "ID", "value", saconfig_tsdi.name); ViewBag.DOI = new SelectList(db.saconfig_tDOI.Where(t => t.DataOwnerID == userID).ToList(), "ID", "desc", saconfig_tsdi.DOI); ViewBag.SD = new SelectList(db.saconfig_tSDI.Where(t => t.DataOwnerID == userID).ToList(), "ID", "desc", saconfig_tsdi.SD); return(View(saconfig_tsdi)); }
public ActionResult Edit(saconfig_tSDI saconfig_tsdi) { Guid userID = GetUserID(); if (ModelState.IsValid) { saconfig_tsdi.DataOwnerID = userID; db.saconfig_tSDI.Attach(saconfig_tsdi); db.ObjectStateManager.ChangeObjectState(saconfig_tsdi, EntityState.Modified); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.OwnerType = new SelectList(db.saconfig_SDIOwnerType, "ID", "OwnerType", saconfig_tsdi.OwnerType); ViewBag.name = new SelectList(db.saconfig_tAttributeNameEnum.Where(t => t.DataOwnerID == userID || !t.Extension).ToList(), "ID", "value", saconfig_tsdi.name); ViewBag.DOI = new SelectList(db.saconfig_tDOI.Where(t => t.DataOwnerID == userID).ToList(), "ID", "desc", saconfig_tsdi.DOI); ViewBag.SD = new SelectList(db.saconfig_tSDI.Where(t => t.DataOwnerID == userID).ToList(), "ID", "desc", saconfig_tsdi.SD); return(View(saconfig_tsdi)); }