コード例 #1
0
        private void InternalUpdateOneLevelChildrenFullPath(SCRelationForFullPath parent)
        {
            if (parent != null)
            {
                if (parent.FullPath == null)
                {
                    parent.FullPath = string.Empty;
                }

                if (parent.GlobalSort == null)
                {
                    parent.GlobalSort = string.Empty;
                }

                SCRelationForFullPathCollection children = LoadChildRFP(parent.ObjectID);

                SCRelationForFullPathCollection needToUpdate = children.SetAndFilterUnmatched(parent.FullPath, parent.GlobalSort);

                this.UpdateRelations(needToUpdate);

                foreach (SCRelationForFullPath rfp in children)
                {
                    InternalUpdateOneLevelChildrenFullPath(rfp);
                }
            }
        }
コード例 #2
0
        private SCRelationForFullPathCollection LoadChildRFP(string parentID)
        {
            if (parentID.IsNullOrEmpty())
            {
                parentID = SCOrganization.RootOrganizationID;
            }

            string sql = string.Format("SELECT ParentID, R.ObjectID, SC.Name, R.ChildSchemaType, R.InnerSort, R.FullPath, R.GlobalSort FROM {0} WHERE ParentID = {1}",
                                       "SC.SchemaRelationObjectsSnapshot_Current R INNER JOIN SC.SchemaObjectSnapshot_Current SC ON R.ObjectID = SC.ID",
                                       TSqlBuilder.Instance.CheckUnicodeQuotationMark(parentID));

            DataTable table = DbHelper.RunSqlReturnDS(sql, this.GetConnectionName()).Tables[0];

            SCRelationForFullPathCollection result = new SCRelationForFullPathCollection();

            foreach (DataRow row in table.Rows)
            {
                result.Add(ORMapping.DataRowToObject(row, new SCRelationForFullPath()));
            }

            return(result);
        }