public static Pdsprebateupdcriteria BuildPdsprebateupdcriteriaFromRow(DataRow row) { Pdsprebateupdcriteria entity = new Pdsprebateupdcriteria(); entity.cLevelcd = row.IsNull("cLevelcd") ? string.Empty : row.Field <string>("cLevelcd"); entity.rebrecno = row.IsNull("rebrecno") ? 0 : row.Field <int>("rebrecno"); entity.enddt = row.Field <DateTime?>("enddt"); entity.reference = row.IsNull("reference") ? string.Empty : row.Field <string>("reference"); entity.contractno = row.IsNull("contractno") ? string.Empty : row.Field <string>("contractno"); entity.caprebfl = row.Field <bool>("caprebfl"); entity.contcostfl = row.Field <bool>("contcostfl"); entity.rebcalcty = row.IsNull("rebcalcty") ? string.Empty : row.Field <string>("rebcalcty"); entity.rebcostty = row.IsNull("rebcostty") ? string.Empty : row.Field <string>("rebcostty"); entity.marcostty = row.IsNull("marcostty") ? string.Empty : row.Field <string>("marcostty"); entity.rebdnto = row.IsNull("rebdnto") ? string.Empty : row.Field <string>("rebdnto"); entity.pricesheet = row.IsNull("pricesheet") ? string.Empty : row.Field <string>("pricesheet"); entity.priceshto = row.IsNull("priceshto") ? string.Empty : row.Field <string>("priceshto"); entity.prceffdt = row.Field <DateTime?>("prceffdt"); entity.prcefftodt = row.Field <DateTime?>("prcefftodt"); entity.rebamt = row.IsNull("rebamt") ? decimal.Zero : row.Field <decimal>("rebamt"); entity.rebpct = row.IsNull("rebpct") ? decimal.Zero : row.Field <decimal>("rebpct"); entity.unitper = row.IsNull("unitper") ? string.Empty : row.Field <string>("unitper"); entity.contractlnno = row.IsNull("contractlnno") ? 0 : row.Field <int>("contractlnno"); entity.manualfl = row.Field <bool>("manualfl"); entity.capselltypefl = row.Field <bool>("capselltypefl"); entity.capsellamount = row.IsNull("capsellamount") ? decimal.Zero : row.Field <decimal>("capsellamount"); entity.sharepct = row.IsNull("sharepct") ? 0 : row.Field <int>("sharepct"); entity.sharefl = row.Field <bool>("sharefl"); entity.user1 = row.IsNull("user1") ? string.Empty : row.Field <string>("user1"); entity.user2 = row.IsNull("user2") ? string.Empty : row.Field <string>("user2"); entity.user3 = row.IsNull("user3") ? string.Empty : row.Field <string>("user3"); entity.user4 = row.IsNull("user4") ? string.Empty : row.Field <string>("user4"); entity.user5 = row.IsNull("user5") ? string.Empty : row.Field <string>("user5"); entity.user6 = row.Field <decimal?>("user6"); entity.user7 = row.Field <decimal?>("user7"); entity.user8 = row.Field <DateTime?>("user8"); entity.user9 = row.Field <DateTime?>("user9"); entity.lCreateOpp = row.Field <bool>("lCreateOpp"); entity.price = row.IsNull("price") ? decimal.Zero : row.Field <decimal>("price"); entity.prccurrencyty = row.IsNull("prccurrencyty") ? string.Empty : row.Field <string>("prccurrencyty"); 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 UpdateRowFromPdsprebateupdcriteria(ref DataRow row, Pdsprebateupdcriteria entity) { row.SetField("cLevelcd", entity.cLevelcd); row.SetField("rebrecno", entity.rebrecno); row.SetField("enddt", entity.enddt); row.SetField("reference", entity.reference); row.SetField("contractno", entity.contractno); row.SetField("caprebfl", entity.caprebfl); row.SetField("contcostfl", entity.contcostfl); row.SetField("rebcalcty", entity.rebcalcty); row.SetField("rebcostty", entity.rebcostty); row.SetField("marcostty", entity.marcostty); row.SetField("rebdnto", entity.rebdnto); row.SetField("pricesheet", entity.pricesheet); row.SetField("priceshto", entity.priceshto); row.SetField("prceffdt", entity.prceffdt); row.SetField("prcefftodt", entity.prcefftodt); row.SetField("rebamt", entity.rebamt); row.SetField("rebpct", entity.rebpct); row.SetField("unitper", entity.unitper); row.SetField("contractlnno", entity.contractlnno); row.SetField("manualfl", entity.manualfl); row.SetField("capselltypefl", entity.capselltypefl); row.SetField("capsellamount", entity.capsellamount); row.SetField("sharepct", entity.sharepct); row.SetField("sharefl", entity.sharefl); row.SetField("user1", entity.user1); row.SetField("user2", entity.user2); row.SetField("user3", entity.user3); row.SetField("user4", entity.user4); row.SetField("user5", entity.user5); row.SetField("user6", entity.user6); row.SetField("user7", entity.user7); row.SetField("user8", entity.user8); row.SetField("user9", entity.user9); row.SetField("lCreateOpp", entity.lCreateOpp); row.SetField("price", entity.price); row.SetField("prccurrencyty", entity.prccurrencyty); row.SetField("userfield", entity.userfield); }