Exemple #1
0
        public static CashIn convertToCashIn(WFSCIMCASHIN item)
        {
            CashIn unit = new CashIn();

            unit.usNumber         = item.usNumber;
            unit.fwType           = item.fwType;
            unit.cUnitID          = item.cUnitID;
            unit.cCurrencyID      = item.cCurrencyID;
            unit.ulValues         = item.ulValues;
            unit.ulCashInCount    = item.ulCashInCount;
            unit.ulCount          = item.ulCount;
            unit.ulMaximum        = item.ulMaximum;
            unit.usStatus         = item.usStatus;
            unit.bAppLock         = item.bAppLock;
            unit.usNumPhysicalCUs = item.usNumPhysicalCUs;

            if (item.usNumPhysicalCUs > 0)
            {
                unit.lppPhysical = XFSUtil.XFSPtrToArray <WFSCIMPHCU>(item.lppPhysical, item.usNumPhysicalCUs);
            }
            else
            {
                unit.lppPhysical = new WFSCIMPHCU[0];
            }

            var notnumberList = new WFSCIMNOTENUMBERLIST();

            XFSUtil.PtrToStructure <WFSCIMNOTENUMBERLIST>(item.lpNoteNumberList, ref notnumberList);
            unit.lpNoteNumberList = convertToNoteNumberList(notnumberList);

            unit.lpszExtra = item.lpszExtra;

            return(unit);
        }
Exemple #2
0
        public IntPtr Marshal(CimCashInfoObject cashInfo)
        {
            WFSCIMCASHINFO dto = new WFSCIMCASHINFO();

            dto.usCount = cashInfo.usCount;
            WFSCIMCASHIN[] cashunitstructs = new WFSCIMCASHIN[cashInfo.CashIns.Length];
            for (int i = 0; i < cashInfo.CashIns.Length; i++)
            {
                cashunitstructs[i] = CashIn.convertToWFSCIMCASHIN(cashInfo.CashIns[i]);
            }

            dto.lppCashIn = XFSUtil.XFSArrayToPTR <WFSCIMCASHIN>(cashunitstructs);
            return(XFSUtil.StructureToPtr <WFSCIMCASHINFO>(dto));
        }
Exemple #3
0
        public ISTATUS UnMarshal(IntPtr pointer)
        {
            var cashinfoObj = new CimCashInfoObject();

            var cashunitInfo = new WFSCIMCASHINFO();

            XFSUtil.PtrToStructure <WFSCIMCASHINFO>(pointer, ref cashunitInfo);
            cashinfoObj.usCount = cashunitInfo.usCount;

            var cashUnits = XFSUtil.XFSPtrToArray <WFSCIMCASHIN>(cashunitInfo.lppCashIn, cashunitInfo.usCount);

            cashinfoObj.CashIns = new CashIn[cashUnits.Length];
            for (int i = 0; i < cashUnits.Length; i++)
            {
                cashinfoObj.CashIns[i] = CashIn.convertToCashIn(cashUnits[i]);
            }

            return(cashinfoObj);
        }
Exemple #4
0
        public static WFSCIMCASHIN convertToWFSCIMCASHIN(CashIn cashUnit)
        {
            WFSCIMCASHIN dtoCashUnit = new WFSCIMCASHIN();

            dtoCashUnit.usNumber         = cashUnit.usNumber;
            dtoCashUnit.fwType           = cashUnit.fwType;
            dtoCashUnit.fwItemType       = cashUnit.fwItemType;
            dtoCashUnit.cUnitID          = cashUnit.cUnitID;
            dtoCashUnit.cCurrencyID      = cashUnit.cCurrencyID;
            dtoCashUnit.ulValues         = cashUnit.ulValues;
            dtoCashUnit.ulCashInCount    = cashUnit.ulCashInCount;
            dtoCashUnit.ulCount          = cashUnit.ulCount;
            dtoCashUnit.ulMaximum        = cashUnit.ulMaximum;
            dtoCashUnit.usStatus         = cashUnit.usStatus;
            dtoCashUnit.bAppLock         = cashUnit.bAppLock;
            dtoCashUnit.usNumPhysicalCUs = cashUnit.usNumPhysicalCUs;
            dtoCashUnit.lppPhysical      = XFSUtil.XFSArrayToPTR <WFSCIMPHCU>(cashUnit.lppPhysical);
            return(dtoCashUnit);
        }