示例#1
0
        public static Sledgetprodlistresults BuildSledgetprodlistresultsFromRow(DataRow row)
        {
            Sledgetprodlistresults entity = new Sledgetprodlistresults();

            entity.sledrowid    = row.Field <byte[]>("sledrowid").ToStringEncoded();
            entity.prod         = row.IsNull("prod") ? string.Empty : row.Field <string>("prod");
            entity.whse         = row.IsNull("whse") ? string.Empty : row.Field <string>("whse");
            entity.statuscd     = row.IsNull("statuscd") ? string.Empty : row.Field <string>("statuscd");
            entity.action       = row.IsNull("action") ? string.Empty : row.Field <string>("action");
            entity.statustype   = row.Field <bool>("statustype");
            entity.descrip1     = row.IsNull("descrip1") ? string.Empty : row.Field <string>("descrip1");
            entity.descrip2     = row.IsNull("descrip2") ? string.Empty : row.Field <string>("descrip2");
            entity.descrip3     = row.IsNull("descrip3") ? string.Empty : row.Field <string>("descrip3");
            entity.vendno       = row.IsNull("vendno") ? decimal.Zero : row.Field <decimal>("vendno");
            entity.slpbseqno    = row.IsNull("slpbseqno") ? 0 : row.Field <int>("slpbseqno");
            entity.notesfl      = row.IsNull("notesfl") ? string.Empty : row.Field <string>("notesfl");
            entity.lookupnm     = row.IsNull("lookupnm") ? string.Empty : row.Field <string>("lookupnm");
            entity.seqno        = row.IsNull("seqno") ? 0 : row.Field <int>("seqno");
            entity.baseprice    = row.IsNull("baseprice") ? decimal.Zero : row.Field <decimal>("baseprice");
            entity.icscfl       = row.Field <bool>("icscfl");
            entity.listprice    = row.IsNull("listprice") ? decimal.Zero : row.Field <decimal>("listprice");
            entity.icspfl       = row.Field <bool>("icspfl");
            entity.stndcost     = row.IsNull("stndcost") ? decimal.Zero : row.Field <decimal>("stndcost");
            entity.icswfl       = row.Field <bool>("icswfl");
            entity.replcost     = row.IsNull("replcost") ? decimal.Zero : row.Field <decimal>("replcost");
            entity.lastcostfor  = row.IsNull("lastcostfor") ? decimal.Zero : row.Field <decimal>("lastcostfor");
            entity.prodline     = row.IsNull("prodline") ? string.Empty : row.Field <string>("prodline");
            entity.unitstock    = row.IsNull("unitstock") ? string.Empty : row.Field <string>("unitstock");
            entity.unitstnd     = row.IsNull("unitstnd") ? string.Empty : row.Field <string>("unitstnd");
            entity.prodcat      = row.IsNull("prodcat") ? string.Empty : row.Field <string>("prodcat");
            entity.termspct     = row.IsNull("termspct") ? decimal.Zero : row.Field <decimal>("termspct");
            entity.pricetype    = row.IsNull("pricetype") ? string.Empty : row.Field <string>("pricetype");
            entity.priceonty    = row.IsNull("priceonty") ? string.Empty : row.Field <string>("priceonty");
            entity.slgroup      = row.IsNull("slgroup") ? string.Empty : row.Field <string>("slgroup");
            entity.cubes        = row.IsNull("cubes") ? decimal.Zero : row.Field <decimal>("cubes");
            entity.weight       = row.IsNull("weight") ? decimal.Zero : row.Field <decimal>("weight");
            entity.effectdt     = row.Field <DateTime?>("effectdt");
            entity.costtext     = row.IsNull("costtext") ? string.Empty : row.Field <string>("costtext");
            entity.slspeccostty = row.IsNull("slspeccostty") ? string.Empty : row.Field <string>("slspeccostty");
            entity.slprccostper = row.IsNull("slprccostper") ? string.Empty : row.Field <string>("slprccostper");
            entity.morerecords  = row.Field <bool>("morerecords");
            entity.userfield    = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield");
            return(entity);
        }
示例#2
0
 /// <summary>
 /// Update a database row from a class
 /// </summary>
 public static void UpdateRowFromSledgetprodlistresults(ref DataRow row, Sledgetprodlistresults entity)
 {
     row.SetField("sledrowid", entity.sledrowid.ToByteArray());
     row.SetField("prod", entity.prod);
     row.SetField("whse", entity.whse);
     row.SetField("statuscd", entity.statuscd);
     row.SetField("action", entity.action);
     row.SetField("statustype", entity.statustype);
     row.SetField("descrip1", entity.descrip1);
     row.SetField("descrip2", entity.descrip2);
     row.SetField("descrip3", entity.descrip3);
     row.SetField("vendno", entity.vendno);
     row.SetField("slpbseqno", entity.slpbseqno);
     row.SetField("notesfl", entity.notesfl);
     row.SetField("lookupnm", entity.lookupnm);
     row.SetField("seqno", entity.seqno);
     row.SetField("baseprice", entity.baseprice);
     row.SetField("icscfl", entity.icscfl);
     row.SetField("listprice", entity.listprice);
     row.SetField("icspfl", entity.icspfl);
     row.SetField("stndcost", entity.stndcost);
     row.SetField("icswfl", entity.icswfl);
     row.SetField("replcost", entity.replcost);
     row.SetField("lastcostfor", entity.lastcostfor);
     row.SetField("prodline", entity.prodline);
     row.SetField("unitstock", entity.unitstock);
     row.SetField("unitstnd", entity.unitstnd);
     row.SetField("prodcat", entity.prodcat);
     row.SetField("termspct", entity.termspct);
     row.SetField("pricetype", entity.pricetype);
     row.SetField("priceonty", entity.priceonty);
     row.SetField("slgroup", entity.slgroup);
     row.SetField("cubes", entity.cubes);
     row.SetField("weight", entity.weight);
     row.SetField("effectdt", entity.effectdt);
     row.SetField("costtext", entity.costtext);
     row.SetField("slspeccostty", entity.slspeccostty);
     row.SetField("slprccostper", entity.slprccostper);
     row.SetField("morerecords", entity.morerecords);
     row.SetField("userfield", entity.userfield);
 }