Example #1
0
        public static Oeimportdata BuildOeimportdataFromRow(DataRow row)
        {
            Oeimportdata entity = new Oeimportdata();

            entity.custno      = row.IsNull("custno") ? decimal.Zero : row.Field <decimal>("custno");
            entity.shipto      = row.IsNull("shipto") ? string.Empty : row.Field <string>("shipto");
            entity.whse        = row.IsNull("whse") ? string.Empty : row.Field <string>("whse");
            entity.ordertype   = row.IsNull("ordertype") ? string.Empty : row.Field <string>("ordertype");
            entity.custpo      = row.IsNull("custpo") ? string.Empty : row.Field <string>("custpo");
            entity.placedby    = row.IsNull("placedby") ? string.Empty : row.Field <string>("placedby");
            entity.shipviaty   = row.IsNull("shipviaty") ? string.Empty : row.Field <string>("shipviaty");
            entity.termstype   = row.IsNull("termstype") ? string.Empty : row.Field <string>("termstype");
            entity.refer       = row.IsNull("refer") ? string.Empty : row.Field <string>("refer");
            entity.reqshipdt   = row.Field <DateTime?>("reqshipdt");
            entity.shipinstr   = row.IsNull("shipinstr") ? string.Empty : row.Field <string>("shipinstr");
            entity.prod        = row.IsNull("prod") ? string.Empty : row.Field <string>("prod");
            entity.proddesc    = row.IsNull("proddesc") ? string.Empty : row.Field <string>("proddesc");
            entity.qtyord      = row.IsNull("qtyord") ? decimal.Zero : row.Field <decimal>("qtyord");
            entity.unit        = row.IsNull("unit") ? string.Empty : row.Field <string>("unit");
            entity.price       = row.IsNull("price") ? decimal.Zero : row.Field <decimal>("price");
            entity.discamt     = row.IsNull("discamt") ? decimal.Zero : row.Field <decimal>("discamt");
            entity.disctype    = row.Field <bool>("disctype");
            entity.vendno      = row.IsNull("vendno") ? decimal.Zero : row.Field <decimal>("vendno");
            entity.prodline    = row.IsNull("prodline") ? string.Empty : row.Field <string>("prodline");
            entity.prodcat     = row.IsNull("prodcat") ? string.Empty : row.Field <string>("prodcat");
            entity.prodcost    = row.IsNull("prodcost") ? decimal.Zero : row.Field <decimal>("prodcost");
            entity.tietype     = row.IsNull("tietype") ? string.Empty : row.Field <string>("tietype");
            entity.tiewhse     = row.IsNull("tiewhse") ? string.Empty : row.Field <string>("tiewhse");
            entity.dropshipfl  = row.Field <bool>("dropshipfl");
            entity.printfl     = row.Field <bool>("printfl");
            entity.requirefl   = row.Field <bool>("requirefl");
            entity.subtotalfl  = row.Field <bool>("subtotalfl");
            entity.printprfl   = row.Field <bool>("printprfl");
            entity.copycomfl   = row.Field <bool>("copycomfl");
            entity.processfl   = row.Field <bool>("processfl");
            entity.worksheetno = row.IsNull("worksheetno") ? 0 : row.Field <int>("worksheetno");
            entity.lineno      = row.IsNull("lineno") ? 0 : row.Field <int>("lineno");
            entity.seqno       = row.IsNull("seqno") ? 0 : row.Field <int>("seqno");
            entity.custprod    = row.IsNull("custprod") ? string.Empty : row.Field <string>("custprod");
            entity.name        = row.IsNull("name") ? string.Empty : row.Field <string>("name");
            entity.specnstype  = row.IsNull("specnstype") ? string.Empty : row.Field <string>("specnstype");
            entity.returnfl    = row.Field <bool>("returnfl");
            entity.manprice    = row.Field <bool>("manprice");
            entity.costoverfl  = row.Field <bool>("costoverfl");
            entity.catalogfl   = row.Field <bool>("catalogfl");
            entity.commentfl   = row.IsNull("commentfl") ? string.Empty : row.Field <string>("commentfl");
            entity.reqprod     = row.IsNull("reqprod") ? string.Empty : row.Field <string>("reqprod");
            entity.altwhse     = row.IsNull("altwhse") ? string.Empty : row.Field <string>("altwhse");
            entity.xrefprodty  = row.IsNull("xrefprodty") ? string.Empty : row.Field <string>("xrefprodty");
            entity.orderbreak  = row.IsNull("orderbreak") ? string.Empty : row.Field <string>("orderbreak");
            entity.currsymbol  = row.IsNull("currsymbol") ? string.Empty : row.Field <string>("currsymbol");
            entity.npfl        = row.Field <bool>("npfl");
            entity.nprecno     = row.IsNull("nprecno") ? 0 : row.Field <int>("nprecno");
            entity.npcd        = row.IsNull("npcd") ? string.Empty : row.Field <string>("npcd");
            entity.userfield   = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield");
            return(entity);
        }
