コード例 #1
0
        private void RedrawTable()
        {
            clsCSVTable tbl      = new clsCSVTable(clsCashflow.strCashflowPath);
            string      selected = this.TypePopUpButton.TitleOfSelectedItem;

            this.typeChosen = clsCashflow.Type.Unknown;
            foreach (clsCashflow.Type t in Enum.GetValues(typeof(clsCashflow.Type)))
            {
                if (t.ToString() == selected)
                {
                    this.typeChosen = t;
                }
            }
            List <int> IDs = tbl.Matches(clsCashflow.TransactionTypeColumn, ((int)this.typeChosen).ToString());

            this.dataSource.Cashflows.Clear();
            foreach (int id in IDs)
            {
                clsCashflow newCf = new clsCashflow(id);
                if (((this.showExpired) || (newCf.DeleteDate() > System.DateTime.Today.AddYears(50))) && (newCf.LoanID() == -this.entityID))
                {
                    this.dataSource.Cashflows.Add(newCf);
                }
            }
            this.CashflowsTableView.ReloadData();
        }
コード例 #2
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            // load Loans By Address
            clsCSVTable tbl = new clsCSVTable(clsLoan.strLoanPath);

            for (int i = 0; i < tbl.Length(); i++)
            {
                clsLoan l = new clsLoan(i);
                loansByAddress.Add(l.Property().Address(), l);
            }

            // Do any additional setup after loading the view.
            this.UpdateAddressList();
            this.SaleDatePicker.DateValue = (NSDate)System.DateTime.Today.Date;
            this.ChooseActionPopUp.RemoveAllItems();
            this.RecordDatePicker.DateValue = (NSDate)System.DateTime.Today.Date;
            this.LenderComboBox.RemoveAll();
            clsCSVTable tblEntities = new clsCSVTable(clsEntity.strEntityPath);

            for (int i = 0; i < tblEntities.Length(); i++)
            {
                if (tbl.Matches(clsLoan.LenderColumn, i.ToString()).Count > 0)
                {
                    this.LenderComboBox.Add((NSString)(new clsEntity(i)).Name());
                }
            }
            this.StatusComboBox.RemoveAll();
            foreach (clsLoan.State c in Enum.GetValues(typeof(clsLoan.State)))
            {
                this.StatusComboBox.Add((NSString)c.ToString());
            }
        }
コード例 #3
0
        private void RedrawTable()
        {
            // instantiate loan that matches address chosen
            if (this.PropertyChooser.SelectedIndex != 0)
            {
                clsLoan loan = new clsLoan(dictLoanIDsByAddress[this.PropertyChooser.StringValue]);

                // load all documents pertaining to that property, and all document records pertaining to each document
                List <int>         documentIDs = tblDocuments.Matches(clsDocument.PropertyColumn, loan.PropertyID().ToString());
                List <clsDocument> documents   = new List <clsDocument>();
                Dictionary <int, List <clsDocumentRecord> > documentRecords = new Dictionary <int, List <clsDocumentRecord> >();
                foreach (int id in documentIDs)
                {
                    documents.Add(new clsDocument(id));
                    documentRecords.Add(id, new List <clsDocumentRecord>());
                    foreach (int docrecid in tblDocumentRecords.Matches(clsDocumentRecord.DocumentColumn, id.ToString()))
                    {
                        documentRecords[id].Add(new clsDocumentRecord(docrecid));
                    }
                }

                // apply filters (date range, type, status, transmission, sender, receiver) to construct datasource
                // construct datasource
                this.dataSource.data = new List <clsDocumentRecord>();
                foreach (int id in documentIDs)
                {
                    foreach (clsDocumentRecord rec in documentRecords[id])
                    {
                        bool ok = true;
                        ok = (ok) && (((int)rec.StatusType() == this.StatusFilter.SelectedIndex - 1) || (this.StatusFilter.SelectedIndex == 0));
                        ok = (ok) && (((int)rec.SenderID() == this.SenderFilter.SelectedIndex - 1) || (this.SenderFilter.SelectedIndex == 0));
                        ok = (ok) && (((int)rec.ReceiverID() == this.ReceiverFilter.SelectedIndex - 1) || (this.ReceiverFilter.SelectedIndex == 0));
                        //                    ok = (ok) && (((int)rec.DocumentID() == this.TypeFilter.SelectedIndex - 1) || (this.TypeFilter.SelectedIndex == 0));
                        if (ok)
                        {
                            this.dataSource.data.Add(rec);
                        }
                    }
                }

                // ALLOW SORTING
                this.DocRecTableView.ReloadData();
            }
        }
