//
        // GET: /ReportControl/Details/5

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

            return(View(saconfig_treportcontrol));
        }
        public ActionResult DeleteConfirmed(long id)
        {
            Guid userID = GetUserID();
            saconfig_tReportControl saconfig_treportcontrol = db.saconfig_tReportControl.Single(s => s.ID == id && s.DataOwnerID == userID);

            db.saconfig_tReportControl.DeleteObject(saconfig_treportcontrol);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
        //
        // GET: /ReportControl/Edit/5

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

            ViewBag.OwnerType = new SelectList(db.saconfig_ReportControlOwnerType, "ID", "OwnerType", saconfig_treportcontrol.OwnerType);
            ViewBag.LN        = new SelectList(db.saconfig_tLN.Where(t => t.DataOwnerID == userID).ToList(), "ID", "desc", saconfig_treportcontrol.LN);
            ViewBag.LN0       = new SelectList(db.saconfig_tLN0.Where(t => t.DataOwnerID == userID).ToList(), "ID", "desc", saconfig_treportcontrol.LN0);
            return(View(saconfig_treportcontrol));
        }
        public ActionResult Edit(saconfig_tReportControl saconfig_treportcontrol)
        {
            Guid userID = GetUserID();

            if (ModelState.IsValid)
            {
                saconfig_treportcontrol.DataOwnerID = userID;
                db.saconfig_tReportControl.Attach(saconfig_treportcontrol);
                db.ObjectStateManager.ChangeObjectState(saconfig_treportcontrol, EntityState.Modified);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }
            ViewBag.OwnerType = new SelectList(db.saconfig_ReportControlOwnerType, "ID", "OwnerType", saconfig_treportcontrol.OwnerType);
            ViewBag.LN        = new SelectList(db.saconfig_tLN.Where(t => t.DataOwnerID == userID).ToList(), "ID", "desc", saconfig_treportcontrol.LN);
            ViewBag.LN0       = new SelectList(db.saconfig_tLN0.Where(t => t.DataOwnerID == userID).ToList(), "ID", "desc", saconfig_treportcontrol.LN0);
            return(View(saconfig_treportcontrol));
        }