Example #2
0
 /// <summary>
 /// Update a database row from a class
 /// </summary>
 public static void UpdateRowFromOeimportdata(ref DataRow row, Oeimportdata entity)
 {
     row.SetField("custno", entity.custno);
     row.SetField("shipto", entity.shipto);
     row.SetField("whse", entity.whse);
     row.SetField("ordertype", entity.ordertype);
     row.SetField("custpo", entity.custpo);
     row.SetField("placedby", entity.placedby);
     row.SetField("shipviaty", entity.shipviaty);
     row.SetField("termstype", entity.termstype);
     row.SetField("refer", entity.refer);
     row.SetField("reqshipdt", entity.reqshipdt);
     row.SetField("shipinstr", entity.shipinstr);
     row.SetField("prod", entity.prod);
     row.SetField("proddesc", entity.proddesc);
     row.SetField("qtyord", entity.qtyord);
     row.SetField("unit", entity.unit);
     row.SetField("price", entity.price);
     row.SetField("discamt", entity.discamt);
     row.SetField("disctype", entity.disctype);
     row.SetField("vendno", entity.vendno);
     row.SetField("prodline", entity.prodline);
     row.SetField("prodcat", entity.prodcat);
     row.SetField("prodcost", entity.prodcost);
     row.SetField("tietype", entity.tietype);
     row.SetField("tiewhse", entity.tiewhse);
     row.SetField("dropshipfl", entity.dropshipfl);
     row.SetField("printfl", entity.printfl);
     row.SetField("requirefl", entity.requirefl);
     row.SetField("subtotalfl", entity.subtotalfl);
     row.SetField("printprfl", entity.printprfl);
     row.SetField("copycomfl", entity.copycomfl);
     row.SetField("processfl", entity.processfl);
     row.SetField("worksheetno", entity.worksheetno);
     row.SetField("lineno", entity.lineno);
     row.SetField("seqno", entity.seqno);
     row.SetField("custprod", entity.custprod);
     row.SetField("name", entity.name);
     row.SetField("specnstype", entity.specnstype);
     row.SetField("returnfl", entity.returnfl);
     row.SetField("manprice", entity.manprice);
     row.SetField("costoverfl", entity.costoverfl);
     row.SetField("catalogfl", entity.catalogfl);
     row.SetField("commentfl", entity.commentfl);
     row.SetField("reqprod", entity.reqprod);
     row.SetField("altwhse", entity.altwhse);
     row.SetField("xrefprodty", entity.xrefprodty);
     row.SetField("orderbreak", entity.orderbreak);
     row.SetField("currsymbol", entity.currsymbol);
     row.SetField("npfl", entity.npfl);
     row.SetField("nprecno", entity.nprecno);
     row.SetField("npcd", entity.npcd);
     row.SetField("userfield", entity.userfield);
 }