//
        // GET: /TransformerWinding/Details/5

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

            return(View(saconfig_ttransformerwinding));
        }
        //
        // GET: /TransformerWinding/Edit/5

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

            ViewBag.PowerTransformer = new SelectList(db.saconfig_tPowerTransformer.Where(t => t.DataOwnerID == userID).ToList(), "ID", "type", saconfig_ttransformerwinding.PowerTransformer);
            return(View(saconfig_ttransformerwinding));
        }
        public ActionResult DeleteConfirmed(long id)
        {
            Guid userID = GetUserID();
            saconfig_tTransformerWinding saconfig_ttransformerwinding = db.saconfig_tTransformerWinding.Single(s => s.ID == id && s.DataOwnerID == userID);

            db.saconfig_tTransformerWinding.DeleteObject(saconfig_ttransformerwinding);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
        public ActionResult Edit(saconfig_tTransformerWinding saconfig_ttransformerwinding)
        {
            Guid userID = GetUserID();

            if (ModelState.IsValid)
            {
                saconfig_ttransformerwinding.DataOwnerID = userID;
                db.saconfig_tTransformerWinding.Attach(saconfig_ttransformerwinding);
                db.ObjectStateManager.ChangeObjectState(saconfig_ttransformerwinding, EntityState.Modified);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }
            ViewBag.PowerTransformer = new SelectList(db.saconfig_tPowerTransformer.Where(t => t.DataOwnerID == userID).ToList(), "ID", "type", saconfig_ttransformerwinding.PowerTransformer);
            return(View(saconfig_ttransformerwinding));
        }