Example #1
0
        private static void CompareAndAddOuUsersData(DataTable srcTable, DataTable targetTable, DataView compareView, AD2DBTransferContext context)
        {
            //提出要添加的行
            foreach (DataRow dr in srcTable.Rows)
            {
                string userGuid = dr["USER_GUID"].ToString();
                string parentID = dr["PARENT_GUID"].ToString();

                DataRowView[] drv = compareView.FindRows(new string[] { userGuid, parentID });

                if (drv.Length == 0)
                {
                    //添加新纪录
                    DataRow newdr = targetTable.NewRow();

                    UpdateSort(dr, context);

                    DataRowView[] sameUsersInfo = context.OriginalOUUserUserGuidView.FindRows(userGuid);

                    //将和新插入记录相同GUID的用户都设置为兼职
                    Array.ForEach(sameUsersInfo, d => d["SIDELINE"] = 1);

                    AD2DBHelper.CopyDataRow(dr, newdr,
                                            "USER_GUID", "PARENT_GUID", "ALL_PATH_NAME", "DISPLAY_NAME", "OBJ_NAME", "STATUS", "ORIGINAL_SORT",
                                            "GLOBAL_SORT", "RANK_NAME", "DESCRIPTION", "ATTRIBUTES", "SEARCH_NAME", "INNER_SORT");

                    targetTable.Rows.Add(newdr);
                }
            }
        }
 private static void CompareAndUpdateUserExtendData(DataRowView drv, DataRow dr)
 {
     //比较并修改原来的记录
     if (CompareUserExtendIsDifferent(drv, dr))
     {
         AD2DBHelper.CopyDataRow(drv.Row, dr,
                                 "MOBILE",
                                 "OFFICE_TEL",
                                 "IM_ADDRESS");
     }
 }
 private static void CompareAndUpdateUsersData(DataRowView drv, DataRow dr)
 {
     //比较并修改原来的记录
     if (CompareUserIsDifferent(drv, dr))
     {
         AD2DBHelper.CopyDataRow(drv.Row, dr,
                                 "LOGON_NAME",
                                 "E_MAIL",
                                 "FIRST_NAME",
                                 "LAST_NAME");
     }
 }
 private static void CompareAndUpdateOguData(DataRowView drv, DataRow dr)
 {
     //比较并修改原来的记录
     if (CompareOrganizationIsDifferent(drv, dr))
     {
         AD2DBHelper.CopyDataRow(drv.Row, dr,
                                 "PARENT_GUID",
                                 "DISPLAY_NAME",
                                 "OBJ_NAME",
                                 "ALL_PATH_NAME",
                                 "SEARCH_NAME",
                                 "ORIGINAL_SORT",
                                 "CHILDREN_COUNTER",
                                 "GLOBAL_SORT");
     }
 }
Example #5
0
 private static void CompareAndUpdateOuUsersData(DataRowView drv, DataRow dr)
 {
     //比较并修改原来的记录
     if (CompareOuUserIsDifferent(drv, dr))
     {
         AD2DBHelper.CopyDataRow(drv.Row, dr,
                                 "DESCRIPTION",
                                 "DISPLAY_NAME",
                                 "OBJ_NAME",
                                 "ALL_PATH_NAME",
                                 "RANK_NAME",
                                 "SEARCH_NAME",
                                 "STATUS",
                                 "INNER_SORT",
                                 "ORIGINAL_SORT",
                                 "GLOBAL_SORT",
                                 "SIDELINE");
     }
 }
        private static void CompareAndAddUserExtendData(DataTable srcTable, DataTable targetTable, DataView compareView)
        {
            //提出要添加的行
            foreach (DataRow dr in srcTable.Rows)
            {
                int index = compareView.Find(dr["ID"]);

                if (index == -1)
                {
                    //添加新纪录
                    DataRow newdr = targetTable.NewRow();

                    AD2DBHelper.CopyDataRow(dr, newdr,
                                            "ID", "MOBILE", "OFFICE_TEL", "GENDER", "NATION", "IM_ADDRESS");

                    targetTable.Rows.Add(newdr);
                }
            }
        }
        private static void CompareAndAddUserData(DataTable srcTable, DataTable targetTable, DataView compareView)
        {
            //提出要添加的行
            foreach (DataRow dr in srcTable.Rows)
            {
                int index = compareView.Find(dr["GUID"]);

                if (index == -1)
                {
                    //添加新纪录
                    DataRow newdr = targetTable.NewRow();

                    AD2DBHelper.CopyDataRow(dr, newdr,
                                            "GUID", "FIRST_NAME", "LAST_NAME", "LOGON_NAME", "PWD_TYPE_GUID", "USER_PWD",
                                            "RANK_CODE", "POSTURAL", "PINYIN", "E_MAIL");

                    targetTable.Rows.Add(newdr);
                }
            }
        }
        private static void CompareAndAddOguData(DataTable srcTable, DataTable targetTable, DataView compareView, AD2DBTransferContext context)
        {
            //提出要添加的行
            foreach (DataRow dr in srcTable.Rows)
            {
                int index = compareView.Find(dr["GUID"]);

                if (index == -1)
                {
                    //添加新纪录
                    DataRow newdr = targetTable.NewRow();

                    UpdateSort(dr, context);
                    AD2DBHelper.CopyDataRow(dr, newdr,
                                            "GUID", "PARENT_GUID", "OBJ_NAME", "DISPLAY_NAME", "DESCRIPTION", "DESCRIPTION",
                                            "ALL_PATH_NAME", "ORIGINAL_SORT", "CHILDREN_COUNTER", "GLOBAL_SORT", "RANK_CODE",
                                            "INNER_SORT", "ORG_TYPE", "ORG_CLASS", "STATUS", "SEARCH_NAME");

                    targetTable.Rows.Add(newdr);
                }
            }
        }