public static Apemmresults BuildApemmresultsFromRow(DataRow row) { Apemmresults entity = new Apemmresults(); entity.cono = row.IsNull("cono") ? 0 : row.Field <int>("cono"); entity.jrnlno = row.IsNull("jrnlno") ? 0 : row.Field <int>("jrnlno"); entity.setno = row.IsNull("setno") ? 0 : row.Field <int>("setno"); entity.vendno = row.IsNull("vendno") ? decimal.Zero : row.Field <decimal>("vendno"); entity.vendname = row.IsNull("vendname") ? string.Empty : row.Field <string>("vendname"); entity.apinvno = row.IsNull("apinvno") ? string.Empty : row.Field <string>("apinvno"); entity.amount = row.IsNull("amount") ? decimal.Zero : row.Field <decimal>("amount"); entity.manaddrfl = row.Field <bool>("manaddrfl"); entity.name = row.IsNull("name") ? string.Empty : row.Field <string>("name"); entity.addr1 = row.IsNull("addr1") ? string.Empty : row.Field <string>("addr1"); entity.addr2 = row.IsNull("addr2") ? string.Empty : row.Field <string>("addr2"); entity.addr3 = row.IsNull("addr3") ? string.Empty : row.Field <string>("addr3"); entity.city = row.IsNull("city") ? string.Empty : row.Field <string>("city"); entity.state = row.IsNull("state") ? string.Empty : row.Field <string>("state"); entity.zipcd = row.IsNull("zipcd") ? string.Empty : row.Field <string>("zipcd"); entity.statustype = row.IsNull("statustype") ? string.Empty : row.Field <string>("statustype"); entity.refer = row.IsNull("refer") ? string.Empty : row.Field <string>("refer"); entity.user1 = row.IsNull("user1") ? string.Empty : row.Field <string>("user1"); entity.user2 = row.IsNull("user2") ? string.Empty : row.Field <string>("user2"); entity.user3 = row.IsNull("user3") ? string.Empty : row.Field <string>("user3"); entity.user4 = row.IsNull("user4") ? string.Empty : row.Field <string>("user4"); entity.user5 = row.IsNull("user5") ? string.Empty : row.Field <string>("user5"); entity.user6 = row.Field <decimal?>("user6"); entity.user7 = row.Field <decimal?>("user7"); entity.user8 = row.Field <DateTime?>("user8"); entity.user9 = row.Field <DateTime?>("user9"); entity.operinit = row.IsNull("operinit") ? string.Empty : row.Field <string>("operinit"); entity.transproc = row.IsNull("transproc") ? string.Empty : row.Field <string>("transproc"); entity.transdt = row.Field <DateTime?>("transdt"); entity.transtm = row.IsNull("transtm") ? string.Empty : row.Field <string>("transtm"); entity.apetRowID = row.Field <byte[]>("apetRowID").ToStringEncoded(); entity.apsvRowID = row.Field <byte[]>("apsvRowID").ToStringEncoded(); entity.apemmRowID = row.Field <byte[]>("apemmRowID").ToStringEncoded(); return(entity); }
/// <summary> /// Update a database row from a class /// </summary> public static void UpdateRowFromApemmresults(ref DataRow row, Apemmresults entity) { row.SetField("cono", entity.cono); row.SetField("jrnlno", entity.jrnlno); row.SetField("setno", entity.setno); row.SetField("vendno", entity.vendno); row.SetField("vendname", entity.vendname); row.SetField("apinvno", entity.apinvno); row.SetField("amount", entity.amount); row.SetField("manaddrfl", entity.manaddrfl); row.SetField("name", entity.name); row.SetField("addr1", entity.addr1); row.SetField("addr2", entity.addr2); row.SetField("addr3", entity.addr3); row.SetField("city", entity.city); row.SetField("state", entity.state); row.SetField("zipcd", entity.zipcd); row.SetField("statustype", entity.statustype); row.SetField("refer", entity.refer); row.SetField("user1", entity.user1); row.SetField("user2", entity.user2); row.SetField("user3", entity.user3); row.SetField("user4", entity.user4); row.SetField("user5", entity.user5); row.SetField("user6", entity.user6); row.SetField("user7", entity.user7); row.SetField("user8", entity.user8); row.SetField("user9", entity.user9); row.SetField("operinit", entity.operinit); row.SetField("transproc", entity.transproc); row.SetField("transdt", entity.transdt); row.SetField("transtm", entity.transtm); row.SetField("apetRowID", entity.apetRowID.ToByteArray()); row.SetField("apsvRowID", entity.apsvRowID.ToByteArray()); row.SetField("apemmRowID", entity.apemmRowID.ToByteArray()); }