/// <summary> /// Update a database row from a class /// </summary> public static void UpdateRowFromAreceworeport(ref DataRow row, Areceworeport entity) { row.SetField("cono", entity.cono); row.SetField("operinit", entity.operinit); row.SetField("jrnlno", entity.jrnlno); row.SetField("invnosuffix", entity.invnosuffix); row.SetField("invsuf", entity.invsuf); row.SetField("invno", entity.invno); row.SetField("seqno", entity.seqno); row.SetField("account", entity.account); row.SetField("amount", entity.amount); row.SetField("acctname", entity.acctname); row.SetField("origtaxamt", entity.origtaxamt); row.SetField("taxexemptamt", entity.taxexemptamt); row.SetField("origbaseamt", entity.origbaseamt); row.SetField("adjbaseamt", entity.adjbaseamt); row.SetField("outputty", entity.outputty); row.SetField("sourcecd", entity.sourcecd); row.SetField("lastseqno", entity.lastseqno); row.SetField("aretid", entity.aretid); row.SetField("creditwofl", entity.creditwofl); row.SetField("custno", entity.custno); row.SetField("glnotesfl", entity.glnotesfl); row.SetField("arettid", entity.arettid); row.SetField("taxlevel", entity.taxlevel); row.SetField("webuifilter", entity.webuifilter); row.SetField("selectedfl", entity.selectedfl); row.SetField("areleworowid", entity.areleworowid.ToByteArray()); row.SetField("userfield", entity.userfield); }
public static Areceworeport BuildAreceworeportFromRow(DataRow row) { Areceworeport entity = new Areceworeport(); entity.cono = row.IsNull("cono") ? 0 : row.Field <int>("cono"); entity.operinit = row.IsNull("operinit") ? string.Empty : row.Field <string>("operinit"); entity.jrnlno = row.IsNull("jrnlno") ? string.Empty : row.Field <string>("jrnlno"); entity.invnosuffix = row.IsNull("invnosuffix") ? string.Empty : row.Field <string>("invnosuffix"); entity.invsuf = row.IsNull("invsuf") ? string.Empty : row.Field <string>("invsuf"); entity.invno = row.IsNull("invno") ? string.Empty : row.Field <string>("invno"); entity.seqno = row.IsNull("seqno") ? string.Empty : row.Field <string>("seqno"); entity.account = row.IsNull("account") ? string.Empty : row.Field <string>("account"); entity.amount = row.IsNull("amount") ? decimal.Zero : row.Field <decimal>("amount"); entity.acctname = row.IsNull("acctname") ? string.Empty : row.Field <string>("acctname"); entity.origtaxamt = row.IsNull("origtaxamt") ? decimal.Zero : row.Field <decimal>("origtaxamt"); entity.taxexemptamt = row.IsNull("taxexemptamt") ? decimal.Zero : row.Field <decimal>("taxexemptamt"); entity.origbaseamt = row.IsNull("origbaseamt") ? decimal.Zero : row.Field <decimal>("origbaseamt"); entity.adjbaseamt = row.IsNull("adjbaseamt") ? decimal.Zero : row.Field <decimal>("adjbaseamt"); entity.outputty = row.IsNull("outputty") ? string.Empty : row.Field <string>("outputty"); entity.sourcecd = row.IsNull("sourcecd") ? 0 : row.Field <int>("sourcecd"); entity.lastseqno = row.IsNull("lastseqno") ? decimal.Zero : row.Field <decimal>("lastseqno"); entity.aretid = row.IsNull("aretid") ? 0 : row.Field <long>("aretid"); entity.creditwofl = row.Field <bool>("creditwofl"); entity.custno = row.IsNull("custno") ? string.Empty : row.Field <string>("custno"); entity.glnotesfl = row.IsNull("glnotesfl") ? string.Empty : row.Field <string>("glnotesfl"); entity.arettid = row.IsNull("arettid") ? 0 : row.Field <long>("arettid"); entity.taxlevel = row.IsNull("taxlevel") ? 0 : row.Field <int>("taxlevel"); entity.webuifilter = row.IsNull("webuifilter") ? string.Empty : row.Field <string>("webuifilter"); entity.selectedfl = row.Field <bool>("selectedfl"); entity.areleworowid = row.Field <byte[]>("areleworowid").ToStringEncoded(); entity.userfield = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield"); return(entity); }