예제 #1
0
        public static Manrebcreatecriteria BuildManrebcreatecriteriaFromRow(DataRow row)
        {
            Manrebcreatecriteria entity = new Manrebcreatecriteria();

            entity.orderno      = row.IsNull("orderno") ? 0 : row.Field <int>("orderno");
            entity.ordersuf     = row.IsNull("ordersuf") ? 0 : row.Field <int>("ordersuf");
            entity.lineno       = row.IsNull("lineno") ? 0 : row.Field <int>("lineno");
            entity.clevelcd     = row.IsNull("clevelcd") ? string.Empty : row.Field <string>("clevelcd");
            entity.prod         = row.IsNull("prod") ? string.Empty : row.Field <string>("prod");
            entity.vendno       = row.IsNull("vendno") ? decimal.Zero : row.Field <decimal>("vendno");
            entity.custno       = row.IsNull("custno") ? decimal.Zero : row.Field <decimal>("custno");
            entity.shipto       = row.IsNull("shipto") ? string.Empty : row.Field <string>("shipto");
            entity.specnstype   = row.IsNull("specnstype") ? string.Empty : row.Field <string>("specnstype");
            entity.qtyord       = row.IsNull("qtyord") ? decimal.Zero : row.Field <decimal>("qtyord");
            entity.qtyship      = row.IsNull("qtyship") ? decimal.Zero : row.Field <decimal>("qtyship");
            entity.price        = row.IsNull("price") ? decimal.Zero : row.Field <decimal>("price");
            entity.listprice    = row.IsNull("listprice") ? decimal.Zero : row.Field <decimal>("listprice");
            entity.baseprice    = row.IsNull("baseprice") ? decimal.Zero : row.Field <decimal>("baseprice");
            entity.calcpdcost   = row.IsNull("calcpdcost") ? decimal.Zero : row.Field <decimal>("calcpdcost");
            entity.netamt       = row.IsNull("netamt") ? decimal.Zero : row.Field <decimal>("netamt");
            entity.unit         = row.IsNull("unit") ? string.Empty : row.Field <string>("unit");
            entity.stkunit      = row.IsNull("stkunit") ? string.Empty : row.Field <string>("stkunit");
            entity.unitconv     = row.IsNull("unitconv") ? decimal.Zero : row.Field <decimal>("unitconv");
            entity.priceonty    = row.IsNull("priceonty") ? string.Empty : row.Field <string>("priceonty");
            entity.priceclty    = row.IsNull("priceclty") ? string.Empty : row.Field <string>("priceclty");
            entity.pricelevel   = row.IsNull("pricelevel") ? 0 : row.Field <int>("pricelevel");
            entity.icspecrecno  = row.IsNull("icspecrecno") ? 0 : row.Field <int>("icspecrecno");
            entity.pdrecno      = row.IsNull("pdrecno") ? 0 : row.Field <int>("pdrecno");
            entity.rebtype      = row.IsNull("rebtype") ? string.Empty : row.Field <string>("rebtype");
            entity.rebsubty     = row.IsNull("rebsubty") ? string.Empty : row.Field <string>("rebsubty");
            entity.rebcustty    = row.IsNull("rebcustty") ? string.Empty : row.Field <string>("rebcustty");
            entity.prodpricety  = row.IsNull("prodpricety") ? string.Empty : row.Field <string>("prodpricety");
            entity.prodline     = row.IsNull("prodline") ? string.Empty : row.Field <string>("prodline");
            entity.prodcat      = row.IsNull("prodcat") ? string.Empty : row.Field <string>("prodcat");
            entity.rebatecd     = row.IsNull("rebatecd") ? string.Empty : row.Field <string>("rebatecd");
            entity.whse         = row.IsNull("whse") ? string.Empty : row.Field <string>("whse");
            entity.startdt      = row.Field <DateTime?>("startdt");
            entity.shiptype     = row.IsNull("shiptype") ? string.Empty : row.Field <string>("shiptype");
            entity.contractNo   = row.IsNull("contractNo") ? string.Empty : row.Field <string>("contractNo");
            entity.contractLine = row.IsNull("contractLine") ? 0 : row.Field <int>("contractLine");
            entity.lcontractfl  = row.Field <bool>("lcontractfl");
            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 UpdateRowFromManrebcreatecriteria(ref DataRow row, Manrebcreatecriteria entity)
 {
     row.SetField("orderno", entity.orderno);
     row.SetField("ordersuf", entity.ordersuf);
     row.SetField("lineno", entity.lineno);
     row.SetField("clevelcd", entity.clevelcd);
     row.SetField("prod", entity.prod);
     row.SetField("vendno", entity.vendno);
     row.SetField("custno", entity.custno);
     row.SetField("shipto", entity.shipto);
     row.SetField("specnstype", entity.specnstype);
     row.SetField("qtyord", entity.qtyord);
     row.SetField("qtyship", entity.qtyship);
     row.SetField("price", entity.price);
     row.SetField("listprice", entity.listprice);
     row.SetField("baseprice", entity.baseprice);
     row.SetField("calcpdcost", entity.calcpdcost);
     row.SetField("netamt", entity.netamt);
     row.SetField("unit", entity.unit);
     row.SetField("stkunit", entity.stkunit);
     row.SetField("unitconv", entity.unitconv);
     row.SetField("priceonty", entity.priceonty);
     row.SetField("priceclty", entity.priceclty);
     row.SetField("pricelevel", entity.pricelevel);
     row.SetField("icspecrecno", entity.icspecrecno);
     row.SetField("pdrecno", entity.pdrecno);
     row.SetField("rebtype", entity.rebtype);
     row.SetField("rebsubty", entity.rebsubty);
     row.SetField("rebcustty", entity.rebcustty);
     row.SetField("prodpricety", entity.prodpricety);
     row.SetField("prodline", entity.prodline);
     row.SetField("prodcat", entity.prodcat);
     row.SetField("rebatecd", entity.rebatecd);
     row.SetField("whse", entity.whse);
     row.SetField("startdt", entity.startdt);
     row.SetField("shiptype", entity.shiptype);
     row.SetField("contractNo", entity.contractNo);
     row.SetField("contractLine", entity.contractLine);
     row.SetField("lcontractfl", entity.lcontractfl);
     row.SetField("userfield", entity.userfield);
 }