// GET: OrChanglogManage
        public ActionResult Index(long id)
        {
            ViewBag.SCID = id;
            SetModuleAuthority();
            var sc = db.SessionConnection.Find(id);
            List <DbMonitor.Domain.Dictionary> dic = null;

            if (sc != null)
            {
                if (sc.SCDBType == "ORACLE")
                {
                    using (OracleDAL dal = new OracleDAL(GetSessionConnStr(id)))
                    {
                        ViewBag.Users = dal.GetAllUsers();
                    }
                    dic = (from d in db.Dictionary
                           where d.DTypeCode == "OracleObjectType" && d.DEnable == 1
                           select d).OrderBy(s => s.DCode).ToList();
                }
                else if (sc.SCDBType == "DM")
                {
                    using (var dal = new DmDAL(GetSessionConnStr(id)))
                    {
                        ViewBag.Users = dal.GetAllUsers();
                    }
                    dic = (from d in db.Dictionary
                           where d.DTypeCode == "DmObjectType" && d.DEnable == 1
                           select d).OrderBy(s => s.DCode).ToList();
                }
                ViewBag.DBType = sc.SCDBType;
            }
            return(View(dic));
        }
        // GET: OrDataCompare
        public ActionResult Index(long id)
        {
            ViewBag.SCID = id;
            SetModuleAuthority();

            List <Domain.Dictionary> dic = null;
            var sc = db.SessionConnection.Find(id);

            if (sc.SCDBType == "ORACLE")
            {
                using (var dal = new OracleDAL(GetSessionConnStr(id)))
                {
                    ViewBag.Users = dal.GetAllUsers().OrderBy(s => s).ToList();
                }
                dic = db.Dictionary.Where(d => d.DTypeCode == "OracleObjectType" && d.DEnable == 1).ToList();
            }
            else
            {
                using (var dal = new DmDAL(GetSessionConnStr(id)))
                {
                    ViewBag.Users = dal.GetAllUsers().OrderBy(s => s).ToList();
                }
                dic = db.Dictionary.Where(d => d.DTypeCode == "DmObjectType" && d.DEnable == 1).ToList();
            }
            return(View(dic));
        }
 // GET: DmAuditPolicy
 public ActionResult Index(long id)
 {
     ViewBag.SCID = id;
     SetModuleAuthority();
     using (var dal = new DmDAL(GetSessionConnStr(id)))
     {
         ViewBag.Users = dal.GetAllUsers();
     }
     return(View());
 }
        public ActionResult Create(long scId)
        {
            CreateAcion();
            var policy = db.AuditPolicy.Create();

            policy.SCID = scId;
            using (var dal = new DmDAL(GetSessionConnStr(scId)))
            {
                ViewBag.User = dal.GetAllUsers();
            }
            return(View(policy));
        }
Example #5
0
        public ActionResult CreateObject(long id)
        {
            string[] arrStatement = { "ALL", "INSERT", "UPDATE", "DELETE", "SELECT", "EXECUTE", "MERGE INTO", "EXECUTE TRIGGER", "LOCK TABLE" };
            ViewBag.STMT = (from d in db.Dictionary
                            where d.DTypeCode == "DmAuditObject" && d.DEnable == 1
                            orderby d.DTypeCode
                            select d.DCode).OrderBy(c => c).ToList();

            using (var dal = new DmDAL(GetSessionConnStr(id)))
            {
                ViewBag.User = dal.GetAllUsers();
            }
            ViewBag.ObjectTypes = db.Dictionary.Where(d => d.DTypeCode == "DmObjectType" && d.DEnable == 1)
                                  .OrderBy(d => d.DCode).ToList();
            return(View(id));
        }
Example #6
0
        // GET: DmAuditManage
        public ActionResult Index(long id)
        {
            ViewBag.SCID = id;
            SetModuleAuthority();
            using (var dal = new DmDAL(GetSessionConnStr(id)))
            {
                ViewBag.Users = dal.GetAllUsers();
            }
            var dic = db.Dictionary.Where(d => d.DTypeCode == "DmObjectType" && d.DEnable == 1)
                      .OrderBy(d => d.DCode).ToList();
            var stmt = (from d in db.Dictionary
                        where (d.DTypeCode == "DmAuditSTMT" || d.DTypeCode == "DmAuditObject") && d.DEnable == 1
                        orderby d.DTypeCode
                        select d.DCode).OrderBy(c => c).Distinct().ToList();

            stmt.Remove("ALL");
            ViewBag.STMT = stmt.OrderBy(s => s).ToList();
            return(View(dic));
        }
Example #7
0
        /// <summary>
        /// get的参数名必须是id,路由规则定了
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public ActionResult CreateStatement(long id)
        {
            string[] arrStatement = { "ALL",          "USER",         "ROLE",      "TABLESPACE",      "SCHEMA",       "TABLE", "VIEW", "INDEX",
                                      "PROCEDURE",    "TRIGGER",      "SEQUENCE",  "CONTEXT",         "SYNONYM",      "GRANT",
                                      "REVOKE",       "AUDIT",        "NOAUDIT",   "INSERT TABLE",    "UPDATE TABLE",
                                      "DELETE TABLE", "SELECT TABLE", "EXECUTE",   "PROCEDURE",       "PACKAGE",
                                      "PACKAGE BODY", "MAC POLICY",   "MAC LEVEL", "MAC COMPARTMENT",
                                      "MAC GROUP",    "MAC LABEL",    "MAC USER",  "MAC TABLE",       "MAC SESSION",
                                      "CHECKPOINT",   "SAVEPOINT",    "EXPLAIN",   "NOT EXIST",       "DATABASE",
                                      "CONNECT",      "COMMIT",       "ROLLBACK",  "SET TRANSACTION" };
            ViewBag.STMT = (from d in db.Dictionary
                            where d.DTypeCode == "DmAuditSTMT" && d.DEnable == 1
                            orderby d.DTypeCode
                            select d.DCode).OrderBy(c => c).ToList();

            using (var dal = new DmDAL(GetSessionConnStr(id)))
            {
                ViewBag.User = dal.GetAllUsers();
            }
            return(View(id));
        }
        public ActionResult Create(long scId)
        {
            CreateAcion();
            var sc  = db.SessionConnection.Find(scId);
            var dic = db.Dictionary.Where(d => d.DTypeCode == "DmExport" && d.DCode == "backup_dir").FirstOrDefault();

            Domain.MirrorExport me = new Domain.MirrorExport()
            {
                SCID         = scId,
                MEUser       = sc.SCUser,
                MEPassword   = sc.SCPassword,
                MEDirectory  = dic.DName,
                MESchemas    = sc.SCUser,
                MEExportTime = DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss")
            };
            using (var dal = new DmDAL(GetSessionConnStr(scId)))
            {
                //ViewBag.Schemas = dal.GetAllSchemas();
                ViewBag.Schemas = dal.GetAllUsers();
            }
            return(View(me));
        }