public static void MapFromDB(DBEntity input, ThisEntity output, bool includingParts) { output.Id = input.Id; output.RowId = input.RowId; output.EntityStateId = input.EntityStateId; output.Name = input.Name == null ? "" : input.Name; output.Description = input.Description == null ? "" : input.Description; output.CTID = input.CTID; if (IsValidDate(input.DateEffective)) { output.DateEffective = (( DateTime )input.DateEffective).ToString("yyyy-MM-dd"); } else { output.DateEffective = ""; } // output.LowEarnings = input.LowEarnings ?? 0; output.MedianEarnings = input.MedianEarnings ?? 0; output.HighEarnings = input.HighEarnings ?? 0; output.PostReceiptMonths = input.PostReceiptMonths ?? 0; output.Source = GetUrlData(input.Source); if (IsValidDate(input.Created)) { output.Created = ( DateTime )input.Created; } if (IsValidDate(input.LastUpdated)) { output.LastUpdated = ( DateTime )input.LastUpdated; } if (string.IsNullOrWhiteSpace(output.CTID) || output.EntityStateId < 3) { output.IsReferenceVersion = true; return; } //===== var relatedEntity = EntityManager.GetEntity(output.RowId, false); if (relatedEntity != null && relatedEntity.Id > 0) { output.EntityLastUpdated = relatedEntity.LastUpdated; } //components if (includingParts) { // output.Jurisdiction = Entity_JurisdictionProfileManager.Jurisdiction_GetAll(output.RowId); //get datasetprofiles output.RelevantDataSet = DataSetProfileManager.GetAll(output.RowId, true); } } //
public static void MapFromDB(DBEntity input, ThisEntity output, bool includingParts) { output.Id = input.Id; output.RowId = input.RowId; output.EntityStateId = input.EntityStateId; output.Name = input.Name == null ? "" : input.Name; output.Description = input.Description == null ? "" : input.Description; output.CTID = input.CTID; if (IsValidDate(input.DateEffective)) { output.DateEffective = (( DateTime )input.DateEffective).ToString("yyyy-MM-dd"); } else { output.DateEffective = ""; } // //output.JobsObtained = input.JobsObtained ?? 0; if (!string.IsNullOrEmpty(input.JobsObtainedJson)) { var jp = JsonConvert.DeserializeObject <EmploymentOutcomeProfileProperties>(input.JobsObtainedJson); if (jp != null) { //unpack JobsObtainedList output.JobsObtainedList = jp.JobsObtainedList; } } output.Source = GetUrlData(input.Source); if (IsValidDate(input.Created)) { output.Created = ( DateTime )input.Created; } if (IsValidDate(input.LastUpdated)) { output.LastUpdated = ( DateTime )input.LastUpdated; } if (string.IsNullOrWhiteSpace(output.CTID) || output.EntityStateId < 3) { output.IsReferenceVersion = true; return; } //===== var relatedEntity = EntityManager.GetEntity(output.RowId, false); if (relatedEntity != null && relatedEntity.Id > 0) { output.EntityLastUpdated = relatedEntity.LastUpdated; } //components if (includingParts) { // output.Jurisdiction = Entity_JurisdictionProfileManager.Jurisdiction_GetAll(output.RowId); //get datasetprofiles output.RelevantDataSet = DataSetProfileManager.GetAll(output.RowId, true); } } //
public static void MapFromDB(DBEntity input, ThisEntity output) { output.Id = input.Id; output.RowId = input.RowId; output.Name = input.Name == null ? "" : input.Name; output.Description = input.Description == null ? "" : input.Description; output.DemographicInformation = input.DemographicInformation == null ? "" : input.DemographicInformation; if (IsValidDate(input.DateEffective)) { output.DateEffective = (( DateTime )input.DateEffective).ToString("yyyy-MM-dd"); } else { output.DateEffective = ""; } // output.NumberAwarded = (input.NumberAwarded ?? 0); output.LowEarnings = (input.LowEarnings ?? 0); output.MedianEarnings = (input.MedianEarnings ?? 0); output.HighEarnings = (input.HighEarnings ?? 0); output.PostReceiptMonths = (input.PostReceiptMonths ?? 0); output.Source = GetUrlData(input.Source); output.Currency = input.Currency; Views.Codes_Currency code = CodesManager.GetCurrencyItem(output.Currency); if (code != null && code.NumericCode > 0) { output.Currency = code.Currency; output.CurrencySymbol = code.HtmlCodes; } if (IsValidDate(input.Created)) { output.Created = ( DateTime )input.Created; } if (IsValidDate(input.LastUpdated)) { output.LastUpdated = ( DateTime )input.LastUpdated; } if (!string.IsNullOrEmpty(input.JobsObtainedJson)) { var jobsObtained = JsonConvert.DeserializeObject <List <QuantitativeValue> >(input.JobsObtainedJson); if (jobsObtained != null) { output.JobsObtained = jobsObtained; } } //===== //var relatedEntity = EntityManager.GetEntity( output.RowId, false ); //if ( relatedEntity != null && relatedEntity.Id > 0 ) // output.EntityLastUpdated = relatedEntity.LastUpdated; //components // output.Jurisdiction = Entity_JurisdictionProfileManager.Jurisdiction_GetAll(output.RowId); //get datasetprofiles output.RelevantDataSet = DataSetProfileManager.GetAll(output.RowId, true); //========== } //