/// <summary> /// Update a database row from a class /// </summary> public static void UpdateRowFromZoneinventory(ref DataRow row, Zoneinventory entity) { row.SetField("bin_num", entity.binNum); row.SetField("abs_num", entity.absNum); row.SetField("total_qty", entity.totalQty); row.SetField("pallet_id", entity.palletId); row.SetField("stock_stat", entity.stockStat); row.SetField("date_time_rec", entity.dateTimeRec); row.SetField("lot", entity.lot); row.SetField("date_expiration", entity.dateExpiration); row.SetField("case_quantity", entity.caseQuantity); row.SetField("cycle_flag", entity.cycleFlag); row.SetField("binmstRowID", entity.binmstRowID.ToByteArray()); row.SetField("inventoryRowID", entity.inventoryRowID.ToByteArray()); row.SetField("userfield", entity.userfield); }
public static Zoneinventory BuildZoneinventoryFromRow(DataRow row) { Zoneinventory entity = new Zoneinventory(); entity.binNum = row.IsNull("bin_num") ? string.Empty : row.Field <string>("bin_num"); entity.absNum = row.IsNull("abs_num") ? string.Empty : row.Field <string>("abs_num"); entity.totalQty = row.IsNull("total_qty") ? decimal.Zero : row.Field <decimal>("total_qty"); entity.palletId = row.IsNull("pallet_id") ? string.Empty : row.Field <string>("pallet_id"); entity.stockStat = row.IsNull("stock_stat") ? string.Empty : row.Field <string>("stock_stat"); entity.dateTimeRec = row.IsNull("date_time_rec") ? string.Empty : row.Field <string>("date_time_rec"); entity.lot = row.IsNull("lot") ? string.Empty : row.Field <string>("lot"); entity.dateExpiration = row.Field <DateTime?>("date_expiration"); entity.caseQuantity = row.IsNull("case_quantity") ? decimal.Zero : row.Field <decimal>("case_quantity"); entity.cycleFlag = row.Field <bool>("cycle_flag"); entity.binmstRowID = row.Field <byte[]>("binmstRowID").ToStringEncoded(); entity.inventoryRowID = row.Field <byte[]>("inventoryRowID").ToStringEncoded(); entity.userfield = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield"); return(entity); }