//
        // GET: /ServiceWithMaxAndMaxAttributes/Details/5

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

            return(View(saconfig_tservicewithmaxandmaxattributes));
        }
        //
        // GET: /ServiceWithMaxAndMaxAttributes/Edit/5

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

            ViewBag.ElementName = new SelectList(db.saconfig_ServiceWithMaxAndMaxAttributesElementName, "ID", "ElementName", saconfig_tservicewithmaxandmaxattributes.ElementName);
            ViewBag.Services    = new SelectList(db.saconfig_tServices.Where(t => t.DataOwnerID == userID).ToList(), "ID", "ID", saconfig_tservicewithmaxandmaxattributes.Services);
            return(View(saconfig_tservicewithmaxandmaxattributes));
        }
        public ActionResult DeleteConfirmed(long id)
        {
            Guid userID = GetUserID();
            saconfig_tServiceWithMaxAndMaxAttributes saconfig_tservicewithmaxandmaxattributes = db.saconfig_tServiceWithMaxAndMaxAttributes.Single(s => s.ID == id && s.DataOwnerID == userID);

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

            if (ModelState.IsValid)
            {
                saconfig_tservicewithmaxandmaxattributes.DataOwnerID = userID;
                db.saconfig_tServiceWithMaxAndMaxAttributes.Attach(saconfig_tservicewithmaxandmaxattributes);
                db.ObjectStateManager.ChangeObjectState(saconfig_tservicewithmaxandmaxattributes, EntityState.Modified);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }
            ViewBag.ElementName = new SelectList(db.saconfig_ServiceWithMaxAndMaxAttributesElementName, "ID", "ElementName", saconfig_tservicewithmaxandmaxattributes.ElementName);
            ViewBag.Services    = new SelectList(db.saconfig_tServices.Where(t => t.DataOwnerID == userID).ToList(), "ID", "ID", saconfig_tservicewithmaxandmaxattributes.Services);
            return(View(saconfig_tservicewithmaxandmaxattributes));
        }