/// <summary> /// Update a database row from a class /// </summary> public static void UpdateRowFromReceipttransdetail(ref DataRow row, Receipttransdetail entity) { row.SetField("abs_num", entity.absNum); row.SetField("act_quantity", entity.actQuantity); row.SetField("asn_flag", entity.asnFlag); row.SetField("bo_count", entity.boCount); row.SetField("bo_quantity", entity.boQuantity); row.SetField("case_quantity", entity.caseQuantity); row.SetField("comments", entity.comments); row.SetField("co_num", entity.coNum); row.SetField("custom_data1", entity.customData1); row.SetField("custom_data2", entity.customData2); row.SetField("custom_data3", entity.customData3); row.SetField("custom_data4", entity.customData4); row.SetField("custom_data5", entity.customData5); row.SetField("delivery", entity.delivery); row.SetField("exp_quantity", entity.expQuantity); row.SetField("item_cost", entity.itemCost); row.SetField("item_desc", entity.itemDesc); row.SetField("item_num", entity.itemNum); row.SetField("line_indicator", entity.lineIndicator); row.SetField("line_num", entity.lineNum); row.SetField("line_sequence", entity.lineSequence); row.SetField("lot", entity.lot); row.SetField("ordered_qty", entity.orderedQty); row.SetField("packer", entity.packer); row.SetField("packing_list", entity.packingList); row.SetField("packing_list_mst", entity.packingListMst); row.SetField("percent_fill", entity.percentFill); row.SetField("po_line", entity.poLine); row.SetField("po_number", entity.poNumber); row.SetField("po_suffix", entity.poSuffix); row.SetField("po_type", entity.poType); row.SetField("prod_desc", entity.prodDesc); row.SetField("qty_unavail", entity.qtyUnavail); row.SetField("quantity", entity.quantity); row.SetField("rd_po_type", entity.rdPoType); row.SetField("receiver_num", entity.receiverNum); row.SetField("return_fl", entity.returnFl); row.SetField("ret_line", entity.retLine); row.SetField("ret_line_sequence", entity.retLineSequence); row.SetField("row_status", entity.rowStatus); row.SetField("row_status_mst", entity.rowStatusMst); row.SetField("rtn_order", entity.rtnOrder); row.SetField("rtn_order_suffix", entity.rtnOrderSuffix); row.SetField("rt_id", entity.rtId); row.SetField("rt_num_mst", entity.rtNumMst); row.SetField("special_handling", entity.specialHandling); row.SetField("stock_stat", entity.stockStat); row.SetField("trans_date", entity.transDate); row.SetField("trans_proc", entity.transProc); row.SetField("trans_user", entity.transUser); row.SetField("uom", entity.uom); row.SetField("vendor_id", entity.vendorId); row.SetField("vend_item", entity.vendItem); row.SetField("wh_num", entity.whNum); row.SetField("detRowID", entity.detRowID.ToByteArray()); row.SetField("mstRowID", entity.mstRowID.ToByteArray()); row.SetField("userfield", entity.userfield); }
public static Receipttransdetail BuildReceipttransdetailFromRow(DataRow row) { Receipttransdetail entity = new Receipttransdetail(); entity.absNum = row.IsNull("abs_num") ? string.Empty : row.Field <string>("abs_num"); entity.actQuantity = row.IsNull("act_quantity") ? decimal.Zero : row.Field <decimal>("act_quantity"); entity.asnFlag = row.Field <bool>("asn_flag"); entity.boCount = row.IsNull("bo_count") ? 0 : row.Field <int>("bo_count"); entity.boQuantity = row.IsNull("bo_quantity") ? decimal.Zero : row.Field <decimal>("bo_quantity"); entity.caseQuantity = row.IsNull("case_quantity") ? decimal.Zero : row.Field <decimal>("case_quantity"); entity.comments = row.IsNull("comments") ? string.Empty : row.Field <string>("comments"); entity.coNum = row.IsNull("co_num") ? string.Empty : row.Field <string>("co_num"); entity.customData1 = row.IsNull("custom_data1") ? string.Empty : row.Field <string>("custom_data1"); entity.customData2 = row.IsNull("custom_data2") ? string.Empty : row.Field <string>("custom_data2"); entity.customData3 = row.IsNull("custom_data3") ? string.Empty : row.Field <string>("custom_data3"); entity.customData4 = row.IsNull("custom_data4") ? string.Empty : row.Field <string>("custom_data4"); entity.customData5 = row.IsNull("custom_data5") ? string.Empty : row.Field <string>("custom_data5"); entity.delivery = row.Field <DateTime?>("delivery"); entity.expQuantity = row.IsNull("exp_quantity") ? decimal.Zero : row.Field <decimal>("exp_quantity"); entity.itemCost = row.IsNull("item_cost") ? decimal.Zero : row.Field <decimal>("item_cost"); entity.itemDesc = row.IsNull("item_desc") ? string.Empty : row.Field <string>("item_desc"); entity.itemNum = row.IsNull("item_num") ? string.Empty : row.Field <string>("item_num"); entity.lineIndicator = row.IsNull("line_indicator") ? string.Empty : row.Field <string>("line_indicator"); entity.lineNum = row.IsNull("line_num") ? 0 : row.Field <int>("line_num"); entity.lineSequence = row.IsNull("line_sequence") ? 0 : row.Field <int>("line_sequence"); entity.lot = row.IsNull("lot") ? string.Empty : row.Field <string>("lot"); entity.orderedQty = row.IsNull("ordered_qty") ? decimal.Zero : row.Field <decimal>("ordered_qty"); entity.packer = row.IsNull("packer") ? string.Empty : row.Field <string>("packer"); entity.packingList = row.Field <bool>("packing_list"); entity.packingListMst = row.Field <bool>("packing_list_mst"); entity.percentFill = row.IsNull("percent_fill") ? decimal.Zero : row.Field <decimal>("percent_fill"); entity.poLine = row.IsNull("po_line") ? 0 : row.Field <int>("po_line"); 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.poType = row.IsNull("po_type") ? string.Empty : row.Field <string>("po_type"); entity.prodDesc = row.IsNull("prod_desc") ? string.Empty : row.Field <string>("prod_desc"); entity.qtyUnavail = row.IsNull("qty_unavail") ? decimal.Zero : row.Field <decimal>("qty_unavail"); entity.quantity = row.IsNull("quantity") ? decimal.Zero : row.Field <decimal>("quantity"); entity.rdPoType = row.IsNull("rd_po_type") ? string.Empty : row.Field <string>("rd_po_type"); entity.receiverNum = row.IsNull("receiver_num") ? string.Empty : row.Field <string>("receiver_num"); entity.returnFl = row.IsNull("return_fl") ? string.Empty : row.Field <string>("return_fl"); entity.retLine = row.IsNull("ret_line") ? 0 : row.Field <int>("ret_line"); entity.retLineSequence = row.IsNull("ret_line_sequence") ? 0 : row.Field <int>("ret_line_sequence"); entity.rowStatus = row.IsNull("row_status") ? string.Empty : row.Field <string>("row_status"); entity.rowStatusMst = row.IsNull("row_status_mst") ? string.Empty : row.Field <string>("row_status_mst"); entity.rtnOrder = row.IsNull("rtn_order") ? string.Empty : row.Field <string>("rtn_order"); entity.rtnOrderSuffix = row.IsNull("rtn_order_suffix") ? string.Empty : row.Field <string>("rtn_order_suffix"); entity.rtId = row.IsNull("rt_id") ? 0 : row.Field <int>("rt_id"); entity.rtNumMst = row.IsNull("rt_num_mst") ? string.Empty : row.Field <string>("rt_num_mst"); entity.specialHandling = row.IsNull("special_handling") ? string.Empty : row.Field <string>("special_handling"); entity.stockStat = row.IsNull("stock_stat") ? string.Empty : row.Field <string>("stock_stat"); entity.transDate = row.IsNull("trans_date") ? string.Empty : row.Field <string>("trans_date"); entity.transProc = row.IsNull("trans_proc") ? string.Empty : row.Field <string>("trans_proc"); entity.transUser = row.IsNull("trans_user") ? string.Empty : row.Field <string>("trans_user"); entity.uom = row.IsNull("uom") ? string.Empty : row.Field <string>("uom"); entity.vendorId = row.IsNull("vendor_id") ? string.Empty : row.Field <string>("vendor_id"); entity.vendItem = row.IsNull("vend_item") ? string.Empty : row.Field <string>("vend_item"); entity.whNum = row.IsNull("wh_num") ? string.Empty : row.Field <string>("wh_num"); entity.detRowID = row.Field <byte[]>("detRowID").ToStringEncoded(); entity.mstRowID = row.Field <byte[]>("mstRowID").ToStringEncoded(); entity.userfield = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield"); return(entity); }