Esempio n. 1
0
 /// <summary>
 /// Update a database row from a class
 /// </summary>
 public static void UpdateRowFromIcirresults(ref DataRow row, Icirresults entity)
 {
     row.SetField("cono", entity.cono);
     row.SetField("whse", entity.whse);
     row.SetField("prod", entity.prod);
     row.SetField("proddesc", entity.proddesc);
     row.SetField("prodnotesfl", entity.prodnotesfl);
     row.SetField("custno", entity.custno);
     row.SetField("shipto", entity.shipto);
     row.SetField("custnm", entity.custnm);
     row.SetField("custprod", entity.custprod);
     row.SetField("qty", entity.qty);
     row.SetField("unit", entity.unit);
     row.SetField("price", entity.price);
     row.SetField("extprice", entity.extprice);
     row.SetField("orderpt", entity.orderpt);
     row.SetField("linept", entity.linept);
     row.SetField("ordqty", entity.ordqty);
     row.SetField("lastrcptdt", entity.lastrcptdt);
     row.SetField("lastinvdt", entity.lastinvdt);
     row.SetField("criticalfl", entity.criticalfl);
     row.SetField("leadtm", entity.leadtm);
     row.SetField("discamt", entity.discamt);
     row.SetField("disctype", entity.disctype);
     row.SetField("displayfl", entity.displayfl);
     row.SetField("xrefprodty", entity.xrefprodty);
     row.SetField("userfield", entity.userfield);
 }
Esempio n. 2
0
        public static Icirresults BuildIcirresultsFromRow(DataRow row)
        {
            Icirresults entity = new Icirresults();

            entity.cono        = row.IsNull("cono") ? 0 : row.Field <int>("cono");
            entity.whse        = row.IsNull("whse") ? string.Empty : row.Field <string>("whse");
            entity.prod        = row.IsNull("prod") ? string.Empty : row.Field <string>("prod");
            entity.proddesc    = row.IsNull("proddesc") ? string.Empty : row.Field <string>("proddesc");
            entity.prodnotesfl = row.IsNull("prodnotesfl") ? string.Empty : row.Field <string>("prodnotesfl");
            entity.custno      = row.IsNull("custno") ? decimal.Zero : row.Field <decimal>("custno");
            entity.shipto      = row.IsNull("shipto") ? string.Empty : row.Field <string>("shipto");
            entity.custnm      = row.IsNull("custnm") ? string.Empty : row.Field <string>("custnm");
            entity.custprod    = row.IsNull("custprod") ? string.Empty : row.Field <string>("custprod");
            entity.qty         = row.IsNull("qty") ? decimal.Zero : row.Field <decimal>("qty");
            entity.unit        = row.IsNull("unit") ? string.Empty : row.Field <string>("unit");
            entity.price       = row.IsNull("price") ? decimal.Zero : row.Field <decimal>("price");
            entity.extprice    = row.IsNull("extprice") ? decimal.Zero : row.Field <decimal>("extprice");
            entity.orderpt     = row.IsNull("orderpt") ? decimal.Zero : row.Field <decimal>("orderpt");
            entity.linept      = row.IsNull("linept") ? decimal.Zero : row.Field <decimal>("linept");
            entity.ordqty      = row.IsNull("ordqty") ? decimal.Zero : row.Field <decimal>("ordqty");
            entity.lastrcptdt  = row.Field <DateTime?>("lastrcptdt");
            entity.lastinvdt   = row.Field <DateTime?>("lastinvdt");
            entity.criticalfl  = row.Field <bool>("criticalfl");
            entity.leadtm      = row.IsNull("leadtm") ? 0 : row.Field <int>("leadtm");
            entity.discamt     = row.IsNull("discamt") ? decimal.Zero : row.Field <decimal>("discamt");
            entity.disctype    = row.Field <bool>("disctype");
            entity.displayfl   = row.Field <bool>("displayfl");
            entity.xrefprodty  = row.IsNull("xrefprodty") ? string.Empty : row.Field <string>("xrefprodty");
            entity.userfield   = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield");
            return(entity);
        }