/// <summary>
 /// Update a database row from a class
 /// </summary>
 public static void UpdateRowFromApeiinvdetpolnlist(ref DataRow row, Apeiinvdetpolnlist entity)
 {
     row.SetField("pono", entity.pono);
     row.SetField("posuf", entity.posuf);
     row.SetField("lineno", entity.lineno);
     row.SetField("shipprod", entity.shipprod);
     row.SetField("vendprod", entity.vendprod);
     row.SetField("qtyord", entity.qtyord);
     row.SetField("cost", entity.cost);
     row.SetField("poelextended", entity.poelextended);
     row.SetField("nonstockty", entity.nonstockty);
     row.SetField("poelqtyord", entity.poelqtyord);
     row.SetField("poelqtyrcv", entity.poelqtyrcv);
     row.SetField("poelnetrcv", entity.poelnetrcv);
     row.SetField("proddesc", entity.proddesc);
     row.SetField("proddesc2", entity.proddesc2);
     row.SetField("othersufqtyrcv", entity.othersufqtyrcv);
     row.SetField("othersufnetamt", entity.othersufnetamt);
     row.SetField("nextsuf", entity.nextsuf);
     row.SetField("nextsufqtyrcv", entity.nextsufqtyrcv);
     row.SetField("nextsufnetamt", entity.nextsufnetamt);
     row.SetField("serialfl", entity.serialfl);
     row.SetField("apeid-rowid", entity.apeidRowid.ToByteArray());
     row.SetField("userfield", entity.userfield);
 }
        public static Apeiinvdetpolnlist BuildApeiinvdetpolnlistFromRow(DataRow row)
        {
            Apeiinvdetpolnlist entity = new Apeiinvdetpolnlist();

            entity.pono           = row.IsNull("pono") ? 0 : row.Field <int>("pono");
            entity.posuf          = row.IsNull("posuf") ? 0 : row.Field <int>("posuf");
            entity.lineno         = row.IsNull("lineno") ? 0 : row.Field <int>("lineno");
            entity.shipprod       = row.IsNull("shipprod") ? string.Empty : row.Field <string>("shipprod");
            entity.vendprod       = row.IsNull("vendprod") ? string.Empty : row.Field <string>("vendprod");
            entity.qtyord         = row.IsNull("qtyord") ? decimal.Zero : row.Field <decimal>("qtyord");
            entity.cost           = row.IsNull("cost") ? decimal.Zero : row.Field <decimal>("cost");
            entity.poelextended   = row.IsNull("poelextended") ? decimal.Zero : row.Field <decimal>("poelextended");
            entity.nonstockty     = row.IsNull("nonstockty") ? string.Empty : row.Field <string>("nonstockty");
            entity.poelqtyord     = row.IsNull("poelqtyord") ? decimal.Zero : row.Field <decimal>("poelqtyord");
            entity.poelqtyrcv     = row.IsNull("poelqtyrcv") ? decimal.Zero : row.Field <decimal>("poelqtyrcv");
            entity.poelnetrcv     = row.IsNull("poelnetrcv") ? decimal.Zero : row.Field <decimal>("poelnetrcv");
            entity.proddesc       = row.IsNull("proddesc") ? string.Empty : row.Field <string>("proddesc");
            entity.proddesc2      = row.IsNull("proddesc2") ? string.Empty : row.Field <string>("proddesc2");
            entity.othersufqtyrcv = row.IsNull("othersufqtyrcv") ? decimal.Zero : row.Field <decimal>("othersufqtyrcv");
            entity.othersufnetamt = row.IsNull("othersufnetamt") ? decimal.Zero : row.Field <decimal>("othersufnetamt");
            entity.nextsuf        = row.IsNull("nextsuf") ? string.Empty : row.Field <string>("nextsuf");
            entity.nextsufqtyrcv  = row.IsNull("nextsufqtyrcv") ? decimal.Zero : row.Field <decimal>("nextsufqtyrcv");
            entity.nextsufnetamt  = row.IsNull("nextsufnetamt") ? decimal.Zero : row.Field <decimal>("nextsufnetamt");
            entity.serialfl       = row.Field <bool>("serialfl");
            entity.apeidRowid     = row.Field <byte[]>("apeid-rowid").ToStringEncoded();
            entity.userfield      = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield");
            return(entity);
        }