Beispiel #1
0
        public static Pdspvendinitresults BuildPdspvendinitresultsFromRow(DataRow row)
        {
            Pdspvendinitresults entity = new Pdspvendinitresults();

            entity.clevelcd   = row.IsNull("clevelcd") ? string.Empty : row.Field <string>("clevelcd");
            entity.prod       = row.IsNull("prod") ? string.Empty : row.Field <string>("prod");
            entity.prodDesc   = row.IsNull("prodDesc") ? string.Empty : row.Field <string>("prodDesc");
            entity.vendno     = row.IsNull("vendno") ? decimal.Zero : row.Field <decimal>("vendno");
            entity.vendorName = row.IsNull("vendorName") ? string.Empty : row.Field <string>("vendorName");
            entity.startdt    = row.Field <DateTime?>("startdt");
            entity.enddt      = row.Field <DateTime?>("enddt");
            entity.statusfl   = row.Field <bool>("statusfl");
            entity.reference  = row.IsNull("reference") ? string.Empty : row.Field <string>("reference");
            entity.vendorpr   = row.IsNull("vendorpr") ? decimal.Zero : row.Field <decimal>("vendorpr");
            entity.currencyty = row.IsNull("currencyty") ? string.Empty : row.Field <string>("currencyty");
            entity.buytypeli  = row.IsNull("buytypeli") ? string.Empty : row.Field <string>("buytypeli");
            entity.buytypepd  = row.IsNull("buytypepd") ? string.Empty : row.Field <string>("buytypepd");
            entity.buytypesv  = row.IsNull("buytypesv") ? string.Empty : row.Field <string>("buytypesv");
            entity.prcmult1   = row.IsNull("prcmult1") ? decimal.Zero : row.Field <decimal>("prcmult1");
            entity.prcmult2   = row.IsNull("prcmult2") ? decimal.Zero : row.Field <decimal>("prcmult2");
            entity.prcmult3   = row.IsNull("prcmult3") ? decimal.Zero : row.Field <decimal>("prcmult3");
            entity.prcmult4   = row.IsNull("prcmult4") ? decimal.Zero : row.Field <decimal>("prcmult4");
            entity.prcmult5   = row.IsNull("prcmult5") ? decimal.Zero : row.Field <decimal>("prcmult5");
            entity.prcmult6   = row.IsNull("prcmult6") ? decimal.Zero : row.Field <decimal>("prcmult6");
            entity.prcmult7   = row.IsNull("prcmult7") ? decimal.Zero : row.Field <decimal>("prcmult7");
            entity.prcmult8   = row.IsNull("prcmult8") ? decimal.Zero : row.Field <decimal>("prcmult8");
            entity.prcmult9   = row.IsNull("prcmult9") ? decimal.Zero : row.Field <decimal>("prcmult9");
            entity.qtybrk1    = row.IsNull("qtybrk1") ? 0 : row.Field <int>("qtybrk1");
            entity.qtybrk2    = row.IsNull("qtybrk2") ? 0 : row.Field <int>("qtybrk2");
            entity.qtybrk3    = row.IsNull("qtybrk3") ? 0 : row.Field <int>("qtybrk3");
            entity.qtybrk4    = row.IsNull("qtybrk4") ? 0 : row.Field <int>("qtybrk4");
            entity.qtybrk5    = row.IsNull("qtybrk5") ? 0 : row.Field <int>("qtybrk5");
            entity.qtybrk6    = row.IsNull("qtybrk6") ? 0 : row.Field <int>("qtybrk6");
            entity.qtybrk7    = row.IsNull("qtybrk7") ? 0 : row.Field <int>("qtybrk7");
            entity.qtybrk8    = row.IsNull("qtybrk8") ? 0 : row.Field <int>("qtybrk8");
            entity.prcdisc1   = row.IsNull("prcdisc1") ? decimal.Zero : row.Field <decimal>("prcdisc1");
            entity.prcdisc2   = row.IsNull("prcdisc2") ? decimal.Zero : row.Field <decimal>("prcdisc2");
            entity.prcdisc3   = row.IsNull("prcdisc3") ? decimal.Zero : row.Field <decimal>("prcdisc3");
            entity.prcdisc4   = row.IsNull("prcdisc4") ? decimal.Zero : row.Field <decimal>("prcdisc4");
            entity.prcdisc5   = row.IsNull("prcdisc5") ? decimal.Zero : row.Field <decimal>("prcdisc5");
            entity.prcdisc6   = row.IsNull("prcdisc6") ? decimal.Zero : row.Field <decimal>("prcdisc6");
            entity.prcdisc7   = row.IsNull("prcdisc7") ? decimal.Zero : row.Field <decimal>("prcdisc7");
            entity.prcdisc8   = row.IsNull("prcdisc8") ? decimal.Zero : row.Field <decimal>("prcdisc8");
            entity.prcdisc9   = row.IsNull("prcdisc9") ? decimal.Zero : row.Field <decimal>("prcdisc9");
            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);
        }
Beispiel #2
0
 /// <summary>
 /// Update a database row from a class
 /// </summary>
 public static void UpdateRowFromPdspvendinitresults(ref DataRow row, Pdspvendinitresults entity)
 {
     row.SetField("clevelcd", entity.clevelcd);
     row.SetField("prod", entity.prod);
     row.SetField("prodDesc", entity.prodDesc);
     row.SetField("vendno", entity.vendno);
     row.SetField("vendorName", entity.vendorName);
     row.SetField("startdt", entity.startdt);
     row.SetField("enddt", entity.enddt);
     row.SetField("statusfl", entity.statusfl);
     row.SetField("reference", entity.reference);
     row.SetField("vendorpr", entity.vendorpr);
     row.SetField("currencyty", entity.currencyty);
     row.SetField("buytypeli", entity.buytypeli);
     row.SetField("buytypepd", entity.buytypepd);
     row.SetField("buytypesv", entity.buytypesv);
     row.SetField("prcmult1", entity.prcmult1);
     row.SetField("prcmult2", entity.prcmult2);
     row.SetField("prcmult3", entity.prcmult3);
     row.SetField("prcmult4", entity.prcmult4);
     row.SetField("prcmult5", entity.prcmult5);
     row.SetField("prcmult6", entity.prcmult6);
     row.SetField("prcmult7", entity.prcmult7);
     row.SetField("prcmult8", entity.prcmult8);
     row.SetField("prcmult9", entity.prcmult9);
     row.SetField("qtybrk1", entity.qtybrk1);
     row.SetField("qtybrk2", entity.qtybrk2);
     row.SetField("qtybrk3", entity.qtybrk3);
     row.SetField("qtybrk4", entity.qtybrk4);
     row.SetField("qtybrk5", entity.qtybrk5);
     row.SetField("qtybrk6", entity.qtybrk6);
     row.SetField("qtybrk7", entity.qtybrk7);
     row.SetField("qtybrk8", entity.qtybrk8);
     row.SetField("prcdisc1", entity.prcdisc1);
     row.SetField("prcdisc2", entity.prcdisc2);
     row.SetField("prcdisc3", entity.prcdisc3);
     row.SetField("prcdisc4", entity.prcdisc4);
     row.SetField("prcdisc5", entity.prcdisc5);
     row.SetField("prcdisc6", entity.prcdisc6);
     row.SetField("prcdisc7", entity.prcdisc7);
     row.SetField("prcdisc8", entity.prcdisc8);
     row.SetField("prcdisc9", entity.prcdisc9);
     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);
 }