示例#1
0
 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)
     });
 }
示例#3
0
 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
     });
 }
示例#4
0
 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);
        }
示例#6
0
		private void attach_Problems(Problem entity)
		{
			this.SendPropertyChanging();
			entity.Platform = this;
		}
示例#7
0
		private void detach_Problems(Problem entity)
		{
			this.SendPropertyChanging();
			entity.Platform = null;
		}
示例#8
0
 partial void DeleteProblem(Problem instance);
示例#9
0
 partial void UpdateProblem(Problem instance);
示例#10
0
 partial void InsertProblem(Problem instance);
示例#11
0
		private void detach_Problems(Problem entity)
		{
			this.SendPropertyChanging();
			entity.BinaryData = null;
		}
示例#12
0
		private void attach_Problems(Problem entity)
		{
			this.SendPropertyChanging();
			entity.DataType = this;
		}