コード例 #4
0
        partial void LenderChosen(NSPopUpButton sender)
        {
            this.lenderLoanIDs.Clear();
            clsCSVTable tblLoans = new clsCSVTable(clsLoan.strLoanPath);

            if (this.LenderPopUpButton.IndexOfSelectedItem > 0)
            {
                this.lenderID      = this.lenderIndexToID[(int)this.LenderPopUpButton.IndexOfSelectedItem - 1];
                this.lenderLoanIDs = tblLoans.Matches(clsLoan.LenderColumn, this.lenderID.ToString());
            }
            else
            {
                this.lenderID = -1;
                for (int i = 0; i < tblLoans.Length(); i++)
                {
                    this.lenderLoanIDs.Add(i);
                }
            }
        }
コード例 #5
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            // Do any additional setup after loading the view.
            this.ReportDatePicker.DateValue  = (NSDate)System.DateTime.Today.Date.ToUniversalTime();
            this.ReportDatePicker2.DateValue = (NSDate)System.DateTime.Today.Date.AddDays(91).ToUniversalTime();

            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.LenderPopUpButton.AddItem(tblLenders.Value(i, clsEntity.NameColumn));
                    this.lenderIndexToID.Add(i);
                }
            }
        }
コード例 #6
0
        partial void BorrowerSelected(NSPopUpButton sender)
        {
            this.borrowerLoanIDs.Clear();
            clsCSVTable tblLoans = new clsCSVTable(clsLoan.strLoanPath);

            if (this.BorrowerPopUp.IndexOfSelectedItem > 0)
            {
                this.borrowerID      = this.borrowerIndexToID[(int)this.BorrowerPopUp.IndexOfSelectedItem - 1];
                this.borrowerLoanIDs = tblLoans.Matches(clsLoan.TitleHolderColumn, this.borrowerID.ToString());
            }
            else
            {
                this.borrowerID = -1;
                for (int i = 0; i < tblLoans.Length(); i++)
                {
                    this.borrowerLoanIDs.Add(i);
                }
            }
            this.RefreshTable();
        }
コード例 #7
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            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.LenderPopUpButton.AddItem(tblLenders.Value(i, clsEntity.NameColumn));
                    this.lenderIndexToID.Add(i);
                }
            }
            for (int i = 0; i < tblLoans.Length(); i++)
            {
                this.lenderLoanIDs.Add(i);
            }

            // Do any additional setup after loading the view.
        }
コード例 #8
0
        partial void RunReportPressed(NSButton sender)
        {
            // open file
            string fileName = "/Volumes/GoogleDrive/Shared Drives/Resilience/Reports/DocumentStatus";

            fileName += System.DateTime.Today.ToString("yyyyMMdd");
            fileName += "." + this.LenderPopUpButton.TitleOfSelectedItem;
            fileName += ".htm";
            System.IO.StreamWriter sw = new System.IO.StreamWriter(fileName);

            // write beginning tags and header
            sw.WriteLine("<!DOCTYPE html><html>");
            sw.WriteLine("<head>");
            sw.WriteLine("<style>");
            sw.WriteLine("th {text-decoration:underline;}");
            sw.WriteLine("tr {background-color:WhiteSmoke;}");
            sw.WriteLine("td#MUSTHAVE {background-color:Red;}");
            sw.WriteLine("td#MIGHTHAVE {background-color:Orange;}");
            sw.WriteLine("td#SHOULDHAVE {background-color:Yellow;}");
            sw.WriteLine("td#TODO {background-color:Green;}");
            sw.WriteLine("td#COMPLETE {background-color:White;}");
            sw.WriteLine("tr#HEADER {background-color:White;}");
            sw.WriteLine("</style>");
            sw.WriteLine("</head>");

            // html body
            sw.WriteLine("<body>");
            sw.WriteLine("<h1>Document Status Report  " + System.DateTime.Today.ToString("MM/dd/yyyy") + "</h1>");
            sw.WriteLine("<table style=\"width:auto\">");
            WriteHTMLHeaderRow(sw);

            // loop through loans
            clsCSVTable tbl                = new clsCSVTable(clsLoan.strLoanPath);
            clsCSVTable tblDocuments       = new clsCSVTable(clsDocument.strDocumentPath);
            clsCSVTable tblDocumentRecords = new clsCSVTable(clsDocumentRecord.strDocumentRecordPath);

            for (int i = 0; i < tbl.Length(); i++)
            {
                if (this.lenderLoanIDs.Contains(i))
                {
                    // load document list
                    clsLoan loan = new clsLoan(i);
                    Dictionary <int, clsDocument> documentList = new Dictionary <int, clsDocument>();
                    List <int> documentListIDs = new List <int>();
                    documentListIDs = tblDocuments.Matches(clsDocument.PropertyColumn, loan.PropertyID().ToString());

                    // load document records
                    List <clsDocumentRecord> documentRecordList = new List <clsDocumentRecord>();
                    List <int> documentRecordIDs          = new List <int>();
                    List <clsDocument.Type> documentTypes = new List <clsDocument.Type>();

                    foreach (int id in documentListIDs)
                    {
                        documentList.Add(id, new clsDocument(id));
                        foreach (int recID in tblDocumentRecords.Matches(clsDocumentRecord.DocumentColumn, id.ToString()))
                        {
                            documentRecordIDs.Add(recID);
                            documentRecordList.Add(new clsDocumentRecord(recID));
                            documentTypes.Add(documentList[id].DocumentType());
                        }
                    }

                    // write loan to report
                    this.WriteLoanHTML(loan.Property().Address(), loan.Status(), sw, documentRecordList, documentTypes);
                }
            }

            // end of doc tags
            this.WriteHTMLFooter(sw);
            sw.WriteLine("</table></body></html>");
            sw.Flush();
        }
