示例#1
0
        /// <summary>
        /// Inserts data for table "uLocate_LocationTypeProperty"
        /// </summary>
        private void CreateLocationTypePropertyData()
        {
            LogHelper.Info <DatabaseDefaultDataInsert>(string.Format("CreateLocationTypePropertyData() running..."));

            string TableName           = "uLocate_LocationTypeProperty";
            string PrimaryKeyFieldName = "Key";

            LogHelper.Info <DatabaseDefaultDataInsert>(string.Format("Adding data for table '{0}'...", TableName));

            //'Default' Properties
            foreach (var Prop in uLocate.Constants.DefaultLocationTypeProperties)
            {
                var Data = new LocationTypePropertyDto()
                {
                    LocationTypeKey = Prop.LocationTypeKey,
                    Alias           = Prop.Alias,
                    Name            = Prop.Name,
                    DataTypeId      = Prop.DataTypeId,
                    SortOrder       = Prop.SortOrder,
                    IsDefaultProp   = true
                };

                _database.Insert(Data);
            }
        }
示例#2
0
        public LocationTypePropertyDto ToLocationTypePropertyDto(LocationTypeProperty entity)
        {
            var dto = new LocationTypePropertyDto()
            {
                Key             = entity.Key,
                Alias           = entity.Alias,
                Name            = entity.Name,
                DataTypeId      = entity.DataTypeId,
                LocationTypeKey = entity.LocationTypeKey,
                SortOrder       = entity.SortOrder,
                UpdateDate      = entity.UpdateDate,
                CreateDate      = entity.CreateDate,
                IsDefaultProp   = entity.IsDefaultProp
            };

            return(dto);
        }
示例#3
0
        public LocationTypeProperty ToLocationTypePropertyEntity(LocationTypePropertyDto dto)
        {
            var Entity = new LocationTypeProperty()
            {
                Key             = dto.Key,
                Alias           = dto.Alias,
                Name            = dto.Name,
                DataTypeId      = dto.DataTypeId,
                DataType        = this.GetDataType(dto.DataTypeId),
                LocationTypeKey = dto.LocationTypeKey,
                SortOrder       = dto.SortOrder,
                UpdateDate      = dto.UpdateDate,
                CreateDate      = dto.CreateDate,
                IsDefaultProp   = dto.IsDefaultProp
            };

            return(Entity);
        }