Example #1
0
 /// <summary>
 /// Update a database row from a class
 /// </summary>
 public static void UpdateRowFromApsvaddtoken(ref DataRow row, Apsvaddtoken entity)
 {
     row.SetField("acctno", entity.acctno);
     row.SetField("cono", entity.cono);
     row.SetField("createdt", entity.createdt);
     row.SetField("vendno", entity.vendno);
     row.SetField("notesfl", entity.notesfl);
     row.SetField("name", entity.name);
     row.SetField("seqno", entity.seqno);
     row.SetField("apsvrowid", entity.apsvrowid.ToByteArray());
     row.SetField("deletefl", entity.deletefl);
     row.SetField("token", entity.token);
     row.SetField("userfield", entity.userfield);
 }
Example #2
0
        public static Apsvaddtoken BuildApsvaddtokenFromRow(DataRow row)
        {
            Apsvaddtoken entity = new Apsvaddtoken();

            entity.acctno    = row.IsNull("acctno") ? string.Empty : row.Field <string>("acctno");
            entity.cono      = row.IsNull("cono") ? 0 : row.Field <int>("cono");
            entity.createdt  = row.Field <DateTime?>("createdt");
            entity.vendno    = row.IsNull("vendno") ? decimal.Zero : row.Field <decimal>("vendno");
            entity.notesfl   = row.IsNull("notesfl") ? string.Empty : row.Field <string>("notesfl");
            entity.name      = row.IsNull("name") ? string.Empty : row.Field <string>("name");
            entity.seqno     = row.IsNull("seqno") ? 0 : row.Field <int>("seqno");
            entity.apsvrowid = row.Field <byte[]>("apsvrowid").ToStringEncoded();
            entity.deletefl  = row.Field <bool>("deletefl");
            entity.token     = row.IsNull("token") ? string.Empty : row.Field <string>("token");
            entity.userfield = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield");
            return(entity);
        }