Example #1
0
 /// <summary>
 /// Update a database row from a class
 /// </summary>
 public static void UpdateRowFromLoadpotallysingle(ref DataRow row, Loadpotallysingle entity)
 {
     row.SetField("qtyreq", entity.qtyreq);
     row.SetField("unit", entity.unit);
     row.SetField("price", entity.price);
     row.SetField("prod", entity.prod);
     row.SetField("proddesc", entity.proddesc);
     row.SetField("qtyact", entity.qtyact);
     row.SetField("qtybf", entity.qtybf);
     row.SetField("adjfactor", entity.adjfactor);
     row.SetField("adjfactorhidden", entity.adjfactorhidden);
     row.SetField("cUnitStock", entity.cUnitStock);
     row.SetField("lUnitConv", entity.lUnitConv);
     row.SetField("lRandomMix", entity.lRandomMix);
     row.SetField("lMemoMix", entity.lMemoMix);
     row.SetField("lRecalc", entity.lRecalc);
     row.SetField("lBundleFl", entity.lBundleFl);
     row.SetField("btnmodifyenabled", entity.btnmodifyenabled);
     row.SetField("btnaddenabled", entity.btnaddenabled);
     row.SetField("btndeleteenabled", entity.btndeleteenabled);
     row.SetField("btncalculateenabled", entity.btncalculateenabled);
     row.SetField("qtyreqenabled", entity.qtyreqenabled);
     row.SetField("unitenabled", entity.unitenabled);
     row.SetField("priceenabled", entity.priceenabled);
     row.SetField("qtyordenabled", entity.qtyordenabled);
     row.SetField("userfield", entity.userfield);
 }
Example #2
0
        public static Loadpotallysingle BuildLoadpotallysingleFromRow(DataRow row)
        {
            Loadpotallysingle entity = new Loadpotallysingle();

            entity.qtyreq              = row.IsNull("qtyreq") ? decimal.Zero : row.Field <decimal>("qtyreq");
            entity.unit                = row.IsNull("unit") ? string.Empty : row.Field <string>("unit");
            entity.price               = row.IsNull("price") ? decimal.Zero : row.Field <decimal>("price");
            entity.prod                = row.IsNull("prod") ? string.Empty : row.Field <string>("prod");
            entity.proddesc            = row.IsNull("proddesc") ? string.Empty : row.Field <string>("proddesc");
            entity.qtyact              = row.IsNull("qtyact") ? decimal.Zero : row.Field <decimal>("qtyact");
            entity.qtybf               = row.IsNull("qtybf") ? decimal.Zero : row.Field <decimal>("qtybf");
            entity.adjfactor           = row.IsNull("adjfactor") ? decimal.Zero : row.Field <decimal>("adjfactor");
            entity.adjfactorhidden     = row.Field <bool>("adjfactorhidden");
            entity.cUnitStock          = row.IsNull("cUnitStock") ? string.Empty : row.Field <string>("cUnitStock");
            entity.lUnitConv           = row.Field <bool>("lUnitConv");
            entity.lRandomMix          = row.Field <bool>("lRandomMix");
            entity.lMemoMix            = row.Field <bool>("lMemoMix");
            entity.lRecalc             = row.Field <bool>("lRecalc");
            entity.lBundleFl           = row.Field <bool>("lBundleFl");
            entity.btnmodifyenabled    = row.Field <bool>("btnmodifyenabled");
            entity.btnaddenabled       = row.Field <bool>("btnaddenabled");
            entity.btndeleteenabled    = row.Field <bool>("btndeleteenabled");
            entity.btncalculateenabled = row.Field <bool>("btncalculateenabled");
            entity.qtyreqenabled       = row.Field <bool>("qtyreqenabled");
            entity.unitenabled         = row.Field <bool>("unitenabled");
            entity.priceenabled        = row.Field <bool>("priceenabled");
            entity.qtyordenabled       = row.Field <bool>("qtyordenabled");
            entity.userfield           = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield");
            return(entity);
        }