public frmMain() { Thread splashthread = new Thread(new ThreadStart(clsStatus.ShowScreen)); splashthread.IsBackground = true; splashthread.Start(); InitializeComponent(); xmlData = new clsXMLData(); xmlData.connect(); settings = xmlData.ReadSettings(); clsStatus.UdpateStatusText(DateTime.Now.ToString()); clsStatus.UdpateStatusText("\r\nTimer : " + settings.timer + " Minute(s)\r\n"); Relicate(); try { System.Timers.Timer replicationTimer = new System.Timers.Timer(); replicationTimer.Interval = Convert.ToInt32(settings.timer) * 60 * 1000; replicationTimer.Elapsed += new System.Timers.ElapsedEventHandler(MyTimer_Elapsed); replicationTimer.Start(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void dgview_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e) { if (MessageBox.Show(clsReplicate.pendingquery, "Pending Query", MessageBoxButtons.RetryCancel, MessageBoxIcon.None) == DialogResult.Retry) { xmlsettings = clsxml.ReadSettings(); dbconnect = new clsDBConnect(xmlsettings); dbconnect.Requeue(dbconnect.LogDBConne, ref errorMessage); dbconnect.LogDBConne.Close(); dbconnect.LogDBConne.Dispose(); } else { xmlsettings = clsxml.ReadSettings(); dbconnect = new clsDBConnect(xmlsettings); dbconnect.UpdateSkip(dbconnect.LogDBConne, ref errorMessage); dbconnect.LogDBConne.Close(); dbconnect.LogDBConne.Dispose(); } }
private void dgview_DefaultValuesNeeded(object sender, DataGridViewRowEventArgs e) { Form1 frm = new Form1(); clsxml.ReadSettings(); e.Row.Cells["Branch"].Value = "BR1"; e.Row.Cells["LastReplication"].Value = DateTime.Now; e.Row.Cells["FetchedQuery"].Value = Fetchvalue; e.Row.Cells["VerifiedQuery"].Value = Verifyvalue; e.Row.Cells["AppliedQuery"].Value = Applyvalue; e.Row.Cells["NextReplication"].Value = "__/__/__ __:__:__"; e.Row.Cells["Status"].Value = ""; }
public DataTable GridFillSql() { clsXMLData clsXmlData = new clsXMLData(); settings = clsXmlData.ReadSettings(); dbinfo.ServerName = settings.serverName; dbinfo.DBName = settings.dbName; dbinfo.DBPort = settings.dbPort; dbinfo.DBUser = settings.userName; dbinfo.DBPWD = settings.password; DataTable dt = new DataTable(); cnn = new MySqlConnection(connectionString); conn = new MySqlConnection(connectionString1); try { cnn.Open(); conn.Open(); MySqlCommand cmd = new MySqlCommand("SELECT LASTCONNECTION,COUNT(ID),(SELECT COUNT(ID) FROM REPLICATIONLOG WHERE COMMANDSTATUS = 'SUCCESS') APPLIEDQUERY , (SELECT COUNT(ID) FROM REPLICATIONLOG WHERE UPDATESTATUS = 'SUCCESS') VERIFIEDQUERY FROM replicationinfo JOIN replicationlog ON replicationlog.DBCODE = replicationinfo.CODE ", conn); cmd.CommandType = CommandType.Text; MySqlDataAdapter sqlda = new MySqlDataAdapter(cmd); sqlda.Fill(dt); } catch (Exception ex) { MessageBox.Show("Can't open connection" + ex.ToString()); } finally { cnn.Close(); conn.Close(); } return(dt); }