Example #1
0
 /// <summary>
 /// Update a database row from a class
 /// </summary>
 public static void UpdateRowFromAremtresults(ref DataRow row, Aremtresults entity)
 {
     row.SetField("invno", entity.invno);
     row.SetField("invsuf", entity.invsuf);
     row.SetField("invnosuf", entity.invnosuf);
     row.SetField("seqno", entity.seqno);
     row.SetField("notesfl", entity.notesfl);
     row.SetField("invdt", entity.invdt);
     row.SetField("duedt", entity.duedt);
     row.SetField("amount", entity.amount);
     row.SetField("refer", entity.refer);
     row.SetField("disputefl", entity.disputefl);
     row.SetField("custno", entity.custno);
     row.SetField("origdisc", entity.origdisc);
     row.SetField("jrnlno", entity.jrnlno);
     row.SetField("setno", entity.setno);
     row.SetField("rowid", entity.rowid.ToByteArray());
     row.SetField("userfield", entity.userfield);
 }
Example #2
0
        public static Aremtresults BuildAremtresultsFromRow(DataRow row)
        {
            Aremtresults entity = new Aremtresults();

            entity.invno     = row.IsNull("invno") ? 0 : row.Field <int>("invno");
            entity.invsuf    = row.IsNull("invsuf") ? 0 : row.Field <int>("invsuf");
            entity.invnosuf  = row.IsNull("invnosuf") ? string.Empty : row.Field <string>("invnosuf");
            entity.seqno     = row.IsNull("seqno") ? 0 : row.Field <int>("seqno");
            entity.notesfl   = row.IsNull("notesfl") ? string.Empty : row.Field <string>("notesfl");
            entity.invdt     = row.Field <DateTime?>("invdt");
            entity.duedt     = row.Field <DateTime?>("duedt");
            entity.amount    = row.IsNull("amount") ? decimal.Zero : row.Field <decimal>("amount");
            entity.refer     = row.IsNull("refer") ? string.Empty : row.Field <string>("refer");
            entity.disputefl = row.Field <bool>("disputefl");
            entity.custno    = row.IsNull("custno") ? decimal.Zero : row.Field <decimal>("custno");
            entity.origdisc  = row.IsNull("origdisc") ? decimal.Zero : row.Field <decimal>("origdisc");
            entity.jrnlno    = row.IsNull("jrnlno") ? 0 : row.Field <int>("jrnlno");
            entity.setno     = row.IsNull("setno") ? 0 : row.Field <int>("setno");
            entity.rowid     = row.Field <byte[]>("rowid").ToStringEncoded();
            entity.userfield = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield");
            return(entity);
        }