/// <summary> /// Update a database row from a class /// </summary> public static void UpdateRowFromLocationcriteria(ref DataRow row, Locationcriteria entity) { row.SetField("co_num", entity.coNum); row.SetField("wh_num", entity.whNum); row.SetField("bin_num", entity.binNum); row.SetField("fch_abs", entity.fchAbs); row.SetField("wh_zone", entity.whZone); row.SetField("putawaygroup", entity.putawaygroup); row.SetField("physical_ind", entity.physicalInd); row.SetField("count_ind", entity.countInd); row.SetField("binRowID", entity.binRowID.ToByteArray()); row.SetField("recordcountlimit", entity.recordcountlimit); row.SetField("locationcriteriauserfield", entity.locationcriteriauserfield); row.SetField("userfield", entity.userfield); }
public static Locationcriteria BuildLocationcriteriaFromRow(DataRow row) { Locationcriteria entity = new Locationcriteria(); 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.fchAbs = row.IsNull("fch_abs") ? string.Empty : row.Field <string>("fch_abs"); entity.whZone = row.IsNull("wh_zone") ? string.Empty : row.Field <string>("wh_zone"); entity.putawaygroup = row.IsNull("putawaygroup") ? string.Empty : row.Field <string>("putawaygroup"); entity.physicalInd = row.IsNull("physical_ind") ? 0 : row.Field <int>("physical_ind"); entity.countInd = row.IsNull("count_ind") ? 0 : row.Field <int>("count_ind"); entity.binRowID = row.Field <byte[]>("binRowID").ToStringEncoded(); entity.recordcountlimit = row.IsNull("recordcountlimit") ? 0 : row.Field <int>("recordcountlimit"); entity.locationcriteriauserfield = row.IsNull("locationcriteriauserfield") ? string.Empty : row.Field <string>("locationcriteriauserfield"); entity.userfield = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield"); return(entity); }