public static T_Bearing ConvertToDB(BearingClass bear) { T_Bearing t_bear = new T_Bearing(); t_bear.id = bear.id; t_bear.Name = bear.Name; t_bear.Guid = bear.Guid; t_bear.Designation = bear.Designation; t_bear.PitchDiameter = bear.PitchDiameter; t_bear.RollerDiameter = bear.RollerDiameter; t_bear.ContactAngle = bear.ContactAngle; t_bear.NumberOfRoller = bear.NumberOfRoller; t_bear.OuterRingDiameter = bear.OuterRingDiameter; t_bear.InnerRingDiameter = bear.InnerRingDiameter; t_bear.NumberOfColumns = bear.NumberOfColumns; t_bear.InnerRingFrequency = bear.InnerRingFrequency; t_bear.OuterRingFrequency = bear.OuterRingFrequency; t_bear.MaintainsFrequency = bear.MaintainsFrequency; t_bear.RollerFrequency = bear.RollerFrequency; t_bear.BearingSeries = bear.BearingSeries; t_bear.BearingSeriesID = bear.BearingSeriesID; t_bear.RPM = bear.RPM; return(t_bear); }
public static BearingClass ConvertFromDB(T_Bearing t_bear) { BearingClass bear = new BearingClass(); bear.id = t_bear.id; bear.Name = t_bear.Name; bear.Guid = t_bear.Guid ?? new Guid(); bear.Designation = t_bear.Designation; bear.PitchDiameter = t_bear.PitchDiameter ?? 0; bear.RollerDiameter = t_bear.RollerDiameter ?? 0; bear.ContactAngle = t_bear.ContactAngle ?? 0; bear.NumberOfRoller = t_bear.NumberOfRoller ?? 0; bear.OuterRingDiameter = t_bear.OuterRingDiameter ?? 0; bear.InnerRingDiameter = t_bear.InnerRingDiameter ?? 0; bear.NumberOfColumns = t_bear.NumberOfColumns ?? 0; bear.InnerRingFrequency = t_bear.InnerRingFrequency ?? 0; bear.OuterRingFrequency = t_bear.OuterRingFrequency ?? 0; bear.RollerFrequency = t_bear.RollerFrequency ?? 0; bear.MaintainsFrequency = t_bear.MaintainsFrequency ?? 0; bear.BearingSeries = t_bear.BearingSeries; bear.BearingSeriesID = t_bear.BearingSeriesID ?? 0; bear.RPM = t_bear.RPM ?? 0; return(bear); }