Пример #1
0
        public static Tendering BuildTenderingFromRow(DataRow row)
        {
            Tendering entity = new Tendering();

            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.cUnMaskCardNo   = row.IsNull("cUnMaskCardNo") ? string.Empty : row.Field <string>("cUnMaskCardNo");
            entity.lCCHoldBofl     = row.Field <bool>("lCCHoldBofl");
            entity.cCenPOSAuth     = row.IsNull("cCenPOSAuth") ? string.Empty : row.Field <string>("cCenPOSAuth");
            entity.cCenPOSResp     = row.IsNull("cCenPOSResp") ? string.Empty : row.Field <string>("cCenPOSResp");
            entity.cReferenceRowid = row.IsNull("cReferenceRowid") ? string.Empty : row.Field <string>("cReferenceRowid");
            entity.dRefAmount      = row.IsNull("dRefAmount") ? decimal.Zero : row.Field <decimal>("dRefAmount");
            entity.cRefType        = row.IsNull("cRefType") ? string.Empty : row.Field <string>("cRefType");
            entity.cCardTrans      = row.IsNull("cCardTrans") ? string.Empty : row.Field <string>("cCardTrans");
            entity.dAddlAuth       = row.IsNull("dAddlAuth") ? decimal.Zero : row.Field <decimal>("dAddlAuth");
            entity.userfield       = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield");
            return(entity);
        }
Пример #2
0
 /// <summary>
 /// Update a database row from a class
 /// </summary>
 public static void UpdateRowFromTendering(ref DataRow row, Tendering 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("cUnMaskCardNo", entity.cUnMaskCardNo);
     row.SetField("lCCHoldBofl", entity.lCCHoldBofl);
     row.SetField("cCenPOSAuth", entity.cCenPOSAuth);
     row.SetField("cCenPOSResp", entity.cCenPOSResp);
     row.SetField("cReferenceRowid", entity.cReferenceRowid);
     row.SetField("dRefAmount", entity.dRefAmount);
     row.SetField("cRefType", entity.cRefType);
     row.SetField("cCardTrans", entity.cCardTrans);
     row.SetField("dAddlAuth", entity.dAddlAuth);
     row.SetField("userfield", entity.userfield);
 }