// // GET: /Voltage/Details/5 public ViewResult Details(long id) { Guid userID = GetUserID(); saconfig_tVoltage saconfig_tvoltage = db.saconfig_tVoltage.Single(s => s.ID == id && s.DataOwnerID == userID); return(View(saconfig_tvoltage)); }
public ActionResult DeleteConfirmed(long id) { Guid userID = GetUserID(); saconfig_tVoltage saconfig_tvoltage = db.saconfig_tVoltage.Single(s => s.ID == id && s.DataOwnerID == userID); db.saconfig_tVoltage.DeleteObject(saconfig_tvoltage); db.SaveChanges(); return(RedirectToAction("Index")); }
// // GET: /Voltage/Edit/5 public ActionResult Edit(long id) { Guid userID = GetUserID(); saconfig_tVoltage saconfig_tvoltage = db.saconfig_tVoltage.Single(s => s.ID == id && s.DataOwnerID == userID); ViewBag.unit = new SelectList(db.saconfig_tSIUnitEnum, "ID", "value", saconfig_tvoltage.unit); ViewBag.multiplier = new SelectList(db.saconfig_tUnitMultiplierEnum, "ID", "value", saconfig_tvoltage.multiplier); ViewBag.VoltageLevel = new SelectList(db.saconfig_tVoltageLevel.Where(t => t.DataOwnerID == userID).ToList(), "ID", "desc", saconfig_tvoltage.VoltageLevel); return(View(saconfig_tvoltage)); }
public ActionResult Create(saconfig_tVoltage saconfig_tvoltage) { Guid userID = GetUserID(); if (ModelState.IsValid) { saconfig_tvoltage.DataOwnerID = userID; db.saconfig_tVoltage.AddObject(saconfig_tvoltage); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.unit = new SelectList(db.saconfig_tSIUnitEnum, "ID", "value", saconfig_tvoltage.unit); ViewBag.multiplier = new SelectList(db.saconfig_tUnitMultiplierEnum, "ID", "value", saconfig_tvoltage.multiplier); ViewBag.VoltageLevel = new SelectList(db.saconfig_tVoltageLevel.Where(t => t.DataOwnerID == userID).ToList(), "ID", "desc", saconfig_tvoltage.VoltageLevel); return(View(saconfig_tvoltage)); }