/// <summary> /// Update a database row from a class /// </summary> public static void UpdateRowFromGlupdate(ref DataRow row, Glupdate entity) { row.SetField("cAccount", entity.cAccount); row.SetField("cAPInvNo", entity.cAPInvNo); row.SetField("cRefer", entity.cRefer); row.SetField("cReference", entity.cReference); row.SetField("CUpType", entity.cUpType); row.SetField("dAmount", entity.dAmount); row.SetField("dCheckNo", entity.dCheckNo); row.SetField("dCustNo", entity.dCustNo); row.SetField("dExchgRate", entity.dExchgRate); row.SetField("dtPostDt", entity.dtPostDt); row.SetField("dVendNo", entity.dVendNo); row.SetField("iBankNo", entity.iBankNo); row.SetField("iCorJrnlNo", entity.iCorJrnlNo); row.SetField("iCorSetNo", entity.iCorSetNo); row.SetField("iDivNo", entity.iDivNo); row.SetField("iGLAcctNo", entity.iGLAcctNo); row.SetField("iGLDeptNo", entity.iGLDeptNo); row.SetField("iGLDivNo", entity.iGLDivNo); row.SetField("iGLSubNo", entity.iGLSubNo); row.SetField("iInvNo", entity.iInvNo); row.SetField("iInvSuf", entity.iInvSuf); row.SetField("cMediaAuth", entity.cMediaAuth); row.SetField("iMediaCd", entity.iMediaCd); row.SetField("iPosition", entity.iPosition); row.SetField("iSeqNo", entity.iSeqNo); row.SetField("iType", entity.iType); row.SetField("lBalType", entity.lBalType); row.SetField("lClearFl", entity.lClearFl); row.SetField("lForceZeroDiv", entity.lForceZeroDiv); row.SetField("lHashFl", entity.lHashFl); row.SetField("lUseGLACCT", entity.lUseGLACCT); row.SetField("userfield", entity.userfield); }
public static Glupdate BuildGlupdateFromRow(DataRow row) { Glupdate entity = new Glupdate(); entity.cAccount = row.IsNull("cAccount") ? string.Empty : row.Field <string>("cAccount"); entity.cAPInvNo = row.IsNull("cAPInvNo") ? string.Empty : row.Field <string>("cAPInvNo"); entity.cRefer = row.IsNull("cRefer") ? string.Empty : row.Field <string>("cRefer"); entity.cReference = row.IsNull("cReference") ? string.Empty : row.Field <string>("cReference"); entity.cUpType = row.IsNull("CUpType") ? string.Empty : row.Field <string>("CUpType"); entity.dAmount = row.IsNull("dAmount") ? decimal.Zero : row.Field <decimal>("dAmount"); entity.dCheckNo = row.IsNull("dCheckNo") ? decimal.Zero : row.Field <decimal>("dCheckNo"); entity.dCustNo = row.IsNull("dCustNo") ? decimal.Zero : row.Field <decimal>("dCustNo"); entity.dExchgRate = row.IsNull("dExchgRate") ? decimal.Zero : row.Field <decimal>("dExchgRate"); entity.dtPostDt = row.Field <DateTime?>("dtPostDt"); entity.dVendNo = row.IsNull("dVendNo") ? decimal.Zero : row.Field <decimal>("dVendNo"); entity.iBankNo = row.IsNull("iBankNo") ? 0 : row.Field <int>("iBankNo"); entity.iCorJrnlNo = row.IsNull("iCorJrnlNo") ? 0 : row.Field <int>("iCorJrnlNo"); entity.iCorSetNo = row.IsNull("iCorSetNo") ? 0 : row.Field <int>("iCorSetNo"); entity.iDivNo = row.IsNull("iDivNo") ? 0 : row.Field <int>("iDivNo"); entity.iGLAcctNo = row.IsNull("iGLAcctNo") ? 0 : row.Field <int>("iGLAcctNo"); entity.iGLDeptNo = row.IsNull("iGLDeptNo") ? 0 : row.Field <int>("iGLDeptNo"); entity.iGLDivNo = row.IsNull("iGLDivNo") ? 0 : row.Field <int>("iGLDivNo"); entity.iGLSubNo = row.IsNull("iGLSubNo") ? 0 : row.Field <int>("iGLSubNo"); entity.iInvNo = row.IsNull("iInvNo") ? 0 : row.Field <int>("iInvNo"); entity.iInvSuf = row.IsNull("iInvSuf") ? 0 : row.Field <int>("iInvSuf"); entity.cMediaAuth = row.IsNull("cMediaAuth") ? string.Empty : row.Field <string>("cMediaAuth"); entity.iMediaCd = row.IsNull("iMediaCd") ? 0 : row.Field <int>("iMediaCd"); entity.iPosition = row.IsNull("iPosition") ? 0 : row.Field <int>("iPosition"); entity.iSeqNo = row.IsNull("iSeqNo") ? 0 : row.Field <int>("iSeqNo"); entity.iType = row.IsNull("iType") ? 0 : row.Field <int>("iType"); entity.lBalType = row.Field <bool>("lBalType"); entity.lClearFl = row.Field <bool>("lClearFl"); entity.lForceZeroDiv = row.Field <bool>("lForceZeroDiv"); entity.lHashFl = row.Field <bool>("lHashFl"); entity.lUseGLACCT = row.Field <bool>("lUseGLACCT"); entity.userfield = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield"); return(entity); }