Ejemplo n.º 1
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            // Do any additional setup after loading the view.
            this.ScenarioButton.State      = NSCellStateValue.On;
            this.OutflowsOnlyButton.State  = NSCellStateValue.Off;
            this.ScheduledOnlyButton.State = NSCellStateValue.Off;
            this.showAll           = true;
            this.showScheduledOnly = false;
            this.showExpensesOnly  = false;

            clsCSVTable cfTable = new clsCSVTable(clsCashflow.strCashflowPath);

            for (int i = 0; i < cfTable.Length(); i++)
            {
                if (DateTime.Parse(cfTable.Value(i, clsCashflow.DeleteDateColumn)) > System.DateTime.Today.AddYears(50))
                {
                    this.activeCashflows.Add(new clsCashflow(i));
                }
            }

            this.DateFilterDatePicker.DateValue = (NSDate)System.DateTime.Today;
            this.startDate = System.DateTime.Today.AddYears(-10);
            this.StartDatePicker.DateValue = (NSDate)this.startDate;
            this.endDate = System.DateTime.Today.AddYears(10);
            this.EndDatePicker.DateValue = (NSDate)this.endDate;

            this.ActualFilterComboxBox.RemoveAll();
            this.ActualFilterComboxBox.Add((NSString)"All");
            this.ActualFilterComboxBox.Add((NSString)"True");
            this.ActualFilterComboxBox.Add((NSString)"False");
            this.ActualFilterComboxBox.SelectItem(0);

            this.AddressFilterComboBox.RemoveAll();
            this.AddressFilterComboBox.Add((NSString)"All");
            List <string> addresses = clsProperty.AddressList();

            foreach (string s in addresses)
            {
                this.AddressFilterComboBox.Add((NSString)s);
            }
            this.AddressFilterComboBox.SelectItem(0);

            this.TypeFilterComboBox.RemoveAll();
            this.TypeFilterComboBox.Add((NSString)"All");
            foreach (clsCashflow.Type t in Enum.GetValues(typeof(clsCashflow.Type)))
            {
                this.TypeFilterComboBox.Add((NSString)t.ToString());
            }
            this.TypeFilterComboBox.Remove((NSString)"Unknown");
            this.TypeFilterComboBox.SelectItem(0);

            this.dataSource                   = new CashflowTableDataSource();
            this.dataSourceDelegate           = new CashflowTableDataSourceDelegate(this.dataSource);
            this.CashflowTableView.DataSource = this.dataSource;
            this.CashflowTableView.Delegate   = this.dataSourceDelegate;

            this.LenderPopUp.RemoveItem("Item 2");
            this.LenderPopUp.RemoveItem("Item 3");
            clsCSVTable tblLenders = new clsCSVTable(clsEntity.strEntityPath);
            clsCSVTable tblLoans   = new clsCSVTable(clsLoan.strLoanPath);

            for (int i = 0; i < tblLenders.Length(); i++)
            {
                if (tblLoans.Matches(clsLoan.LenderColumn, i.ToString()).Count > 0)
                {
                    this.LenderPopUp.AddItem(tblLenders.Value(i, clsEntity.NameColumn));
                    this.lenderIndexToID.Add(i);
                }
            }
            for (int i = 0; i < tblLoans.Length(); i++)
            {
                this.lenderLoanIDs.Add(i);
            }
        }
Ejemplo n.º 2
0
 public CashflowTableDataSourceDelegate(CashflowTableDataSource source)
 {
     this.dataSource = source;
 }
