/// <summary> /// Returns randomized (non-existing in reality) UMA CODE which has property values as close to reality as possible /// </summary> public static UmaCode UmaCode() { UmaCode retObj = new UmaCode { CodeId = RandomData.RandomSeed.Next(1000999, 9999999), Label = string.Concat(RandomData.GetString(5, 12, RandomData.StringIncludes.Uppercase), "_", RandomData.GetString(5, 12, RandomData.StringIncludes.Uppercase)), CodeTypeId = RandomData.RandomSeed.Next(1000999, 9999999), RelatedCodeId = null, Ordering = null, TextFinnish = RandomData.GetStringSentence(2, false, true), TextEnglish = RandomData.GetStringSentence(2, false, false), TextSwedish = RandomData.GetStringSentence(2, false, true), CodeValue = RandomData.GetStringWord(), KelaValue = RandomData.GetString(1, 1, RandomData.StringIncludes.Uppercase), Description = RandomData.GetStringSentence(7, false, true), ValidityStartDate = RandomData.GetDateTimeInPast(), ValidityEndDate = new DateTime(2099, 12, 31) }; return retObj; }
/// <summary> /// Creates WCF Data Contract CODE object from Database CODE object /// </summary> /// <param name="databaseObject">The database CODE object.</param> /// <returns>WCF Data Contract CODE object</returns> public static MasterDataCode DatabaseToContract(UmaCode databaseObject) { if (databaseObject == null) { return null; } return new MasterDataCode { CodeId = databaseObject.CodeId, Label = databaseObject.Label, Ordering = databaseObject.Ordering, TextEnglish = databaseObject.TextEnglish, TextFinnish = databaseObject.TextFinnish, TextSwedish = databaseObject.TextSwedish, CodeValue = databaseObject.CodeValue, Description = databaseObject.Description, KelaValue = databaseObject.KelaValue, ValidityStartDate = databaseObject.ValidityStartDate, ValidityEndDate = databaseObject.ValidityEndDate }; }