/// <summary> /// Update a database row from a class /// </summary> public static void UpdateRowFromSasttvast(ref DataRow row, Sasttvast entity) { row.SetField("destvendno", entity.destvendno); row.SetField("destwhse", entity.destwhse); row.SetField("destshipfmno", entity.destshipfmno); row.SetField("extrvendno", entity.extrvendno); row.SetField("extrshipfmno", entity.extrshipfmno); row.SetField("intrwhse", entity.intrwhse); row.SetField("userfield", entity.userfield); }
public static Sasttvast BuildSasttvastFromRow(DataRow row) { Sasttvast entity = new Sasttvast(); entity.destvendno = row.IsNull("destvendno") ? decimal.Zero : row.Field <decimal>("destvendno"); entity.destwhse = row.IsNull("destwhse") ? string.Empty : row.Field <string>("destwhse"); entity.destshipfmno = row.IsNull("destshipfmno") ? 0 : row.Field <int>("destshipfmno"); entity.extrvendno = row.IsNull("extrvendno") ? decimal.Zero : row.Field <decimal>("extrvendno"); entity.extrshipfmno = row.IsNull("extrshipfmno") ? 0 : row.Field <int>("extrshipfmno"); entity.intrwhse = row.IsNull("intrwhse") ? string.Empty : row.Field <string>("intrwhse"); entity.userfield = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield"); return(entity); }