/// <summary> /// Update a database row from a class /// </summary> public static void UpdateRowFromApetlookupresults(ref DataRow row, Apetlookupresults entity) { row.SetField("apinvno", entity.apinvno); row.SetField("seqno", entity.seqno); row.SetField("notesfl", entity.notesfl); row.SetField("vendno", entity.vendno); row.SetField("vendnotesfl", entity.vendnotesfl); row.SetField("invdt", entity.invdt); row.SetField("transcd", entity.transcd); row.SetField("transcdword", entity.transcdword); row.SetField("statustype", entity.statustype); row.SetField("amount", entity.amount); row.SetField("refer", entity.refer); row.SetField("sortseqno", entity.sortseqno); row.SetField("apet-rowid", entity.apetRowid.ToByteArray()); row.SetField("userfield", entity.userfield); }
public static Apetlookupresults BuildApetlookupresultsFromRow(DataRow row) { Apetlookupresults entity = new Apetlookupresults(); entity.apinvno = row.IsNull("apinvno") ? string.Empty : row.Field <string>("apinvno"); entity.seqno = row.IsNull("seqno") ? 0 : row.Field <int>("seqno"); entity.notesfl = row.IsNull("notesfl") ? string.Empty : row.Field <string>("notesfl"); entity.vendno = row.IsNull("vendno") ? decimal.Zero : row.Field <decimal>("vendno"); entity.vendnotesfl = row.IsNull("vendnotesfl") ? string.Empty : row.Field <string>("vendnotesfl"); entity.invdt = row.Field <DateTime?>("invdt"); entity.transcd = row.IsNull("transcd") ? 0 : row.Field <int>("transcd"); entity.transcdword = row.IsNull("transcdword") ? string.Empty : row.Field <string>("transcdword"); entity.statustype = row.Field <bool>("statustype"); entity.amount = row.IsNull("amount") ? decimal.Zero : row.Field <decimal>("amount"); entity.refer = row.IsNull("refer") ? string.Empty : row.Field <string>("refer"); entity.sortseqno = row.IsNull("sortseqno") ? 0 : row.Field <int>("sortseqno"); entity.apetRowid = row.Field <byte[]>("apet-rowid").ToStringEncoded(); entity.userfield = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield"); return(entity); }