Exemplo n.º 1
0
        public void LoadNodeRecord(IMapObjects mapObjects, IDataReader record)
        {
            if (record["MapNodeUid"] != null && record["MapNodeUid"] != DBNull.Value)
            {
                MapNodeUid = (Guid)record["MapNodeUid"];
            }

            if (record["NodeUid"] != null && record["NodeUid"] != DBNull.Value)
            {
                NodeUid = (Guid)record["NodeUid"];
            }

            if (record["NodeOriginalId"] != null && record["NodeOriginalId"] != DBNull.Value)
            {
                NodeOriginalId = (string)record["NodeOriginalId"];
            }

            if (record["NodeTypeUid"] != null && record["NodeTypeUid"] != DBNull.Value)
            {
                NodeTypeUid = (Guid)record["NodeTypeUid"];
            }

            if (record["DomainUid"] != null && record["DomainUid"] != DBNull.Value)
            {
                DomainUid = (Guid)record["DomainUid"];
            }

            if (record["RootMapUid"] != null && record["RootMapUid"] != DBNull.Value)
            {
                RootMapUid = (Guid)record["RootMapUid"];
            }

            if (record["Created"] != null && record["Created"] != DBNull.Value)
            {
                Created = (DateTime)record["Created"];
            }

            if (record["Modified"] != null && record["Modified"] != DBNull.Value)
            {
                Modified = (DateTime)record["Modified"];
            }

            if (record["CreatedBy"] != null && record["CreatedBy"] != DBNull.Value)
            {
                CreatedByLogin = (string)record["CreatedBy"];

                CreatedBy = mapObjects.FindUsersName(CreatedByLogin);
            }

            if (record["ModifiedBy"] != null && record["ModifiedBy"] != DBNull.Value)
            {
                ModifiedByLogin = (string)record["ModifiedBy"];

                ModifiedBy = mapObjects.FindUsersName(ModifiedByLogin);
            }
        }
Exemplo n.º 2
0
        public void AddMetadataRecord(IMapObjects mapObjects, IDataReader record)
        {
            if (record["NodeUid"] != null && record["NodeUid"] != DBNull.Value)
            {
                DateTime? metadataCreated = null;
                DateTime? metadataModified = null;
                string metadataCreatedBy = null;
                string metadataModifiedBy = null;
                string metadataCreatedByLogin = null;
                string metadataModifiedByLogin = null;

                if (record["Created"] != null && record["Created"] != DBNull.Value)
                {
                    metadataCreated = (DateTime)record["Created"];
                }

                if (record["Modified"] != null && record["Modified"] != DBNull.Value)
                {
                    metadataModified = (DateTime)record["Modified"];
                }

                if (Created > metadataCreated)
                {
                    if (record["CreatedBy"] != null && record["CreatedBy"] != DBNull.Value)
                    {
                        metadataCreatedByLogin = (string)record["CreatedBy"];

                        metadataCreatedBy = mapObjects.FindUsersName(metadataCreatedByLogin);
                    }

                    if (!string.IsNullOrEmpty(metadataCreatedByLogin))
                    {
                        Created = metadataCreated;
                        CreatedBy = metadataCreatedBy;
                        CreatedByLogin = metadataCreatedByLogin;
                    }
                }

                if (Modified < metadataModified)
                {
                    if (record["ModifiedBy"] != null && record["ModifiedBy"] != DBNull.Value)
                    {
                        metadataModifiedByLogin = (string)record["ModifiedBy"];

                        metadataModifiedBy = mapObjects.FindUsersName(metadataModifiedByLogin);
                    }

                    if (!string.IsNullOrEmpty(metadataModifiedByLogin))
                    {
                        Modified = metadataModified;
                        ModifiedBy = metadataModifiedBy;
                        ModifiedByLogin = metadataModifiedByLogin;
                    }
                }

                if (record["MetadataName"] != null && record["MetadataName"] != DBNull.Value)
                {
                    string metadataName = (string)record["MetadataName"];

                    if (record["MetadataValue"] != null & record["MetadataValue"] != DBNull.Value)
                    {
                        string metadataValue = (string)record["MetadataValue"];

                        Metadata[metadataName] = metadataValue;
                    }
                    else
                    {
                        Metadata[metadataName] = null;
                    }
                }
            }
        }
