public List <LogSize> GetLogSize()
        {
            var     logsizeList = new List <LogSize>();
            DataSet ds          = new DataSet();
            string  query       = Resources.LogSize;

            try
            {
                ds = (DataSet)ExecuteQuery(query);
                foreach (DataTable t in ds.Tables)
                {
                    foreach (DataRow r in t.Rows)
                    {
                        LogSize LS = new LogSize();
                        LS.DBName      = (String)r["Database Name"];
                        LS.LogSize_MB  = Convert.ToDecimal(r["Log Size (MB)"]);
                        LS.PercentUsed = Convert.ToDecimal(r["Log Space Used (%)"]);
                        logsizeList.Add(LS);
                    }
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine("Exception catched: " + ex.Message);
                throw;
                //Console.WriteLine("Exception catched: " + ex.Message);
                //DO2.Success = false;
            }

            return(logsizeList);
        }
 public LogSize Insert(LogSize obj)
 {
     using (InsightEntities db = new InsightEntities())
     {
         db.LogSize.Add(obj);
         db.SaveChanges();
         return(obj);
     }
 }
Example #3
0
 public static LogSize Insert(LogSize obj)
 {
     return(repository.Insert(obj));
 }
Example #4
0
        public DatabaseTools()
        {
            InitializeComponent();

            /*** REMOVE ONCE THE UNIFIED WIX INSTALLERS ARE COMPLETE ***/
            // Get database versioning
            OMLEngine.DatabaseManagement.DatabaseManagement dbm = new OMLEngine.DatabaseManagement.DatabaseManagement();
            int dbMajor;
            int dbMinor;

            dbm.GetSchemaVersion(out dbMajor, out dbMinor);
            lcDatabaseVersion.Text = "Database version : " + dbMajor.ToString() + "." + dbMinor.ToString();
            int dbReqMajor;
            int dbRejMinor;

            dbm.GetRequiredSchemaVersion(out dbReqMajor, out dbRejMinor);
            lcReqDatabaseVersion.Text = "Required Database version :" + dbReqMajor.ToString() + "." + dbRejMinor.ToString();
            /*** REMOVE ONCE THE UNIFIED WIX INSTALLERS ARE COMPLETE ***/

            /*** ADD ONCE THE UNIFIED WIX INSTALLERS ARE COMPLETE ***/
            //OMLEngine.DatabaseManagement.DatabaseManagement dbm = new OMLEngine.DatabaseManagement.DatabaseManagement();
            /*** ADD ONCE THE UNIFIED WIX INSTALLERS ARE COMPLETE ***/
            int DataSize;
            int LogSize;

            dbm.GetDatabaseSize(out DataSize, out LogSize);
            lcDatabaseSize.Text = "Database size : Data " + DataSize.ToString() + " MB, Logs " + LogSize.ToString() + " MB";
        }