/// <summary> /// Update a database row from a class /// </summary> public static void UpdateRowFromZonereplenishments(ref DataRow row, Zonereplenishments entity) { row.SetField("zone_from", entity.zoneFrom); row.SetField("zone_to", entity.zoneTo); row.SetField("bin_from", entity.binFrom); row.SetField("bin_to", entity.binTo); row.SetField("batch", entity.batch); row.SetField("abs_num", entity.absNum); row.SetField("quantity", entity.quantity); row.SetField("binmstRowID", entity.binmstRowID.ToByteArray()); row.SetField("movemmstRowID", entity.movemmstRowID.ToByteArray()); row.SetField("userfield", entity.userfield); }
public static Zonereplenishments BuildZonereplenishmentsFromRow(DataRow row) { Zonereplenishments entity = new Zonereplenishments(); entity.zoneFrom = row.IsNull("zone_from") ? string.Empty : row.Field <string>("zone_from"); entity.zoneTo = row.IsNull("zone_to") ? string.Empty : row.Field <string>("zone_to"); entity.binFrom = row.IsNull("bin_from") ? string.Empty : row.Field <string>("bin_from"); entity.binTo = row.IsNull("bin_to") ? string.Empty : row.Field <string>("bin_to"); entity.batch = row.IsNull("batch") ? 0 : row.Field <int>("batch"); entity.absNum = row.IsNull("abs_num") ? string.Empty : row.Field <string>("abs_num"); entity.quantity = row.IsNull("quantity") ? decimal.Zero : row.Field <decimal>("quantity"); entity.binmstRowID = row.Field <byte[]>("binmstRowID").ToStringEncoded(); entity.movemmstRowID = row.Field <byte[]>("movemmstRowID").ToStringEncoded(); entity.userfield = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield"); return(entity); }