public static Wavesummary BuildWavesummaryFromRow(DataRow row) { Wavesummary entity = new Wavesummary(); 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.batchid = row.IsNull("batchid") ? 0 : row.Field <int>("batchid"); entity.showPicks = row.Field <bool>("show_picks"); entity.showZones = row.Field <bool>("show_zones"); entity.showCartons = row.Field <bool>("show_cartons"); entity.showShipments = row.Field <bool>("show_shipments"); entity.totalCube = row.IsNull("total_cube") ? decimal.Zero : row.Field <decimal>("total_cube"); entity.totalLineCnt = row.IsNull("total_line_cnt") ? decimal.Zero : row.Field <decimal>("total_line_cnt"); entity.totalWeight = row.IsNull("total_weight") ? decimal.Zero : row.Field <decimal>("total_weight"); entity.aveValue = row.IsNull("ave_value") ? decimal.Zero : row.Field <decimal>("ave_value"); entity.aveWeight = row.IsNull("ave_weight") ? decimal.Zero : row.Field <decimal>("ave_weight"); entity.totValue = row.IsNull("tot_value") ? decimal.Zero : row.Field <decimal>("tot_value"); entity.weight = row.IsNull("weight") ? decimal.Zero : row.Field <decimal>("weight"); entity.pickTime = row.IsNull("pick_time") ? string.Empty : row.Field <string>("pick_time"); entity.dropTime = row.IsNull("drop_time") ? string.Empty : row.Field <string>("drop_time"); entity.shipTime = row.IsNull("ship_time") ? string.Empty : row.Field <string>("ship_time"); entity.elapsedDays = row.IsNull("elapsed_days") ? 0 : row.Field <int>("elapsed_days"); entity.elapsedTime = row.IsNull("elapsed_time") ? string.Empty : row.Field <string>("elapsed_time"); entity.multi = row.IsNull("multi") ? 0 : row.Field <int>("multi"); entity.singles = row.IsNull("singles") ? 0 : row.Field <int>("singles"); entity.totalOrders = row.IsNull("total_orders") ? 0 : row.Field <int>("total_orders"); entity.packedOrders = row.IsNull("packed_orders") ? 0 : row.Field <int>("packed_orders"); entity.openOrders = row.IsNull("open_orders") ? 0 : row.Field <int>("open_orders"); entity.inPickOrders = row.IsNull("in_pick_orders") ? 0 : row.Field <int>("in_pick_orders"); entity.pickedOrders = row.IsNull("picked_orders") ? 0 : row.Field <int>("picked_orders"); entity.exceptionOrders = row.IsNull("exception_orders") ? 0 : row.Field <int>("exception_orders"); entity.shippedOrders = row.IsNull("shipped_orders") ? 0 : row.Field <int>("shipped_orders"); entity.totalLines = row.IsNull("total_lines") ? 0 : row.Field <int>("total_lines"); entity.packedLines = row.IsNull("packed_lines") ? 0 : row.Field <int>("packed_lines"); entity.openLines = row.IsNull("open_lines") ? 0 : row.Field <int>("open_lines"); entity.inPickLines = row.IsNull("in_pick_lines") ? 0 : row.Field <int>("in_pick_lines"); entity.pickedLines = row.IsNull("picked_lines") ? 0 : row.Field <int>("picked_lines"); entity.exceptionLines = row.IsNull("exception_lines") ? 0 : row.Field <int>("exception_lines"); entity.shippedLines = row.IsNull("shipped_lines") ? 0 : row.Field <int>("shipped_lines"); entity.picksInWave = row.IsNull("picks_in_wave") ? 0 : row.Field <int>("picks_in_wave"); entity.picksNotShipped = row.IsNull("picks_not_shipped") ? 0 : row.Field <int>("picks_not_shipped"); entity.picksUnitsRemain = row.IsNull("picks_units_remain") ? decimal.Zero : row.Field <decimal>("picks_units_remain"); entity.cartonsInWave = row.IsNull("cartons_in_wave") ? 0 : row.Field <int>("cartons_in_wave"); entity.cartonsNotShipped = row.IsNull("cartons_not_shipped") ? 0 : row.Field <int>("cartons_not_shipped"); entity.rowId = row.Field <byte[]>("row_id").ToStringEncoded(); entity.userfield = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield"); return(entity); }
/// <summary> /// Update a database row from a class /// </summary> public static void UpdateRowFromWavesummary(ref DataRow row, Wavesummary entity) { row.SetField("co_num", entity.coNum); row.SetField("wh_num", entity.whNum); row.SetField("batchid", entity.batchid); row.SetField("show_picks", entity.showPicks); row.SetField("show_zones", entity.showZones); row.SetField("show_cartons", entity.showCartons); row.SetField("show_shipments", entity.showShipments); row.SetField("total_cube", entity.totalCube); row.SetField("total_line_cnt", entity.totalLineCnt); row.SetField("total_weight", entity.totalWeight); row.SetField("ave_value", entity.aveValue); row.SetField("ave_weight", entity.aveWeight); row.SetField("tot_value", entity.totValue); row.SetField("weight", entity.weight); row.SetField("pick_time", entity.pickTime); row.SetField("drop_time", entity.dropTime); row.SetField("ship_time", entity.shipTime); row.SetField("elapsed_days", entity.elapsedDays); row.SetField("elapsed_time", entity.elapsedTime); row.SetField("multi", entity.multi); row.SetField("singles", entity.singles); row.SetField("total_orders", entity.totalOrders); row.SetField("packed_orders", entity.packedOrders); row.SetField("open_orders", entity.openOrders); row.SetField("in_pick_orders", entity.inPickOrders); row.SetField("picked_orders", entity.pickedOrders); row.SetField("exception_orders", entity.exceptionOrders); row.SetField("shipped_orders", entity.shippedOrders); row.SetField("total_lines", entity.totalLines); row.SetField("packed_lines", entity.packedLines); row.SetField("open_lines", entity.openLines); row.SetField("in_pick_lines", entity.inPickLines); row.SetField("picked_lines", entity.pickedLines); row.SetField("exception_lines", entity.exceptionLines); row.SetField("shipped_lines", entity.shippedLines); row.SetField("picks_in_wave", entity.picksInWave); row.SetField("picks_not_shipped", entity.picksNotShipped); row.SetField("picks_units_remain", entity.picksUnitsRemain); row.SetField("cartons_in_wave", entity.cartonsInWave); row.SetField("cartons_not_shipped", entity.cartonsNotShipped); row.SetField("row_id", entity.rowId.ToByteArray()); row.SetField("userfield", entity.userfield); }