/// <summary> /// Update a database row from a class /// </summary> public static void UpdateRowFromCartoncontents(ref DataRow row, Cartoncontents entity) { row.SetField("co_num", entity.coNum); row.SetField("wh_num", entity.whNum); row.SetField("abs_num", entity.absNum); row.SetField("item_desc", entity.itemDesc); row.SetField("qty", entity.qty); row.SetField("order", entity.order); row.SetField("order_suffix", entity.orderSuffix); row.SetField("lot", entity.lot); row.SetField("line", entity.line); row.SetField("line_sequence", entity.lineSequence); row.SetField("rowId", entity.rowId.ToByteArray()); row.SetField("is_serial", entity.isSerial); row.SetField("cartoncontentsuserfield", entity.cartoncontentsuserfield); row.SetField("userfield", entity.userfield); }
public static Cartoncontents BuildCartoncontentsFromRow(DataRow row) { Cartoncontents entity = new Cartoncontents(); 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.itemDesc = row.IsNull("item_desc") ? string.Empty : row.Field <string>("item_desc"); entity.qty = row.IsNull("qty") ? decimal.Zero : row.Field <decimal>("qty"); entity.order = row.IsNull("order") ? string.Empty : row.Field <string>("order"); entity.orderSuffix = row.IsNull("order_suffix") ? string.Empty : row.Field <string>("order_suffix"); entity.lot = row.IsNull("lot") ? string.Empty : row.Field <string>("lot"); entity.line = row.IsNull("line") ? 0 : row.Field <int>("line"); entity.lineSequence = row.IsNull("line_sequence") ? 0 : row.Field <int>("line_sequence"); entity.rowId = row.Field <byte[]>("rowId").ToStringEncoded(); entity.isSerial = row.Field <bool>("is_serial"); entity.cartoncontentsuserfield = row.IsNull("cartoncontentsuserfield") ? string.Empty : row.Field <string>("cartoncontentsuserfield"); entity.userfield = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield"); return(entity); }