private void RebindErrorGrid(bool callRebind) { Timer2.Enabled = false; LabelError.Text = ""; DataProviders.DBaccess db = new DataProviders.DBaccess(); DateTime fromDate = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 0, 0, 0); List <Models.LogItem> logItems = new List <Models.LogItem>(); if (db.GetLastLogItems(ref logItems, 100, true, Models.LogItemSource.All, out string errmsg) == false) { LabelError.Text = errmsg; Timer2.Enabled = true; return; } RadGridErrorList.DataSource = logItems; if (callRebind) { RadGridErrorList.Rebind(); } Timer2.Enabled = true; LabelLastUpdate.Text = string.Format("{0:00}:{1:00}:{2:00}", DateTime.Now.Hour, DateTime.Now.Minute, DateTime.Now.Second); }
private void RebindStateGrid(bool callRebind) { Timer1.Enabled = false; List <Models.Service> services = new List <Models.Service>(); DataProviders.DBaccess db = new DataProviders.DBaccess(); if (db.GetServiceStates(ref services, out string errmsg) == false) { LabelError.Text = errmsg; Timer1.Enabled = true; return; } RadGridState.DataSource = services; if (callRebind) { RadGridErrorList.Rebind(); } Timer1.Enabled = true; LabelLastUpdate.Text = string.Format("{0:00}:{1:00}:{2:00}", DateTime.Now.Hour, DateTime.Now.Minute, DateTime.Now.Second); }