public static Pdspvendcontinitresults BuildPdspvendcontinitresultsFromRow(DataRow row) { Pdspvendcontinitresults entity = new Pdspvendcontinitresults(); entity.levelcd = row.IsNull("levelcd") ? string.Empty : row.Field <string>("levelcd"); entity.pdrecno = row.IsNull("pdrecno") ? 0 : row.Field <int>("pdrecno"); entity.prod = row.IsNull("prod") ? string.Empty : row.Field <string>("prod"); 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.contractno = row.IsNull("contractno") ? string.Empty : row.Field <string>("contractno"); entity.startdt = row.Field <DateTime?>("startdt"); entity.unit = row.IsNull("unit") ? string.Empty : row.Field <string>("unit"); entity.vendno = row.IsNull("vendno") ? decimal.Zero : row.Field <decimal>("vendno"); entity.whse = row.IsNull("whse") ? string.Empty : row.Field <string>("whse"); entity.enddt = row.Field <DateTime?>("enddt"); entity.statusfl = row.Field <bool>("statusfl"); entity.reference = row.IsNull("reference") ? string.Empty : row.Field <string>("reference"); entity.quoteid = row.IsNull("quoteid") ? string.Empty : row.Field <string>("quoteid"); entity.currencyty = row.IsNull("currencyty") ? string.Empty : row.Field <string>("currencyty"); entity.contractpr = row.IsNull("contractpr") ? decimal.Zero : row.Field <decimal>("contractpr"); entity.custno = row.IsNull("custno") ? decimal.Zero : row.Field <decimal>("custno"); entity.custname = row.IsNull("custname") ? string.Empty : row.Field <string>("custname"); entity.shipto = row.IsNull("shipto") ? string.Empty : row.Field <string>("shipto"); entity.shiptoname = row.IsNull("shiptoname") ? string.Empty : row.Field <string>("shiptoname"); entity.maxqty = row.IsNull("maxqty") ? decimal.Zero : row.Field <decimal>("maxqty"); entity.actqty = row.IsNull("actqty") ? decimal.Zero : row.Field <decimal>("actqty"); entity.maxqtytyli = row.IsNull("maxqtytyli") ? string.Empty : row.Field <string>("maxqtytyli"); entity.maxqtytypd = row.IsNull("maxqtytypd") ? string.Empty : row.Field <string>("maxqtytypd"); entity.maxqtytysv = row.IsNull("maxqtytysv") ? string.Empty : row.Field <string>("maxqtytysv"); entity.hardmaxfl = row.Field <bool>("hardmaxfl"); entity.qtytypeli = row.IsNull("qtytypeli") ? string.Empty : row.Field <string>("qtytypeli"); entity.qtytypepd = row.IsNull("qtytypepd") ? string.Empty : row.Field <string>("qtytypepd"); entity.qtytypesv = row.IsNull("qtytypesv") ? string.Empty : row.Field <string>("qtytypesv"); 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.userfield = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield"); return(entity); }
/// <summary> /// Update a database row from a class /// </summary> public static void UpdateRowFromPdspvendcontinitresults(ref DataRow row, Pdspvendcontinitresults entity) { row.SetField("levelcd", entity.levelcd); row.SetField("pdrecno", entity.pdrecno); row.SetField("prod", entity.prod); row.SetField("prodpricety", entity.prodpricety); row.SetField("rebtype", entity.rebtype); row.SetField("rebsubty", entity.rebsubty); row.SetField("contractno", entity.contractno); row.SetField("startdt", entity.startdt); row.SetField("unit", entity.unit); row.SetField("vendno", entity.vendno); row.SetField("whse", entity.whse); row.SetField("enddt", entity.enddt); row.SetField("statusfl", entity.statusfl); row.SetField("reference", entity.reference); row.SetField("quoteid", entity.quoteid); row.SetField("currencyty", entity.currencyty); row.SetField("contractpr", entity.contractpr); row.SetField("custno", entity.custno); row.SetField("custname", entity.custname); row.SetField("shipto", entity.shipto); row.SetField("shiptoname", entity.shiptoname); row.SetField("maxqty", entity.maxqty); row.SetField("actqty", entity.actqty); row.SetField("maxqtytyli", entity.maxqtytyli); row.SetField("maxqtytypd", entity.maxqtytypd); row.SetField("maxqtytysv", entity.maxqtytysv); row.SetField("hardmaxfl", entity.hardmaxfl); row.SetField("qtytypeli", entity.qtytypeli); row.SetField("qtytypepd", entity.qtytypepd); row.SetField("qtytypesv", entity.qtytypesv); 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("userfield", entity.userfield); }