public EndTransaction(string commandText, TransactionList transactionList, SiteList siteList, SystemClock systemClock)
            : base(commandText, transactionList, siteList, systemClock)
        {
            string[] info = commandText.Split(new[] {'(', ')'});

            if (info.Length != 3)
                throw new Exception("Invalid command format: " + commandText);

            Transaction = transactionList.GetTransaction(info[1]);

            if (Transaction == null)
                throw new Exception("Transaction not found: " + commandText);
        }
Example #2
0
        public Write(string commandText, TransactionList transactionList, SiteList siteList, SystemClock systemClock)
            : base(commandText, transactionList, siteList, systemClock)
        {
            string[] info = commandText.Split(new[] { '(', ')' });

            if (info.Length != 3)
                throw new Exception("Invalid command format: " + commandText);

            string[] parameters = info[1].Split(',');

            parameters = InputParser.TrimStringList(parameters);

            Transaction = transactionList.GetTransaction(parameters[0]);

            if (Transaction == null)
                throw new Exception("Transaction not found: " + commandText);

            VariableId = parameters[1];
            Value = parameters[2];
        }