private LocationTypeProperty CreateNew() { //Create new entity var Entity = new LocationTypeProperty() { Key = this.Key, Alias = this.PropAlias, Name = this.PropName, DataTypeId = this.PropType, SortOrder = this.SortOrder }; return(Entity); }
///// <summary> ///// Gets or sets the create date. ///// </summary> //public DateTime CreateDate { get; set; } ///// <summary> ///// Gets or sets the update date. ///// </summary> //public DateTime UpdateDate { get; set; } #endregion #region Public Methods public void AddProperty(string Alias, string DisplayName, int DataTypeId, int SortOrder = 0) { var NewProp = new LocationTypeProperty(); NewProp.LocationTypeKey = this.Key; NewProp.Alias = Alias; NewProp.Name = DisplayName; NewProp.DataTypeId = DataTypeId; if (SortOrder != 0) { NewProp.SortOrder = SortOrder; } else { NewProp.SortOrder = PropMaxSortNum() + 1; } Repositories.LocationTypePropertyRepo.Insert(NewProp); this.Properties.Add(NewProp); }
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; }
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; }
private LocationTypeProperty CreateNew() { //Create new entity var Entity = new LocationTypeProperty() { Key = this.Key, Alias = this.PropAlias, Name = this.PropName, DataTypeId = this.PropType, SortOrder = this.SortOrder }; return Entity; }
public void AddProperty(string Alias, string DisplayName, int DataTypeId, int SortOrder = 0) { var NewProp = new LocationTypeProperty(); NewProp.LocationTypeKey = this.Key; NewProp.Alias = Alias; NewProp.Name = DisplayName; NewProp.DataTypeId = DataTypeId; if (SortOrder != 0) { NewProp.SortOrder = SortOrder; } else { NewProp.SortOrder = PropMaxSortNum() + 1; } Repositories.LocationTypePropertyRepo.Insert(NewProp); this.Properties.Add(NewProp); }