Пример #1
0
 /// <summary>
 /// Update a database row from a class
 /// </summary>
 public static void UpdateRowFromApemsresults(ref DataRow row, Apemsresults entity)
 {
     row.SetField("pono", entity.pono);
     row.SetField("posuf", entity.posuf);
     row.SetField("transtype", entity.transtype);
     row.SetField("stage", entity.stage);
     row.SetField("vendno", entity.vendno);
     row.SetField("enterdt", entity.enterdt);
     row.SetField("receiptdt", entity.receiptdt);
     row.SetField("lastactdt", entity.lastactdt);
     row.SetField("totinvamt", entity.totinvamt);
     row.SetField("rowid", entity.rowid.ToByteArray());
     row.SetField("userfield", entity.userfield);
 }
Пример #2
0
        public static Apemsresults BuildApemsresultsFromRow(DataRow row)
        {
            Apemsresults entity = new Apemsresults();

            entity.pono      = row.IsNull("pono") ? 0 : row.Field <int>("pono");
            entity.posuf     = row.IsNull("posuf") ? 0 : row.Field <int>("posuf");
            entity.transtype = row.IsNull("transtype") ? string.Empty : row.Field <string>("transtype");
            entity.stage     = row.IsNull("stage") ? string.Empty : row.Field <string>("stage");
            entity.vendno    = row.IsNull("vendno") ? decimal.Zero : row.Field <decimal>("vendno");
            entity.enterdt   = row.Field <DateTime?>("enterdt");
            entity.receiptdt = row.Field <DateTime?>("receiptdt");
            entity.lastactdt = row.Field <DateTime?>("lastactdt");
            entity.totinvamt = row.IsNull("totinvamt") ? decimal.Zero : row.Field <decimal>("totinvamt");
            entity.rowid     = row.Field <byte[]>("rowid").ToStringEncoded();
            entity.userfield = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield");
            return(entity);
        }