/// <summary> /// Update a database row from a class /// </summary> public static void UpdateRowFromAreceupdatedata(ref DataRow row, Areceupdatedata entity) { row.SetField("cono", entity.cono); row.SetField("oper", entity.oper); row.SetField("ck-amount", entity.ckAmount); row.SetField("ck-amount-posted", entity.ckAmountPosted); row.SetField("divamts", entity.divamts); row.SetField("divnos", entity.divnos); row.SetField("first-split-ckfl", entity.firstSplitCkfl); row.SetField("g-custno", entity.gCustno); row.SetField("g-bankno", entity.gBankno); row.SetField("g-divno", entity.gDivno); row.SetField("g-groupid", entity.gGroupid); row.SetField("g-shipto", entity.gShipto); row.SetField("m-refer", entity.mRefer); row.SetField("m-unapplied-cust", entity.mUnappliedCust); 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("s-amount", entity.sAmount); row.SetField("s-checkno", entity.sCheckno); row.SetField("s-miscamt", entity.sMiscamt); row.SetField("s-postdt", entity.sPostdt); row.SetField("s-posttype", entity.sPosttype); row.SetField("s-pymttranscd", entity.sPymttranscd); row.SetField("v-chrecfl", entity.vChrecfl); row.SetField("v-noapps", entity.vNoapps); row.SetField("v-updglty", entity.vUpdglty); row.SetField("userfield", entity.userfield); }
public static Areceupdatedata BuildAreceupdatedataFromRow(DataRow row) { Areceupdatedata entity = new Areceupdatedata(); entity.cono = row.IsNull("cono") ? 0 : row.Field <int>("cono"); entity.oper = row.IsNull("oper") ? string.Empty : row.Field <string>("oper"); entity.ckAmount = row.IsNull("ck-amount") ? decimal.Zero : row.Field <decimal>("ck-amount"); entity.ckAmountPosted = row.IsNull("ck-amount-posted") ? decimal.Zero : row.Field <decimal>("ck-amount-posted"); entity.divamts = row.IsNull("divamts") ? string.Empty : row.Field <string>("divamts"); entity.divnos = row.IsNull("divnos") ? string.Empty : row.Field <string>("divnos"); entity.firstSplitCkfl = row.Field <bool>("first-split-ckfl"); entity.gCustno = row.IsNull("g-custno") ? decimal.Zero : row.Field <decimal>("g-custno"); entity.gBankno = row.IsNull("g-bankno") ? 0 : row.Field <int>("g-bankno"); entity.gDivno = row.IsNull("g-divno") ? 0 : row.Field <int>("g-divno"); entity.gGroupid = row.IsNull("g-groupid") ? string.Empty : row.Field <string>("g-groupid"); entity.gShipto = row.IsNull("g-shipto") ? string.Empty : row.Field <string>("g-shipto"); entity.mRefer = row.IsNull("m-refer") ? string.Empty : row.Field <string>("m-refer"); entity.mUnappliedCust = row.IsNull("m-unapplied-cust") ? decimal.Zero : row.Field <decimal>("m-unapplied-cust"); 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.sAmount = row.IsNull("s-amount") ? decimal.Zero : row.Field <decimal>("s-amount"); entity.sCheckno = row.IsNull("s-checkno") ? 0 : row.Field <int>("s-checkno"); entity.sMiscamt = row.IsNull("s-miscamt") ? decimal.Zero : row.Field <decimal>("s-miscamt"); entity.sPostdt = row.Field <DateTime?>("s-postdt"); entity.sPosttype = row.IsNull("s-posttype") ? string.Empty : row.Field <string>("s-posttype"); entity.sPymttranscd = row.IsNull("s-pymttranscd") ? string.Empty : row.Field <string>("s-pymttranscd"); entity.vChrecfl = row.Field <bool>("v-chrecfl"); entity.vNoapps = row.IsNull("v-noapps") ? 0 : row.Field <int>("v-noapps"); entity.vUpdglty = row.IsNull("v-updglty") ? string.Empty : row.Field <string>("v-updglty"); entity.userfield = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield"); return(entity); }