public static void ToEntity(DT.Problem source, DA.Problem target, DA.OKBDataContext okb) { if ((source != null) && (target != null)) { target.Id = source.Id; target.Name = source.Name; target.Description = source.Description; target.PlatformId = source.PlatformId; target.ProblemClassId = source.ProblemClassId; target.DataType = Convert.ToEntity(source.DataTypeName, source.DataTypeTypeName, okb); } }
public static DT.Problem ToDto(DA.Problem source) { if (source == null) { return(null); } return(new DT.Problem { Id = source.Id, Name = source.Name, Description = source.Description, ProblemClass = Convert.ToDto(source.ProblemClass), DataType = Convert.ToDto(source.DataType) }); }
public static DT.Problem ToDto(DA.Problem source) { if (source == null) { return(null); } return(new DT.Problem { Id = source.Id, Name = source.Name, Description = source.Description, PlatformId = source.PlatformId, ProblemClassId = source.ProblemClassId, DataTypeName = source.DataType.Name, DataTypeTypeName = source.DataType.TypeName }); }
private static DT.Problem ToDto(DA.Problem source) { if (source == null) { return(null); } return(new DT.Problem { Name = source.Name, Description = source.Description, ProblemClass = source.ProblemClass.Name, Platform = source.Platform.Name, DataType = Convert.ToDto(source.DataType) }); }
public static DA.CharacteristicValue ToEntity(DT.Value source, DA.OKBDataContext okb, DA.Problem problem, DA.CharacteristicType type) { if (okb == null || problem == null || source == null || string.IsNullOrEmpty(source.Name)) { throw new ArgumentNullException(); } var entity = new DA.CharacteristicValue(); entity.Problem = problem; entity.DataType = Convert.ToEntity(source.DataType, okb); entity.Characteristic = Convert.ToEntity(source.Name, type, okb); if (source is DT.BoolValue) { entity.BoolValue = ((DT.BoolValue)source).Value; } else if (source is DT.IntValue) { entity.IntValue = ((DT.IntValue)source).Value; } else if (source is DT.TimeSpanValue) { entity.LongValue = ((DT.TimeSpanValue)source).Value; } else if (source is DT.LongValue) { entity.LongValue = ((DT.LongValue)source).Value; } else if (source is DT.FloatValue) { entity.FloatValue = ((DT.FloatValue)source).Value; } else if (source is DT.DoubleValue) { entity.DoubleValue = ((DT.DoubleValue)source).Value; } else if (source is DT.PercentValue) { entity.DoubleValue = ((DT.PercentValue)source).Value; } else if (source is DT.StringValue) { entity.StringValue = ((DT.StringValue)source).Value; } else { throw new ArgumentException("Unknown characteristic type.", "source"); } return(entity); }
private void attach_Problems(Problem entity) { this.SendPropertyChanging(); entity.Platform = this; }
private void detach_Problems(Problem entity) { this.SendPropertyChanging(); entity.Platform = null; }
partial void DeleteProblem(Problem instance);
partial void UpdateProblem(Problem instance);
partial void InsertProblem(Problem instance);
private void detach_Problems(Problem entity) { this.SendPropertyChanging(); entity.BinaryData = null; }
private void attach_Problems(Problem entity) { this.SendPropertyChanging(); entity.DataType = this; }