Exemple #1
0
        public void TreeView_NodeMouseLeftClick(TreeNodeMouseClickEventArgs e)
        {
            NodeAddress na = (NodeAddress)e.Node.Tag;

            labelTable.Text = na.GetLabelText();
            switch (na.NodeType)
            {
            case NodeType.Category:
            case NodeType.Institution:
                ShowElement(na);
                break;

            case NodeType.Account:
                ShowElement(na.GetParent());
                break;
            }
        }
Exemple #2
0
 public void ChangeActive(NodeAddress na)
 {
     if (dataGridViewAccounting.InvokeRequired)
     {
         DelegateTable d = new DelegateTable(ChangeActive);
         this.Invoke(d, new object[] { na });
     }
     else
     {
         labelTable.Text = na.GetLabelText();
         if (na.NodeType == NodeType.Account)
         {
             na = na.GetParent();
         }
         dataGridViewAccounting.ShowElement(Data.GetElement(na), Data.Map.GetElement(na));
     }
 }
Exemple #3
0
        public void ShowElement(NodeAddress na)
        {
            labelTable.Text = na.GetLabelText();
            DateTime?                    dt        = GetPreviousDate();
            IAccountingElement           element   = Data.GetElement(na);
            Dictionary <string, double?> lastTotal = new Dictionary <string, double?> {
            };

            if (dt.HasValue)
            {
                AccountingData lastData = _DataHistory.GetData(dt.Value);
                lastTotal[dataGridViewAccounting._LastTotalMemoryMainKey] = lastData.GetQuote(lastData.Ccy, _DataHistory.TotalCcy) * lastData.GetValue(na);
                foreach (var subitem in lastData.GetElement(na).GetItemList())
                {
                    lastTotal[subitem.GetName()] = subitem.GetTotalAmount(_DataHistory.TotalCcy, lastData.FXMarket);
                }
            }
            dataGridViewAccounting.ShowElement(Data.GetElement(na), Data.Map.GetElement(na), lastTotal);;
            _AddressofElementShowed = na;
        }