コード例 #9
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            // Do any additional setup after loading the view.
            this.InitializeValues();
            this.TypePopUpButton.RemoveAllItems();
            List <string> typeList = new List <string>();

            foreach (clsCashflow.Type t in Enum.GetValues(typeof(clsCashflow.Type)))
            {
                if ((t == clsCashflow.Type.ManagementFee) ||
                    (t == clsCashflow.Type.AccountingFees) ||
                    (t == clsCashflow.Type.BankFees) ||
                    (t == clsCashflow.Type.CapitalCall) ||
                    (t == clsCashflow.Type.CatchUp) ||
                    (t == clsCashflow.Type.Distribution) ||
//                    (t == clsCashflow.Type.InterestAdditional) ||
                    (t == clsCashflow.Type.LegalFees) ||
                    (t == clsCashflow.Type.ManagementFee) ||
                    (t == clsCashflow.Type.Misc) ||
                    (t == clsCashflow.Type.PromoteFee))
                {
                    typeList.Add(t.ToString());
                }
            }
            typeList.Sort();
            foreach (string s in typeList)
            {
                this.TypePopUpButton.AddItem(s);
            }
            this.CashflowsTableView.Delegate = new NonLoanCashflowTableViewDelegate(this.dataSource);
            this.CashflowsTableView.TableColumns()[0].Title = "ID";
            this.CashflowsTableView.TableColumns()[0].Width = 60;
            this.CashflowsTableView.TableColumns()[1].Title = "PayDate";
            this.CashflowsTableView.TableColumns()[1].Width = 60;
            this.CashflowsTableView.TableColumns()[2].Title = "RecDate";
            this.CashflowsTableView.TableColumns()[2].Width = 60;
            this.CashflowsTableView.TableColumns()[3].Title = "Amount";
            this.CashflowsTableView.TableColumns()[3].Width = 80;
            this.CashflowsTableView.TableColumns()[4].Title = "Type";
            this.CashflowsTableView.TableColumns()[4].Width = 80;
            this.CashflowsTableView.TableColumns()[5].Title = "Actual";
            this.CashflowsTableView.TableColumns()[5].Width = 40;
            this.CashflowsTableView.TableColumns()[6].Title = "DelDate";
            this.CashflowsTableView.TableColumns()[6].Width = 60;
            this.CashflowsTableView.TableColumns()[7].Title = "Comment";
            this.CashflowsTableView.TableColumns()[7].Width = 200;
//            this.CashflowsTableView.RemoveColumn(this.CashflowsTableView.TableColumns()[0]);
            this.CashflowsTableView.DataSource = this.dataSource;

            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.EntityPopUpButton.AddItem(tblLenders.Value(i, clsEntity.NameColumn));
                    this.entityIndexToID.Add(i);
                }
            }
        }
コード例 #10
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);
            }
        }
コード例 #11
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);
            }
        }