コード例 #1
0
        public static Pdsprebateresults BuildPdsprebateresultsFromRow(DataRow row)
        {
            Pdsprebateresults entity = new Pdsprebateresults();

            entity.rebrecno       = row.IsNull("rebrecno") ? decimal.Zero : row.Field <decimal>("rebrecno");
            entity.custno         = row.IsNull("custno") ? decimal.Zero : row.Field <decimal>("custno");
            entity.custnotesfl    = row.IsNull("custnotesfl") ? string.Empty : row.Field <string>("custnotesfl");
            entity.custtype       = row.IsNull("custtype") ? string.Empty : row.Field <string>("custtype");
            entity.shiptonotesfl  = row.IsNull("shiptonotesfl") ? string.Empty : row.Field <string>("shiptonotesfl");
            entity.vendno         = row.IsNull("vendno") ? decimal.Zero : row.Field <decimal>("vendno");
            entity.vendnotesfl    = row.IsNull("vendnotesfl") ? string.Empty : row.Field <string>("vendnotesfl");
            entity.prod           = row.IsNull("prod") ? string.Empty : row.Field <string>("prod");
            entity.prodnotesfl    = row.IsNull("prodnotesfl") ? string.Empty : row.Field <string>("prodnotesfl");
            entity.custrebty      = row.IsNull("custrebty") ? string.Empty : row.Field <string>("custrebty");
            entity.levelcd        = row.IsNull("levelcd") ? string.Empty : row.Field <string>("levelcd");
            entity.clevelcd       = row.IsNull("clevelcd") ? string.Empty : row.Field <string>("clevelcd");
            entity.rebatety       = row.IsNull("rebatety") ? string.Empty : row.Field <string>("rebatety");
            entity.prodprcty      = row.IsNull("prodprcty") ? string.Empty : row.Field <string>("prodprcty");
            entity.prodline       = row.IsNull("prodline") ? string.Empty : row.Field <string>("prodline");
            entity.prodcat        = row.IsNull("prodcat") ? string.Empty : row.Field <string>("prodcat");
            entity.whse           = row.IsNull("whse") ? string.Empty : row.Field <string>("whse");
            entity.startdt        = row.Field <DateTime?>("startdt");
            entity.enddt          = row.Field <DateTime?>("enddt");
            entity.contractno     = row.IsNull("contractno") ? string.Empty : row.Field <string>("contractno");
            entity.contractlineno = row.IsNull("contractlineno") ? 0 : row.Field <int>("contractlineno");
            entity.refer          = row.IsNull("refer") ? string.Empty : row.Field <string>("refer");
            entity.cRebateDesc    = row.IsNull("cRebateDesc") ? string.Empty : row.Field <string>("cRebateDesc");
            entity.rebatecd       = row.IsNull("rebatecd") ? string.Empty : row.Field <string>("rebatecd");
            entity.cDropShipty    = row.IsNull("cDropShipty") ? string.Empty : row.Field <string>("cDropShipty");
            entity.dropshipty     = row.IsNull("dropshipty") ? string.Empty : row.Field <string>("dropshipty");
            entity.iRecordLimit   = row.IsNull("iRecordLimit") ? 0 : row.Field <int>("iRecordLimit");
            entity.pdRowid        = row.Field <byte[]>("pd_rowid").ToStringEncoded();
            entity.manualfl       = row.Field <bool>("manualfl");
            entity.custcurrency   = row.IsNull("custcurrency") ? string.Empty : row.Field <string>("custcurrency");
            entity.vendcurrency   = row.IsNull("vendcurrency") ? string.Empty : row.Field <string>("vendcurrency");
            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);
        }
コード例 #2
0
 /// <summary>
 /// Update a database row from a class
 /// </summary>
 public static void UpdateRowFromPdsprebateresults(ref DataRow row, Pdsprebateresults entity)
 {
     row.SetField("rebrecno", entity.rebrecno);
     row.SetField("custno", entity.custno);
     row.SetField("custnotesfl", entity.custnotesfl);
     row.SetField("custtype", entity.custtype);
     row.SetField("shiptonotesfl", entity.shiptonotesfl);
     row.SetField("vendno", entity.vendno);
     row.SetField("vendnotesfl", entity.vendnotesfl);
     row.SetField("prod", entity.prod);
     row.SetField("prodnotesfl", entity.prodnotesfl);
     row.SetField("custrebty", entity.custrebty);
     row.SetField("levelcd", entity.levelcd);
     row.SetField("clevelcd", entity.clevelcd);
     row.SetField("rebatety", entity.rebatety);
     row.SetField("prodprcty", entity.prodprcty);
     row.SetField("prodline", entity.prodline);
     row.SetField("prodcat", entity.prodcat);
     row.SetField("whse", entity.whse);
     row.SetField("startdt", entity.startdt);
     row.SetField("enddt", entity.enddt);
     row.SetField("contractno", entity.contractno);
     row.SetField("contractlineno", entity.contractlineno);
     row.SetField("refer", entity.refer);
     row.SetField("cRebateDesc", entity.cRebateDesc);
     row.SetField("rebatecd", entity.rebatecd);
     row.SetField("cDropShipty", entity.cDropShipty);
     row.SetField("dropshipty", entity.dropshipty);
     row.SetField("iRecordLimit", entity.iRecordLimit);
     row.SetField("pd_rowid", entity.pdRowid.ToByteArray());
     row.SetField("manualfl", entity.manualfl);
     row.SetField("custcurrency", entity.custcurrency);
     row.SetField("vendcurrency", entity.vendcurrency);
     row.SetField("price", entity.price);
     row.SetField("prccurrencyty", entity.prccurrencyty);
     row.SetField("userfield", entity.userfield);
 }