Example #1
0
 /// <summary>
 /// Update a database row from a class
 /// </summary>
 public static void UpdateRowFromOpenitem(ref DataRow row, Openitem entity)
 {
     row.SetField("invnosuf", entity.invnosuf);
     row.SetField("amount", entity.amount);
     row.SetField("currencyty", entity.currencyty);
     row.SetField("currencyty-hidden", entity.currencytyHidden);
     row.SetField("invdt", entity.invdt);
     row.SetField("postdt", entity.postdt);
     row.SetField("disputefl", entity.disputefl);
     row.SetField("disputefl-hidden", entity.disputeflHidden);
     row.SetField("duedt", entity.duedt);
     row.SetField("duedays", entity.duedays);
     row.SetField("discdt", entity.discdt);
     row.SetField("discdt-hidden", entity.discdtHidden);
     row.SetField("discdays", entity.discdays);
     row.SetField("discdays-hidden", entity.discdaysHidden);
     row.SetField("discpct", entity.discpct);
     row.SetField("discpct-hidden", entity.discpctHidden);
     row.SetField("discpctval", entity.discpctval);
     row.SetField("discpctval-hidden", entity.discpctvalHidden);
     row.SetField("origdisc", entity.origdisc);
     row.SetField("origdisc-hidden", entity.origdiscHidden);
     row.SetField("dollar", entity.dollar);
     row.SetField("dollar-hidden", entity.dollarHidden);
     row.SetField("refer", entity.refer);
     row.SetField("rowid-openitem", entity.rowidOpenitem.ToByteArray());
     row.SetField("userfield", entity.userfield);
 }
Example #2
0
        public static Openitem BuildOpenitemFromRow(DataRow row)
        {
            Openitem entity = new Openitem();

            entity.invnosuf         = row.IsNull("invnosuf") ? string.Empty : row.Field <string>("invnosuf");
            entity.amount           = row.IsNull("amount") ? decimal.Zero : row.Field <decimal>("amount");
            entity.currencyty       = row.IsNull("currencyty") ? string.Empty : row.Field <string>("currencyty");
            entity.currencytyHidden = row.Field <bool>("currencyty-hidden");
            entity.invdt            = row.Field <DateTime?>("invdt");
            entity.postdt           = row.Field <DateTime?>("postdt");
            entity.disputefl        = row.Field <bool>("disputefl");
            entity.disputeflHidden  = row.Field <bool>("disputefl-hidden");
            entity.duedt            = row.Field <DateTime?>("duedt");
            entity.duedays          = row.IsNull("duedays") ? 0 : row.Field <int>("duedays");
            entity.discdt           = row.Field <DateTime?>("discdt");
            entity.discdtHidden     = row.Field <bool>("discdt-hidden");
            entity.discdays         = row.IsNull("discdays") ? 0 : row.Field <int>("discdays");
            entity.discdaysHidden   = row.Field <bool>("discdays-hidden");
            entity.discpct          = row.IsNull("discpct") ? decimal.Zero : row.Field <decimal>("discpct");
            entity.discpctHidden    = row.Field <bool>("discpct-hidden");
            entity.discpctval       = row.IsNull("discpctval") ? string.Empty : row.Field <string>("discpctval");
            entity.discpctvalHidden = row.Field <bool>("discpctval-hidden");
            entity.origdisc         = row.IsNull("origdisc") ? decimal.Zero : row.Field <decimal>("origdisc");
            entity.origdiscHidden   = row.Field <bool>("origdisc-hidden");
            entity.dollar           = row.IsNull("dollar") ? string.Empty : row.Field <string>("dollar");
            entity.dollarHidden     = row.Field <bool>("dollar-hidden");
            entity.refer            = row.IsNull("refer") ? string.Empty : row.Field <string>("refer");
            entity.rowidOpenitem    = row.Field <byte[]>("rowid-openitem").ToStringEncoded();
            entity.userfield        = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield");
            return(entity);
        }