Beispiel #1
0
        public static bool IsSystemGroupLeafNode(string GroupCode)
        {
            bool flag2;

            try
            {
                EntityData systemGroupAllChildByParentFullID = SystemManageDAO.GetSystemGroupAllChildByParentFullID(GetSystemGroupFullID(GroupCode));
                bool       flag = !systemGroupAllChildByParentFullID.HasRecord();
                systemGroupAllChildByParentFullID.Dispose();
                flag2 = flag;
            }
            catch (Exception exception)
            {
                throw exception;
            }
            return(flag2);
        }
Beispiel #2
0
 public static void CopySystemGroup(string srcGroupCode, string dstGroupCode, string dstClassCode)
 {
     try
     {
         if (srcGroupCode == "")
         {
             throw new Exception("未传入源结点号");
         }
         if (dstClassCode == "")
         {
             throw new Exception("未传入大类代码");
         }
         EntityData systemGroupByCode = SystemManageDAO.GetSystemGroupByCode(srcGroupCode);
         if (!systemGroupByCode.HasRecord())
         {
             throw new Exception("源结点不存在");
         }
         DataRow drSrc        = systemGroupByCode.CurrentRow;
         string  parentFullID = ConvertRule.ToString(drSrc["FullID"]);
         DataRow drDst        = null;
         if (dstGroupCode.Length > 0)
         {
             EntityData data2 = SystemManageDAO.GetSystemGroupByCode(dstGroupCode);
             if (data2.HasRecord())
             {
                 drDst = data2.CurrentRow;
             }
             data2.Dispose();
         }
         EntityData entity = new EntityData("SystemGroup");
         DataTable  tb     = entity.CurrentTable;
         DataRow    row3   = CopySystemGroupNewRow(tb, drSrc, drDst, dstClassCode);
         EntityData systemGroupAllChildByParentFullID = SystemManageDAO.GetSystemGroupAllChildByParentFullID(parentFullID);
         systemGroupAllChildByParentFullID.CurrentTable.Columns.Add("DstGroupCode");
         DataView view = new DataView(systemGroupAllChildByParentFullID.CurrentTable, "", "deep", DataViewRowState.CurrentRows);
         foreach (DataRowView view2 in view)
         {
             DataRow   row      = view2.Row;
             string    text2    = row["ParentCode"].ToString();
             DataRow[] rowArray = systemGroupAllChildByParentFullID.CurrentTable.Select("GroupCode='" + text2 + "'");
             DataRow   row5     = null;
             if (rowArray.Length > 0)
             {
                 string text3 = ConvertRule.ToString(rowArray[0]["DstGroupCode"]);
                 row5 = tb.Select("GroupCode='" + text3 + "'")[0];
             }
             else
             {
                 row5 = row3;
             }
             DataRow row6 = CopySystemGroupNewRow(tb, row, row5, dstClassCode);
             row["DstGroupCode"] = row6["GroupCode"];
         }
         systemGroupAllChildByParentFullID.Dispose();
         SystemManageDAO.SubmitAllSystemGroup(entity);
         entity.Dispose();
         systemGroupByCode.Dispose();
     }
     catch (Exception exception)
     {
         throw exception;
     }
 }