public static void TaoTable() { Accessdata ac = new Accessdata(); ac.TaoTable(); //ac.upd_manager_schema(server.DbLink); }
public bool TaoDBLink() { if (_host == "") { return(false); } if (_port == "") { return(false); } if (_userdb == "") { return(false); } if (_passdb == "") { return(false); } if (_dbname == "") { return(false); } if (_stt == -1) { return(false); } if (_dklink == "") { return(false); } Accessdata acc = new Accessdata(); return(acc.CreateDblink(this)); }
//public static void ThemField(System.Data.DataTable table1, string valueDefault, Client server,DataTable dtmmyy) //{ // string mmyy = DateTime.Now.Month.ToString().PadLeft(2, '0') + DateTime.Now.Year.ToString().Substring(2, 2); // string schema = "", table = "";//, field = "", key = ""; // Accessdata acc = new Accessdata(); // bool done = false; // foreach (DataRow r in dtmmyy.Rows) // { // done = true; // mmyy = r["mmyy"].ToString(); // foreach (System.Data.DataRow row in table1.Rows) // { // schema = row["schema"].ToString(); // schema = schema.Replace("xxx", mmyy); // table = row["tablename"].ToString(); // acc.AlterTable(schema, table, valueDefault, server); // } // } // if (!done) // { // foreach (System.Data.DataRow row in table1.Rows) // { // schema = row["schema"].ToString(); // schema = schema.Replace("xxx", mmyy); // table = row["tablename"].ToString(); // acc.AlterTable(schema, table, valueDefault, server); // } // } //} public static void upd_chuyendi(System.Data.DataTable table1, string valueDefault, Client server, DataTable dtmmyy) { string mmyy = DateTime.Now.Month.ToString().PadLeft(2, '0') + DateTime.Now.Year.ToString().Substring(2, 2); string schema = "", table = "";//, field = "", key = ""; Accessdata acc = new Accessdata(); bool done = false; foreach (DataRow r in dtmmyy.Rows) { done = true; mmyy = r["mmyy"].ToString(); foreach (System.Data.DataRow row in table1.Rows) { schema = row["schema"].ToString(); schema = schema.Replace("xxx", mmyy); table = row["tablename"].ToString(); acc.update(schema, table, valueDefault, server); } } if (!done) { foreach (System.Data.DataRow row in table1.Rows) { schema = row["schema"].ToString(); schema = schema.Replace("xxx", mmyy); table = row["tablename"].ToString(); acc.update(schema, table, valueDefault, server); } } }
public static DataTable getMMYY(string dblinks_server) { Accessdata acc = new Accessdata(); try { return(acc.get_data("select mmyy from " + acc.User + ".syn_manager_schema@" + dblinks_server + " where syn=1").Tables[0]); } catch { return(null); } }
public static void DongBo(System.Data.DataTable table1, Client client, Client server) { string mmyy = DateTime.Now.Month.ToString().PadLeft(2, '0') + DateTime.Now.Year.ToString().Substring(2, 2); string schema = "", table = "", field = "", key = ""; Accessdata acc = new Accessdata(); foreach (System.Data.DataRow row in table1.Rows) { schema = row["schema"].ToString(); schema = schema.Replace("xxx", mmyy); table = row["tablename"].ToString(); field = row["field"].ToString(); key = row["key"].ToString(); acc.Syschronise2Server(schema, table, key, field, client, server); } }
public static DataSet SynTable_KSK(string dblink) { Accessdata acc = new Accessdata(); if (dblink != "") { dblink = "@" + dblink; } try { return(acc.get_data("select * from " + acc.User + ".syn_dmtable_ksk" + dblink + " where hide=0 order by stt ")); } catch { return(null); } }
private void dmTable_Load(object sender, EventArgs e) { dal = new Accessdata(); mm.Value = (decimal)DateTime.Now.Month; yy.Value = (decimal)DateTime.Now.Year; dataGridView1.AutoGenerateColumns = false; load_table(); //dtConstraints = dal.get_Information_constraint(); try { cbMaytram.DisplayMember = "Dblink"; cbMaytram.ValueMember = "Dblink"; cbMaytram.DataSource = list; } catch { } }
//public static bool XoaClient(Client client, Client server) //{ // Accessdata acc = new Accessdata(); // return acc.XoaClient(client, server); //} public static void DongBo(System.Data.DataTable table1, List <Client> list, Client server, bool bprogress) { string mmyy = DateTime.Now.Month.ToString().PadLeft(2, '0') + DateTime.Now.Year.ToString().Substring(2, 2); string schema = "", table = "", field = "", key = ""; frmProgressBar progress = new frmProgressBar(); if (bprogress) { progress.Show(); progress.Maximum = table1.Rows.Count; progress.Step = 1; progress.Value = 1; } Accessdata acc = new Accessdata(); foreach (System.Data.DataRow row in table1.Rows) { schema = row["schema"].ToString(); schema = schema.Replace("xxx", mmyy); table = row["tablename"].ToString(); field = row["field"].ToString(); key = row["key"].ToString(); if (bprogress) { progress.Status = schema + "." + table; progress.PerformStep(); } for (int i = 0; i < list.Count; i++) { acc.Syschronise2Server(schema, table, key, field, list[i], server); } } if (bprogress) { progress.Close(); progress.Dispose(); } }
public bool XoaDBLink() { Accessdata acc = new Accessdata(); return(acc.DropdbLink(this)); }
public static bool LuuClient(Client client) { Accessdata acc = new Accessdata(); return(acc.LuuClient(client)); }
public static bool LuuClient(Client client, Client server) { Accessdata acc = new Accessdata(); return(acc.LuuClient(client, server)); }
public static List <Client> listClient() { Accessdata acc = new Accessdata(); return(acc.getClient()); }