public static Areceglobaldata BuildAreceglobaldataFromRow(DataRow row) { Areceglobaldata entity = new Areceglobaldata(); entity.cono = row.IsNull("cono") ? 0 : row.Field <int>("cono"); entity.oper = row.IsNull("oper") ? string.Empty : row.Field <string>("oper"); entity.amount = row.IsNull("amount") ? decimal.Zero : row.Field <decimal>("amount"); entity.arcrdiscfl = row.Field <bool>("arcrdiscfl"); entity.bankfromcust = row.Field <bool>("bankfromcust"); entity.bankno = row.IsNull("bankno") ? 0 : row.Field <int>("bankno"); entity.checkno = row.IsNull("checkno") ? 0 : row.Field <int>("checkno"); entity.ckAmountPosted = row.IsNull("ck-amount-posted") ? decimal.Zero : row.Field <decimal>("ck-amount-posted"); entity.codmcfinalupdtanswer = row.Field <bool>("codmcfinalupdtanswer"); entity.codmcfinalupdtasked = row.Field <bool>("codmcfinalupdtasked"); entity.codmcfinalupdtmode = row.Field <bool>("codmcfinalupdtmode"); entity.credits = row.Field <bool>("credits"); entity.curexrate = row.IsNull("curexrate") ? decimal.Zero : row.Field <decimal>("curexrate"); entity.currencyty = row.IsNull("currencyty") ? string.Empty : row.Field <string>("currencyty"); entity.currstage = row.IsNull("currstage") ? 0 : row.Field <int>("currstage"); entity.custbal = row.IsNull("custbal") ? decimal.Zero : row.Field <decimal>("custbal"); entity.custname = row.IsNull("custname") ? string.Empty : row.Field <string>("custname"); entity.custno = row.IsNull("custno") ? decimal.Zero : row.Field <decimal>("custno"); entity.dbfl = row.Field <bool>("dbfl"); entity.displayjournalmenuenabled = row.Field <bool>("displayjournalmenuenabled"); entity.divno = row.IsNull("divno") ? 0 : row.Field <int>("divno"); entity.firstSplitCkfl = row.Field <bool>("first-split-ckfl"); entity.frate = row.IsNull("frate") ? decimal.Zero : row.Field <decimal>("frate"); entity.groupname = row.IsNull("groupname") ? string.Empty : row.Field <string>("groupname"); entity.groupno = row.IsNull("groupno") ? string.Empty : row.Field <string>("groupno"); entity.invoice = row.IsNull("invoice") ? 0 : row.Field <int>("invoice"); entity.invsuffix = row.IsNull("invsuffix") ? 0 : row.Field <int>("invsuffix"); entity.jrnlno = row.IsNull("jrnlno") ? 0 : row.Field <int>("jrnlno"); entity.lChrecfl = row.Field <bool>("l-chrecfl"); entity.logseq = row.Field <bool>("logseq"); entity.newpageselected = row.Field <bool>("newpageselected"); entity.numcredits = row.IsNull("numcredits") ? 0 : row.Field <int>("numcredits"); entity.numinvoices = row.IsNull("numinvoices") ? 0 : row.Field <int>("numinvoices"); entity.oPosttype = row.IsNull("o-posttype") ? string.Empty : row.Field <string>("o-posttype"); entity.onhold = row.Field <bool>("onhold"); entity.pageno = row.IsNull("pageno") ? 0 : row.Field <int>("pageno"); entity.perfisc = row.IsNull("perfisc") ? 0 : row.Field <int>("perfisc"); entity.postdt = row.Field <DateTime?>("postdt"); entity.posttype = row.IsNull("posttype") ? string.Empty : row.Field <string>("posttype"); entity.proofAcctnoPost = row.IsNull("proof-acctno-post") ? decimal.Zero : row.Field <decimal>("proof-acctno-post"); entity.proofAmtPosted = row.IsNull("proof-amt-posted") ? decimal.Zero : row.Field <decimal>("proof-amt-posted"); entity.proofDeptnoPost = row.IsNull("proof-deptno-post") ? decimal.Zero : row.Field <decimal>("proof-deptno-post"); entity.proofDivnoPost = row.IsNull("proof-divno-post") ? decimal.Zero : row.Field <decimal>("proof-divno-post"); entity.proofSubnoPost = row.IsNull("proof-subno-post") ? decimal.Zero : row.Field <decimal>("proof-subno-post"); entity.pymttranscd = row.IsNull("pymttranscd") ? string.Empty : row.Field <string>("pymttranscd"); entity.shipto = row.IsNull("shipto") ? string.Empty : row.Field <string>("shipto"); entity.split = row.Field <bool>("split"); entity.splitproof = row.IsNull("splitproof") ? decimal.Zero : row.Field <decimal>("splitproof"); entity.unappliedCst = row.IsNull("unapplied-cst") ? decimal.Zero : row.Field <decimal>("unapplied-cst"); entity.unearnfl = row.Field <bool>("unearnfl"); entity.updatedone = row.Field <bool>("updatedone"); entity.wolimit = row.IsNull("wolimit") ? decimal.Zero : row.Field <decimal>("wolimit"); entity.userfield = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield"); return(entity); }
/// <summary> /// Update a database row from a class /// </summary> public static void UpdateRowFromAreceglobaldata(ref DataRow row, Areceglobaldata entity) { row.SetField("cono", entity.cono); row.SetField("oper", entity.oper); row.SetField("amount", entity.amount); row.SetField("arcrdiscfl", entity.arcrdiscfl); row.SetField("bankfromcust", entity.bankfromcust); row.SetField("bankno", entity.bankno); row.SetField("checkno", entity.checkno); row.SetField("ck-amount-posted", entity.ckAmountPosted); row.SetField("codmcfinalupdtanswer", entity.codmcfinalupdtanswer); row.SetField("codmcfinalupdtasked", entity.codmcfinalupdtasked); row.SetField("codmcfinalupdtmode", entity.codmcfinalupdtmode); row.SetField("credits", entity.credits); row.SetField("curexrate", entity.curexrate); row.SetField("currencyty", entity.currencyty); row.SetField("currstage", entity.currstage); row.SetField("custbal", entity.custbal); row.SetField("custname", entity.custname); row.SetField("custno", entity.custno); row.SetField("dbfl", entity.dbfl); row.SetField("displayjournalmenuenabled", entity.displayjournalmenuenabled); row.SetField("divno", entity.divno); row.SetField("first-split-ckfl", entity.firstSplitCkfl); row.SetField("frate", entity.frate); row.SetField("groupname", entity.groupname); row.SetField("groupno", entity.groupno); row.SetField("invoice", entity.invoice); row.SetField("invsuffix", entity.invsuffix); row.SetField("jrnlno", entity.jrnlno); row.SetField("l-chrecfl", entity.lChrecfl); row.SetField("logseq", entity.logseq); row.SetField("newpageselected", entity.newpageselected); row.SetField("numcredits", entity.numcredits); row.SetField("numinvoices", entity.numinvoices); row.SetField("o-posttype", entity.oPosttype); row.SetField("onhold", entity.onhold); row.SetField("pageno", entity.pageno); row.SetField("perfisc", entity.perfisc); row.SetField("postdt", entity.postdt); row.SetField("posttype", entity.posttype); row.SetField("proof-acctno-post", entity.proofAcctnoPost); row.SetField("proof-amt-posted", entity.proofAmtPosted); row.SetField("proof-deptno-post", entity.proofDeptnoPost); row.SetField("proof-divno-post", entity.proofDivnoPost); row.SetField("proof-subno-post", entity.proofSubnoPost); row.SetField("pymttranscd", entity.pymttranscd); row.SetField("shipto", entity.shipto); row.SetField("split", entity.split); row.SetField("splitproof", entity.splitproof); row.SetField("unapplied-cst", entity.unappliedCst); row.SetField("unearnfl", entity.unearnfl); row.SetField("updatedone", entity.updatedone); row.SetField("wolimit", entity.wolimit); row.SetField("userfield", entity.userfield); }