/// <summary> /// Update a database row from a class /// </summary> public static void UpdateRowFromApemtresults(ref DataRow row, Apemtresults entity) { row.SetField("apinvno", entity.apinvno); 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("invnosuf", entity.invnosuf); row.SetField("rowid", entity.rowid.ToByteArray()); row.SetField("disc", entity.disc); row.SetField("jrnlno", entity.jrnlno); row.SetField("setno", entity.setno); row.SetField("userfield", entity.userfield); }
public static Apemtresults BuildApemtresultsFromRow(DataRow row) { Apemtresults entity = new Apemtresults(); 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.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.invnosuf = row.IsNull("invnosuf") ? string.Empty : row.Field <string>("invnosuf"); entity.rowid = row.Field <byte[]>("rowid").ToStringEncoded(); entity.disc = row.IsNull("disc") ? decimal.Zero : row.Field <decimal>("disc"); entity.jrnlno = row.IsNull("jrnlno") ? 0 : row.Field <int>("jrnlno"); entity.setno = row.IsNull("setno") ? 0 : row.Field <int>("setno"); entity.userfield = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield"); return(entity); }