/// <summary> /// Update a database row from a class /// </summary> public static void UpdateRowFromCclocations(ref DataRow row, Cclocations entity) { row.SetField("co_num", entity.coNum); row.SetField("wh_num", entity.whNum); row.SetField("bin_num", entity.binNum); row.SetField("aisle", entity.aisle); row.SetField("wh_zone", entity.whZone); row.SetField("bin_hits", entity.binHits); row.SetField("abc", entity.abc); row.SetField("is_empty_bin", entity.isEmptyBin); row.SetField("last_count", entity.lastCount); row.SetField("binmstRowID", entity.binmstRowID.ToByteArray()); row.SetField("userfield", entity.userfield); }
public static Cclocations BuildCclocationsFromRow(DataRow row) { Cclocations entity = new Cclocations(); 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.binNum = row.IsNull("bin_num") ? string.Empty : row.Field <string>("bin_num"); entity.aisle = row.IsNull("aisle") ? 0 : row.Field <int>("aisle"); entity.whZone = row.IsNull("wh_zone") ? string.Empty : row.Field <string>("wh_zone"); entity.binHits = row.IsNull("bin_hits") ? 0 : row.Field <int>("bin_hits"); entity.abc = row.IsNull("abc") ? string.Empty : row.Field <string>("abc"); entity.isEmptyBin = row.Field <bool>("is_empty_bin"); entity.lastCount = row.IsNull("last_count") ? string.Empty : row.Field <string>("last_count"); entity.binmstRowID = row.Field <byte[]>("binmstRowID").ToStringEncoded(); entity.userfield = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield"); return(entity); }