/// <summary> /// Update a database row from a class /// </summary> public static void UpdateRowFromIcamucriteria(ref DataRow row, Icamucriteria entity) { row.SetField("statustype", entity.statustype); row.SetField("whse", entity.whse); row.SetField("buyeroroperator", entity.buyeroroperator); row.SetField("frozenreason", entity.frozenreason); row.SetField("vendno", entity.vendno); row.SetField("prodline", entity.prodline); row.SetField("countryoforigin", entity.countryoforigin); row.SetField("fmprodcat", entity.fmprodcat); row.SetField("toprodcat", entity.toprodcat); row.SetField("fmclass", entity.fmclass); row.SetField("toclass", entity.toclass); row.SetField("fmrank", entity.fmrank); row.SetField("torank", entity.torank); row.SetField("exceptlist", entity.exceptlist); row.SetField("recordcountlimit", entity.recordcountlimit); row.SetField("validatelist", entity.validatelist); row.SetField("userfield", entity.userfield); }
public static Icamucriteria BuildIcamucriteriaFromRow(DataRow row) { Icamucriteria entity = new Icamucriteria(); entity.statustype = row.IsNull("statustype") ? string.Empty : row.Field <string>("statustype"); entity.whse = row.IsNull("whse") ? string.Empty : row.Field <string>("whse"); entity.buyeroroperator = row.IsNull("buyeroroperator") ? string.Empty : row.Field <string>("buyeroroperator"); entity.frozenreason = row.IsNull("frozenreason") ? string.Empty : row.Field <string>("frozenreason"); entity.vendno = row.IsNull("vendno") ? decimal.Zero : row.Field <decimal>("vendno"); entity.prodline = row.IsNull("prodline") ? string.Empty : row.Field <string>("prodline"); entity.countryoforigin = row.IsNull("countryoforigin") ? string.Empty : row.Field <string>("countryoforigin"); entity.fmprodcat = row.IsNull("fmprodcat") ? string.Empty : row.Field <string>("fmprodcat"); entity.toprodcat = row.IsNull("toprodcat") ? string.Empty : row.Field <string>("toprodcat"); entity.fmclass = row.IsNull("fmclass") ? 0 : row.Field <int>("fmclass"); entity.toclass = row.IsNull("toclass") ? 0 : row.Field <int>("toclass"); entity.fmrank = row.IsNull("fmrank") ? string.Empty : row.Field <string>("fmrank"); entity.torank = row.IsNull("torank") ? string.Empty : row.Field <string>("torank"); entity.exceptlist = row.IsNull("exceptlist") ? string.Empty : row.Field <string>("exceptlist"); entity.recordcountlimit = row.IsNull("recordcountlimit") ? 0 : row.Field <int>("recordcountlimit"); entity.validatelist = row.IsNull("validatelist") ? string.Empty : row.Field <string>("validatelist"); entity.userfield = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield"); return(entity); }