public static Apivcreatetransresults BuildApivcreatetransresultsFromRow(DataRow row) { Apivcreatetransresults entity = new Apivcreatetransresults(); entity.invdt = row.Field <DateTime?>("invdt"); entity.invdtsort = row.Field <DateTime?>("invdtsort"); entity.apinvno = row.IsNull("apinvno") ? string.Empty : row.Field <string>("apinvno"); entity.apinvnosuf = row.IsNull("apinvnosuf") ? 0 : row.Field <int>("apinvnosuf"); entity.notesfl = row.IsNull("notesfl") ? string.Empty : row.Field <string>("notesfl"); entity.vendno = row.IsNull("vendno") ? decimal.Zero : row.Field <decimal>("vendno"); entity.checkno = row.IsNull("checkno") ? decimal.Zero : row.Field <decimal>("checkno"); entity.amount = row.IsNull("amount") ? decimal.Zero : row.Field <decimal>("amount"); entity.apsvnotesfl = row.IsNull("apsvnotesfl") ? string.Empty : row.Field <string>("apsvnotesfl"); entity.disputeflag = row.IsNull("disputeflag") ? string.Empty : row.Field <string>("disputeflag"); entity.transcd = row.IsNull("transcd") ? string.Empty : row.Field <string>("transcd"); entity.transcdsort = row.IsNull("transcdsort") ? 0 : row.Field <int>("transcdsort"); entity.seqno = row.IsNull("seqno") ? 0 : row.Field <int>("seqno"); entity.manaddress = row.IsNull("manaddress") ? string.Empty : row.Field <string>("manaddress"); entity.statustype = row.IsNull("statustype") ? string.Empty : row.Field <string>("statustype"); entity.refer = row.IsNull("refer") ? string.Empty : row.Field <string>("refer"); entity.discountamount = row.IsNull("discountamount") ? decimal.Zero : row.Field <decimal>("discountamount"); entity.amountdue = row.IsNull("amountdue") ? decimal.Zero : row.Field <decimal>("amountdue"); entity.ponumber = row.IsNull("ponumber") ? string.Empty : row.Field <string>("ponumber"); entity.ponotesfl = row.IsNull("ponotesfl") ? string.Empty : row.Field <string>("ponotesfl"); entity.jrnlno = row.IsNull("jrnlno") ? 0 : row.Field <int>("jrnlno"); entity.setno = row.IsNull("setno") ? 0 : row.Field <int>("setno"); entity.bacsref = row.IsNull("bacsref") ? string.Empty : row.Field <string>("bacsref"); 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.rowidApet = row.Field <byte[]>("rowid-apet").ToStringEncoded(); entity.npclaimno = row.IsNull("npclaimno") ? string.Empty : row.Field <string>("npclaimno"); entity.userfield = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield"); entity.achinvno = row.IsNull("achinvno") ? string.Empty : row.Field <string>("achinvno"); entity.achinvsuf = row.IsNull("achinvsuf") ? 0 : row.Field <int>("achinvsuf"); entity.achbankno = row.IsNull("achbankno") ? 0 : row.Field <int>("achbankno"); return(entity); }
/// <summary> /// Update a database row from a class /// </summary> public static void UpdateRowFromApivcreatetransresults(ref DataRow row, Apivcreatetransresults entity) { row.SetField("invdt", entity.invdt); row.SetField("invdtsort", entity.invdtsort); row.SetField("apinvno", entity.apinvno); row.SetField("apinvnosuf", entity.apinvnosuf); row.SetField("notesfl", entity.notesfl); row.SetField("vendno", entity.vendno); row.SetField("checkno", entity.checkno); row.SetField("amount", entity.amount); row.SetField("apsvnotesfl", entity.apsvnotesfl); row.SetField("disputeflag", entity.disputeflag); row.SetField("transcd", entity.transcd); row.SetField("transcdsort", entity.transcdsort); row.SetField("seqno", entity.seqno); row.SetField("manaddress", entity.manaddress); row.SetField("statustype", entity.statustype); row.SetField("refer", entity.refer); row.SetField("discountamount", entity.discountamount); row.SetField("amountdue", entity.amountdue); row.SetField("ponumber", entity.ponumber); row.SetField("ponotesfl", entity.ponotesfl); row.SetField("jrnlno", entity.jrnlno); row.SetField("setno", entity.setno); row.SetField("bacsref", entity.bacsref); 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("rowid-apet", entity.rowidApet.ToByteArray()); row.SetField("npclaimno", entity.npclaimno); row.SetField("userfield", entity.userfield); row.SetField("achinvno", entity.achinvno); row.SetField("achinvsuf", entity.achinvsuf); row.SetField("achbankno", entity.achbankno); }