Exemple #1
0
    private void TongBuData()
    {
        WebFrame.Data.JConnect conn0 = WebFrame.Data.JConnect.GetConnect("DefaultConnstring");
        WebFrame.Data.JConnect conn1 = WebFrame.Data.JConnect.GetConnect("HKConnstring");
        if (conn0 != null && conn1 != null)
        {
            WebFrame.Data.JTable             tab0      = new WebFrame.Data.JTable(conn0, "U_UserName");
            WebFrame.Data.JTable             tab1      = new WebFrame.Data.JTable(conn1, "U_UserName");
            List <WebFrame.Data.SearchField> condition = new List <WebFrame.Data.SearchField>();
            condition.Add(new WebFrame.Data.SearchField("lockflag is null", "", WebFrame.SearchOperator.UserDefine));

            DataSet  ds0  = tab0.SearchData(condition, -1, "*");
            DataSet  ds1  = null;
            DataRow  dr1  = null;
            String[] arr1 = new String[] { "num", "sname", "px", "depart", "job", "password",
                                           "cell", "email", "login", "leader",
                                           "phone", "lockflag" };

            foreach (DataRow dr0 in ds0.Tables[0].Rows)
            {
                condition.Clear();
                condition.Add(new WebFrame.Data.SearchField("Sname", dr0["Sname"].ToString()));

                ds1 = tab1.SearchData(condition, -1, "*");
                if (ds1 != null)
                {
                    if (ds1.Tables[0].Rows.Count > 0)
                    {
                        dr1 = ds1.Tables[0].Rows[0];
                    }
                    else
                    {
                        dr1 = ds1.Tables[0].NewRow();
                        ds1.Tables[0].Rows.Add(dr1);
                    }

                    foreach (String m in arr1)
                    {
                        dr1[m] = dr0[m];
                    }

                    tab1.Update(ds1.Tables[0]);
                }
            }


            conn0.Dispose();
            conn1.Dispose();

            JSJ.SysFrame.Util.alert(this.Page, "提示:同步数据操作成功!");
        }
    }
        private void BindData()
        {
            String trainkind = Request.QueryString["kind"];

            WebFrame.Data.JTable tab1 = new WebFrame.Data.JTable("NewTrain");
            tab1.OrderBy = "trainname";
            System.Collections.Generic.List <WebFrame.Data.SearchField> list1
                = new List <WebFrame.Data.SearchField>();
            list1.Add(new WebFrame.Data.SearchField("TrainType", trainkind));
            System.Data.DataSet ds1 = tab1.SearchData(list1, -1, "trainname");
            tab1.Close();
            this.repeater1.DataSource = ds1;
            this.repeater1.DataBind();
        }
Exemple #3
0
    private void TongBuData()
    {
        WebFrame.Data.JConnect conn0 = WebFrame.Data.JConnect.GetConnect("DefaultConnstring");
        WebFrame.Data.JConnect conn1 = WebFrame.Data.JConnect.GetConnect("HKConnstring");
        if (conn0 != null && conn1 != null)
        {
            WebFrame.Data.JTable             tab0      = new WebFrame.Data.JTable(conn0, "U_UserName");
            WebFrame.Data.JTable             tab1      = new WebFrame.Data.JTable(conn1, "U_UserName");
            List <WebFrame.Data.SearchField> condition = new List <WebFrame.Data.SearchField>();

            DataSet  ds0  = tab0.SearchData(null, -1, "*");
            DataSet  ds1  = null;
            DataRow  dr1  = null;
            String[] arr1 = new String[] { "num", "sname", "px", "depart", "job", "password", "cell", "email", "login", "leader",
                                           "phone", "lockflag", "zeren1" };
            foreach (DataRow dr0 in ds0.Tables[0].Rows)
            {
                condition.Clear();
                condition.Add(new WebFrame.Data.SearchField("Sname", dr0["Sname"].ToString()));

                ds1 = tab1.SearchData(condition, -1, "*");
                if (ds1 != null)
                {
                    if (ds1.Tables[0].Rows.Count > 0)
                    {
                        dr1 = ds1.Tables[0].Rows[0];
                    }
                    else
                    {
                        dr1 = ds1.Tables[0].NewRow();
                    }
                }
            }


            conn0.Dispose();
            conn1.Dispose();
        }
    }