Esempio n. 1
0
        public static BizMsgRejectReason Read(XmlElement xml, string name)
        {
            int number = FixmlUtil.ReadInt(xml, name);

            if (!Enum.IsDefined(typeof(BizMsgRejectReason), (BizMsgRejectReason)number))
            {
                FixmlUtil.Error(xml, name, number, "- unknown BizRejectReason");
            }
            return((BizMsgRejectReason)number);
        }
Esempio n. 2
0
        public static UserStatus Read(XmlElement xml, string name)
        {
            int number = FixmlUtil.ReadInt(xml, name);

            if (!Enum.IsDefined(typeof(UserStatus), (UserStatus)number))
            {
                FixmlUtil.Error(xml, name, number, "- unknown UserStatus");
            }
            return((UserStatus)number);
        }
Esempio n. 3
0
        protected override void ParseXmlMessage(string name)
        {
            base.ParseXmlMessage(MsgName);
            RequestId = FixmlUtil.ReadInt(xml, "MDReqID");
            List <MDEntry> list = new List <MDEntry>();

            foreach (XmlElement inc in xml.GetElementsByTagName("Inc"))
            {
                list.Add(new MDEntry(inc));
            }
            Entries = list.ToArray();
        }
        public static OrdRejectReason?Read(XmlElement xml, string name, bool optional)
        {
            int?number = FixmlUtil.ReadInt(xml, name, optional);

            if (number == null)
            {
                return(null);
            }
            if (!Enum.IsDefined(typeof(OrdRejectReason), (OrdRejectReason)number))
            {
                FixmlUtil.Error(xml, name, number, "- unknown OrderRejectReason");
            }
            return((OrdRejectReason)number);
        }
Esempio n. 5
0
        public static TrdSesStatRejectReason Read(XmlElement xml, string name)
        {
            int?number = FixmlUtil.ReadInt(xml, name, true);

            if (number == null)
            {
                return(TrdSesStatRejectReason.None);
            }
            if (!Enum.IsDefined(typeof(TrdSesStatRejectReason), (TrdSesStatRejectReason)number))
            {
                FixmlUtil.Error(xml, name, number, "- unknown TrdSesStatRejectReason");
            }
            return((TrdSesStatRejectReason)number);
        }
        public StatementData(XmlElement xml)
        {
            AccountNumber = FixmlUtil.ReadString(xml, "Acct");
            XmlNodeList fundsXml     = xml.GetElementsByTagName("Fund");
            XmlNodeList positionsXml = xml.GetElementsByTagName("Position");

            Funds     = new Dictionary <StatementFundType, decimal>(fundsXml.Count);
            Positions = new Dictionary <FixmlInstrument, PosQuantity>(positionsXml.Count);
            foreach (XmlElement elem in fundsXml)
            {
                StatementFundType key;
                try { key = StatementFundUtil.Read(elem, "name"); }
                catch (FixmlException e) { e.PrintWarning(); continue; }
                decimal value = FixmlUtil.ReadDecimal(elem, "value");
                Funds.Add(key, value);
            }
            foreach (XmlElement elem in positionsXml)
            {
                FixmlInstrument key    = FixmlInstrument.FindById(FixmlUtil.ReadString(elem, "Isin"));
                int             acc110 = FixmlUtil.ReadInt(elem, "Acc110");
                int             acc120 = FixmlUtil.ReadInt(elem, "Acc120", true) ?? 0;
                Positions.Add(key, new PosQuantity(acc110, acc120));
            }
            // nie zaszkodzi się upewnić - czy to, co NOL3 podesłał, stanowi jakąś integralną całość...
            // (i czy ja w ogóle słusznie zakładam, jakie powinny być zależności między tymi wartościami)
            // - dla rachunku akcyjnego:
            if (CheckFundsSum(StatementFundType.CashReceivables, StatementFundType.Cash, StatementFundType.Receivables))
            {
                CheckFundsSum(StatementFundType.PortfolioValue, StatementFundType.CashReceivables, StatementFundType.SecuritiesValue);
            }
            // - dla rachunku kontraktowego:
            if (CheckFundsSum(StatementFundType.Deposit, StatementFundType.DepositBlocked, StatementFundType.DepositFree))
            {
                CheckFundsSum(StatementFundType.PortfolioValue, StatementFundType.Cash, StatementFundType.CashBlocked, StatementFundType.Deposit);
            }
        }
 protected override void ParseXmlMessage(string name)
 {
     base.ParseXmlMessage(MsgName);
     // NOL3 w razie problemów czasem zwraca tutaj ujemną wartość -1
     RequestId = FixmlUtil.ReadInt(xml, "ReqID");
 }