Exemplo n.º 3
0
        public void LoadNodeRecord(IMapObjects mapObjects, IDataReader record)
        {
            if (record["MapNodeUid"] != null && record["MapNodeUid"] != DBNull.Value)
            {
                MapNodeUid = (Guid)record["MapNodeUid"];
            }

            if (record["NodeUid"] != null && record["NodeUid"] != DBNull.Value)
            {
                NodeUid = (Guid)record["NodeUid"];
            }

            if (record["NodeOriginalId"] != null && record["NodeOriginalId"] != DBNull.Value)
            {
                NodeOriginalId = (string)record["NodeOriginalId"];
            }

            if (record["NodeTypeUid"] != null && record["NodeTypeUid"] != DBNull.Value)
            {
                NodeTypeUid = (Guid)record["NodeTypeUid"];
            }

            if (record["DomainUid"] != null && record["DomainUid"] != DBNull.Value)
            {
                DomainUid = (Guid)record["DomainUid"];
            }

            if (record["RootMapUid"] != null && record["RootMapUid"] != DBNull.Value)
            {
                RootMapUid = (Guid)record["RootMapUid"];
            }

            if (record["Created"] != null && record["Created"] != DBNull.Value)
            {
                Created = (DateTime)record["Created"];
            }

            if (record["Modified"] != null && record["Modified"] != DBNull.Value)
            {
                Modified = (DateTime)record["Modified"];
            }

            if (record["CreatedBy"] != null && record["CreatedBy"] != DBNull.Value)
            {
                CreatedByLogin = (string)record["CreatedBy"];

                CreatedBy = mapObjects.FindUsersName(CreatedByLogin);
            }

            if (record["ModifiedBy"] != null && record["ModifiedBy"] != DBNull.Value)
            {
                ModifiedByLogin = (string)record["ModifiedBy"];

                ModifiedBy = mapObjects.FindUsersName(ModifiedByLogin);
            }
        }
Exemplo n.º 4
0
        public void AddMetadataRecord(IMapObjects mapObjects, IDataReader record)
        {
            if (record["NodeUid"] != null && record["NodeUid"] != DBNull.Value)
            {
                DateTime?metadataCreated         = null;
                DateTime?metadataModified        = null;
                string   metadataCreatedBy       = null;
                string   metadataModifiedBy      = null;
                string   metadataCreatedByLogin  = null;
                string   metadataModifiedByLogin = null;

                if (record["Created"] != null && record["Created"] != DBNull.Value)
                {
                    metadataCreated = (DateTime)record["Created"];
                }

                if (record["Modified"] != null && record["Modified"] != DBNull.Value)
                {
                    metadataModified = (DateTime)record["Modified"];
                }

                if (Created > metadataCreated)
                {
                    if (record["CreatedBy"] != null && record["CreatedBy"] != DBNull.Value)
                    {
                        metadataCreatedByLogin = (string)record["CreatedBy"];

                        metadataCreatedBy = mapObjects.FindUsersName(metadataCreatedByLogin);
                    }

                    if (!string.IsNullOrEmpty(metadataCreatedByLogin))
                    {
                        Created        = metadataCreated;
                        CreatedBy      = metadataCreatedBy;
                        CreatedByLogin = metadataCreatedByLogin;
                    }
                }

                if (Modified < metadataModified)
                {
                    if (record["ModifiedBy"] != null && record["ModifiedBy"] != DBNull.Value)
                    {
                        metadataModifiedByLogin = (string)record["ModifiedBy"];

                        metadataModifiedBy = mapObjects.FindUsersName(metadataModifiedByLogin);
                    }

                    if (!string.IsNullOrEmpty(metadataModifiedByLogin))
                    {
                        Modified        = metadataModified;
                        ModifiedBy      = metadataModifiedBy;
                        ModifiedByLogin = metadataModifiedByLogin;
                    }
                }

                if (record["MetadataName"] != null && record["MetadataName"] != DBNull.Value)
                {
                    string metadataName = (string)record["MetadataName"];

                    if (record["MetadataValue"] != null & record["MetadataValue"] != DBNull.Value)
                    {
                        string metadataValue = (string)record["MetadataValue"];

                        Metadata[metadataName] = metadataValue;
                    }
                    else
                    {
                        Metadata[metadataName] = null;
                    }
                }
            }
        }