/// <summary> /// Update a database row from a class /// </summary> public static void UpdateRowFromAllocavailinventory(ref DataRow row, Allocavailinventory entity) { row.SetField("co_num", entity.coNum); row.SetField("wh_num", entity.whNum); row.SetField("abs_num", entity.absNum); row.SetField("bin_num", entity.binNum); row.SetField("pallet_id", entity.palletId); row.SetField("lot", entity.lot); row.SetField("stock_stat", entity.stockStat); row.SetField("total_qty", entity.totalQty); row.SetField("total_qty_avail", entity.totalQtyAvail); row.SetField("po_number", entity.poNumber); row.SetField("po_suffix", entity.poSuffix); row.SetField("date_time", entity.dateTime); row.SetField("cycle_flag", entity.cycleFlag); row.SetField("total_qty_requested", entity.totalQtyRequested); row.SetField("rowid", entity.rowid.ToByteArray()); row.SetField("userfield", entity.userfield); }
public static Allocavailinventory BuildAllocavailinventoryFromRow(DataRow row) { Allocavailinventory entity = new Allocavailinventory(); 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.absNum = row.IsNull("abs_num") ? string.Empty : row.Field <string>("abs_num"); entity.binNum = row.IsNull("bin_num") ? string.Empty : row.Field <string>("bin_num"); entity.palletId = row.IsNull("pallet_id") ? string.Empty : row.Field <string>("pallet_id"); entity.lot = row.IsNull("lot") ? string.Empty : row.Field <string>("lot"); entity.stockStat = row.IsNull("stock_stat") ? string.Empty : row.Field <string>("stock_stat"); entity.totalQty = row.IsNull("total_qty") ? decimal.Zero : row.Field <decimal>("total_qty"); entity.totalQtyAvail = row.IsNull("total_qty_avail") ? decimal.Zero : row.Field <decimal>("total_qty_avail"); entity.poNumber = row.IsNull("po_number") ? string.Empty : row.Field <string>("po_number"); entity.poSuffix = row.IsNull("po_suffix") ? string.Empty : row.Field <string>("po_suffix"); entity.dateTime = row.IsNull("date_time") ? string.Empty : row.Field <string>("date_time"); entity.cycleFlag = row.Field <bool>("cycle_flag"); entity.totalQtyRequested = row.IsNull("total_qty_requested") ? decimal.Zero : row.Field <decimal>("total_qty_requested"); entity.rowid = row.Field <byte[]>("rowid").ToStringEncoded(); entity.userfield = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield"); return(entity); }