コード例 #1
0
        //
        // GET: /ServiceWithOptionalMax/Details/5

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

            return(View(saconfig_tservicewithoptionalmax));
        }
コード例 #2
0
        //
        // GET: /ServiceWithOptionalMax/Edit/5

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

            ViewBag.ElementName = new SelectList(db.saconfig_ServiceWithOptionalMaxElementName, "ID", "ElementName", saconfig_tservicewithoptionalmax.ElementName);
            ViewBag.Services    = new SelectList(db.saconfig_tServices.Where(t => t.DataOwnerID == userID).ToList(), "ID", "ID", saconfig_tservicewithoptionalmax.Services);
            return(View(saconfig_tservicewithoptionalmax));
        }
コード例 #3
0
        public ActionResult DeleteConfirmed(long id)
        {
            Guid userID = GetUserID();
            saconfig_tServiceWithOptionalMax saconfig_tservicewithoptionalmax = db.saconfig_tServiceWithOptionalMax.Single(s => s.ID == id && s.DataOwnerID == userID);

            db.saconfig_tServiceWithOptionalMax.DeleteObject(saconfig_tservicewithoptionalmax);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
コード例 #4
0
        public ActionResult Edit(saconfig_tServiceWithOptionalMax saconfig_tservicewithoptionalmax)
        {
            Guid userID = GetUserID();

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