Exemple #1
0
        private SplitDetailRow GetSplitDetailRow(TrxSplit split)
        {
            // Unlike for BudgetTrx we do not incorporate repeat key in the row key,
            // because there are so many different generated BankTrx sequences it
            // would make the resulting grid unwieldy.
            string rowKey = split.CategoryKey;

            if (!SplitDetailRows.TryGetValue(rowKey, out SplitDetailRow row))
            {
                string sequence = "";
                if (!string.IsNullOrEmpty(split.Parent.RepeatKey))
                {
                    sequence = split.Parent.Register.Account.Repeats.KeyToValue1(split.Parent.RepeatKey);
                }
                row = new SplitDetailRow(PeriodCount, split.CategoryKey,
                                         Company.Categories.KeyToValue1(split.CategoryKey), sequence);
                SplitDetailRows[rowKey] = row;
            }
            return(row);
        }
Exemple #2
0
 private void ShowSplitCell(SplitDetailRow row, int columnIndex)
 {
     if (columnIndex >= NonPeriodColumns)
     {
         SplitDetailCell cell = row.Cells[columnIndex - NonPeriodColumns];
         StartShowCell(row, columnIndex, "Category");
         lblDashboardAmount.Text = "Total of Above Detail: " + cell.CellAmount.ToString("F2");
         lblGeneratedAmount.Text = "Original Generated Amounts For Above: " + cell.GeneratedAmount.ToString("F2");
         lblBudgetLimit.Text     = "";
         lblBudgetApplied.Text   = "";
         SetBudgetDetailVisibility(false);
         foreach (TrxSplit split in cell.Splits)
         {
             lvwDetails.Items.Add((new SplitDetailItemBuilder(split)).Build());
         }
     }
     else
     {
         CheckCellDetailVisibility(false);
     }
 }
Exemple #3
0
        private void LoadTrx(BaseTrx trx)
        {
            int     period    = GetPeriod(trx.TrxDate);
            BankTrx normalTrx = trx as BankTrx;

            if (normalTrx != null)
            {
                if (Handler.IncludeNormalTrx(normalTrx))
                {
                    foreach (TrxSplit split in normalTrx.Splits)
                    {
                        if (Handler.IncludeSplit(split))
                        {
                            if (split.Budget == null)
                            {
                                SplitDetailRow row = GetSplitDetailRow(split);
                                row.Cells[period].Splits.Add(split);
                            }
                            else
                            {
                                BudgetDetailRow budgetRow = GetBudgetDetailRow(split.Budget);
                                budgetRow.Cells[period].Splits.Add(split);
                            }
                        }
                    }
                }
            }
            else
            {
                BudgetTrx budgetTrx = trx as BudgetTrx;
                if (budgetTrx != null)
                {
                    if (Handler.IncludeBudgetTrx(budgetTrx))
                    {
                        BudgetDetailRow row = GetBudgetDetailRow(budgetTrx);
                        row.Cells[period].Budgets.Add(budgetTrx);
                    }
                }
            }
        }