/// <summary> /// Update a database row from a class /// </summary> public static void UpdateRowFromCcitemlots(ref DataRow row, Ccitemlots 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("lot", entity.lot); row.SetField("soonestExpiration", entity.soonestExpiration); row.SetField("latestExpiration", entity.latestExpiration); row.SetField("soonestExpirationDays", entity.soonestExpirationDays); row.SetField("latestExpirationDays", entity.latestExpirationDays); row.SetField("numLocations", entity.numLocations); row.SetField("totalQuantity", entity.totalQuantity); row.SetField("counterForSum", entity.counterForSum); row.SetField("itemRowID", entity.itemRowID.ToByteArray()); row.SetField("inventoryRowID", entity.inventoryRowID.ToByteArray()); row.SetField("userfield", entity.userfield); }
public static Ccitemlots BuildCcitemlotsFromRow(DataRow row) { Ccitemlots entity = new Ccitemlots(); 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.lot = row.IsNull("lot") ? string.Empty : row.Field <string>("lot"); entity.soonestExpiration = row.Field <DateTime?>("soonestExpiration"); entity.latestExpiration = row.Field <DateTime?>("latestExpiration"); entity.soonestExpirationDays = row.IsNull("soonestExpirationDays") ? 0 : row.Field <int>("soonestExpirationDays"); entity.latestExpirationDays = row.IsNull("latestExpirationDays") ? 0 : row.Field <int>("latestExpirationDays"); entity.numLocations = row.IsNull("numLocations") ? 0 : row.Field <int>("numLocations"); entity.totalQuantity = row.IsNull("totalQuantity") ? decimal.Zero : row.Field <decimal>("totalQuantity"); entity.counterForSum = row.IsNull("counterForSum") ? 0 : row.Field <int>("counterForSum"); entity.itemRowID = row.Field <byte[]>("itemRowID").ToStringEncoded(); entity.inventoryRowID = row.Field <byte[]>("inventoryRowID").ToStringEncoded(); entity.userfield = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield"); return(entity); }