/// <summary> /// Update a database row from a class /// </summary> public static void UpdateRowFromReplpending(ref DataRow row, Replpending entity) { row.SetField("co_num", entity.coNum); row.SetField("wh_num", entity.whNum); row.SetField("currtype", entity.currtype); row.SetField("currstatus", entity.currstatus); row.SetField("abs_num", entity.absNum); row.SetField("quantity", entity.quantity); 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("lot", entity.lot); row.SetField("pallet_id", entity.palletId); row.SetField("urgent", entity.urgent); row.SetField("movement_type", entity.movementType); row.SetField("from_aisle", entity.fromAisle); row.SetField("frombinRowID", entity.frombinRowID.ToByteArray()); row.SetField("movemstRowID", entity.movemstRowID.ToByteArray()); row.SetField("userfield", entity.userfield); }
public static Replpending BuildReplpendingFromRow(DataRow row) { Replpending entity = new Replpending(); entity.coNum = row.IsNull("co_num") ? string.Empty : row.Field <string>("co_num"); entity.whNum = row.IsNull("wh_num") ? string.Empty : row.Field <string>("wh_num"); entity.currtype = row.IsNull("currtype") ? string.Empty : row.Field <string>("currtype"); entity.currstatus = row.IsNull("currstatus") ? string.Empty : row.Field <string>("currstatus"); 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.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.lot = row.IsNull("lot") ? string.Empty : row.Field <string>("lot"); entity.palletId = row.IsNull("pallet_id") ? string.Empty : row.Field <string>("pallet_id"); entity.urgent = row.Field <bool>("urgent"); entity.movementType = row.IsNull("movement_type") ? string.Empty : row.Field <string>("movement_type"); entity.fromAisle = row.IsNull("from_aisle") ? 0 : row.Field <int>("from_aisle"); entity.frombinRowID = row.Field <byte[]>("frombinRowID").ToStringEncoded(); entity.movemstRowID = row.Field <byte[]>("movemstRowID").ToStringEncoded(); entity.userfield = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield"); return(entity); }