Ejemplo n.º 3
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            // Do any additional setup after loading the view.
            this.ScenarioButton.State      = NSCellStateValue.On;
            this.OutflowsOnlyButton.State  = NSCellStateValue.Off;
            this.ScheduledOnlyButton.State = NSCellStateValue.Off;
            this.showAll           = true;
            this.showScheduledOnly = false;
            this.showExpensesOnly  = false;
            this.showExpired       = false;

            clsCSVTable cfTable = new clsCSVTable(clsCashflow.strCashflowPath);

            for (int i = 0; i < cfTable.Length(); i++)
            {
                DateTime         pd = DateTime.Parse(cfTable.Value(i, clsCashflow.TransactionDateColumn));
                DateTime         rd = DateTime.Parse(cfTable.Value(i, clsCashflow.RecordDateColumn));
                DateTime         dd = DateTime.Parse(cfTable.Value(i, clsCashflow.DeleteDateColumn));
                int              id = Int32.Parse(cfTable.Value(i, clsCashflow.LoanColumn));
                double           a  = Double.Parse(cfTable.Value(i, clsCashflow.AmountColumn));
                bool             b  = Boolean.Parse(cfTable.Value(i, clsCashflow.ActualColumn));
                clsCashflow.Type t  = (clsCashflow.Type)Int32.Parse(cfTable.Value(i, clsCashflow.TransactionTypeColumn));
                string           c  = cfTable.Value(i, clsCashflow.CommentColumn);
                clsCashflow      cf = new clsCashflow(pd, rd, dd, id, a, b, t, c);
                if (DateTime.Parse(cfTable.Value(i, clsCashflow.DeleteDateColumn)) > System.DateTime.Today.AddYears(50))
                {
                    this.activeCashflows.Add(cf);
                    //this.activeCashflows.Add(new clsCashflow(i));
                }
                else
                {
                    this.expiredCashflows.Add(cf);
                }
            }

            this.DateFilterDatePicker.DateValue = (NSDate)System.DateTime.Today;
            this.startDate = System.DateTime.Today.AddYears(-10);
            this.StartDatePicker.DateValue = (NSDate)this.startDate;
            this.endDate = System.DateTime.Today.AddYears(10);
            this.EndDatePicker.DateValue = (NSDate)this.endDate;

            this.ActualFilterComboxBox.RemoveAll();
            this.ActualFilterComboxBox.Add((NSString)"All");
            this.ActualFilterComboxBox.Add((NSString)"True");
            this.ActualFilterComboxBox.Add((NSString)"False");
            this.ActualFilterComboxBox.SelectItem(0);

            this.AddressFilterComboBox.RemoveAll();
            this.AddressFilterComboBox.Add((NSString)"All");
            List <string> addresses = clsProperty.AddressList();

            foreach (string s in addresses)
            {
                this.AddressFilterComboBox.Add((NSString)s);
            }
            this.AddressFilterComboBox.SelectItem(0);

            this.TypeFilterComboBox.RemoveAll();
            this.TypeFilterComboBox.Add((NSString)"All");
            foreach (clsCashflow.Type t in Enum.GetValues(typeof(clsCashflow.Type)))
            {
                this.TypeFilterComboBox.Add((NSString)t.ToString());
            }
            this.TypeFilterComboBox.Remove((NSString)"Unknown");
            this.TypeFilterComboBox.SelectItem(0);

            this.dataSource                   = new CashflowTableDataSource();
            this.dataSourceDelegate           = new CashflowTableDataSourceDelegate(this.dataSource);
            this.CashflowTableView.DataSource = this.dataSource;
            this.CashflowTableView.Delegate   = this.dataSourceDelegate;

            clsCSVTable tblLenders = new clsCSVTable(clsEntity.strEntityPath);
            clsCSVTable tblLoans   = new clsCSVTable(clsLoan.strLoanPath);

            for (int i = 0; i < tblLenders.Length(); i++)
            {
                if (tblLoans.Matches(clsLoan.LenderColumn, i.ToString()).Count > 0)
                {
                    this.LenderPopUp.AddItem(tblLenders.Value(i, clsEntity.NameColumn));
                    this.lenderIndexToID.Add(i);
                }
            }
            for (int i = 0; i < tblLoans.Length(); i++)
            {
                this.lenderLoanIDs.Add(i);
            }

            clsCSVTable tblBorrowers = new clsCSVTable(clsEntity.strEntityPath);

            for (int i = 0; i < tblBorrowers.Length(); i++)
            {
                if (tblLoans.Matches(clsLoan.TitleHolderColumn, i.ToString()).Count > 0)
                {
                    this.BorrowerPopUp.AddItem(tblBorrowers.Value(i, clsEntity.NameColumn));
                    this.borrowerIndexToID.Add(i);
                }
            }
            for (int i = 0; i < tblLoans.Length(); i++)
            {
                this.borrowerLoanIDs.Add(i);
            }
        }