Пример #1
0
 /// <summary>
 /// Update a database row from a class
 /// </summary>
 public static void UpdateRowFromArelearetresults(ref DataRow row, Arelearetresults entity)
 {
     row.SetField("invno", entity.invno);
     row.SetField("invsuf", entity.invsuf);
     row.SetField("notesfl", entity.notesfl);
     row.SetField("seqno", entity.seqno);
     row.SetField("custno", entity.custno);
     row.SetField("custnotesfl", entity.custnotesfl);
     row.SetField("invdt", entity.invdt);
     row.SetField("transcddesc", entity.transcddesc);
     row.SetField("statustypedesc", entity.statustypedesc);
     row.SetField("amount", entity.amount);
     row.SetField("refer", entity.refer);
     row.SetField("raretid", entity.raretid.ToByteArray());
     row.SetField("userfield", entity.userfield);
 }
Пример #2
0
        public static Arelearetresults BuildArelearetresultsFromRow(DataRow row)
        {
            Arelearetresults entity = new Arelearetresults();

            entity.invno          = row.IsNull("invno") ? 0 : row.Field <int>("invno");
            entity.invsuf         = row.IsNull("invsuf") ? 0 : row.Field <int>("invsuf");
            entity.notesfl        = row.IsNull("notesfl") ? string.Empty : row.Field <string>("notesfl");
            entity.seqno          = row.IsNull("seqno") ? 0 : row.Field <int>("seqno");
            entity.custno         = row.IsNull("custno") ? decimal.Zero : row.Field <decimal>("custno");
            entity.custnotesfl    = row.IsNull("custnotesfl") ? string.Empty : row.Field <string>("custnotesfl");
            entity.invdt          = row.Field <DateTime?>("invdt");
            entity.transcddesc    = row.IsNull("transcddesc") ? string.Empty : row.Field <string>("transcddesc");
            entity.statustypedesc = row.IsNull("statustypedesc") ? string.Empty : row.Field <string>("statustypedesc");
            entity.amount         = row.IsNull("amount") ? decimal.Zero : row.Field <decimal>("amount");
            entity.refer          = row.IsNull("refer") ? string.Empty : row.Field <string>("refer");
            entity.raretid        = row.Field <byte[]>("raretid").ToStringEncoded();
            entity.userfield      = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield");
            return(entity);
        }