public static Pdspnpcriteria BuildPdspnpcriteriaFromRow(DataRow row) { Pdspnpcriteria entity = new Pdspnpcriteria(); entity.clevelcd = row.IsNull("clevelcd") ? string.Empty : row.Field <string>("clevelcd"); entity.vendno = row.IsNull("vendno") ? decimal.Zero : row.Field <decimal>("vendno"); entity.custno = row.IsNull("custno") ? decimal.Zero : row.Field <decimal>("custno"); entity.shipto = row.IsNull("shipto") ? string.Empty : row.Field <string>("shipto"); entity.custgroup = row.IsNull("custgroup") ? string.Empty : row.Field <string>("custgroup"); entity.custpricety = row.IsNull("custpricety") ? string.Empty : row.Field <string>("custpricety"); entity.prod = row.IsNull("prod") ? string.Empty : row.Field <string>("prod"); entity.modelcode = row.IsNull("modelcode") ? string.Empty : row.Field <string>("modelcode"); entity.brandcode = row.IsNull("brandcode") ? string.Empty : row.Field <string>("brandcode"); entity.prodcat = row.IsNull("prodcat") ? string.Empty : row.Field <string>("prodcat"); entity.prodline = row.IsNull("prodline") ? string.Empty : row.Field <string>("prodline"); entity.prodpricety = row.IsNull("prodpricety") ? string.Empty : row.Field <string>("prodpricety"); entity.rebtype = row.IsNull("rebtype") ? string.Empty : row.Field <string>("rebtype"); entity.rebsubty = row.IsNull("rebsubty") ? string.Empty : row.Field <string>("rebsubty"); entity.startdt = row.Field <DateTime?>("startdt"); entity.inactivefl = row.Field <bool>("inactivefl"); entity.expactivefl = row.Field <bool>("expactivefl"); entity.pricemodifier = row.IsNull("pricemodifier") ? string.Empty : row.Field <string>("pricemodifier"); entity.pdsnrecno = row.IsNull("pdsnrecno") ? 0 : row.Field <int>("pdsnrecno"); entity.iRecordlimit = row.IsNull("iRecordlimit") ? 0 : row.Field <int>("iRecordlimit"); entity.userfield = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield"); return(entity); }
/// <summary> /// Update a database row from a class /// </summary> public static void UpdateRowFromPdspnpcriteria(ref DataRow row, Pdspnpcriteria entity) { row.SetField("clevelcd", entity.clevelcd); row.SetField("vendno", entity.vendno); row.SetField("custno", entity.custno); row.SetField("shipto", entity.shipto); row.SetField("custgroup", entity.custgroup); row.SetField("custpricety", entity.custpricety); row.SetField("prod", entity.prod); row.SetField("modelcode", entity.modelcode); row.SetField("brandcode", entity.brandcode); row.SetField("prodcat", entity.prodcat); row.SetField("prodline", entity.prodline); row.SetField("prodpricety", entity.prodpricety); row.SetField("rebtype", entity.rebtype); row.SetField("rebsubty", entity.rebsubty); row.SetField("startdt", entity.startdt); row.SetField("inactivefl", entity.inactivefl); row.SetField("expactivefl", entity.expactivefl); row.SetField("pricemodifier", entity.pricemodifier); row.SetField("pdsnrecno", entity.pdsnrecno); row.SetField("iRecordlimit", entity.iRecordlimit); row.SetField("userfield", entity.userfield); }