Beispiel #1
0
        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);
            }
        }
Beispiel #2
0
        //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();
            }
        }