コード例 #1
0
 partial void ActualCashflowPressed(NSButton sender)
 {
     if (this.validIDEntered)
     {
         clsCashflow cashflow = new clsCashflow(this.CashflowIDTextField.IntValue);
         if (cashflow.Comment() != null)
         {
             this.CommentTextField.StringValue = cashflow.Comment();
         }
         else
         {
             this.CommentTextField.StringValue = "";
         }
         if (cashflow.Actual())
         {
             this.SystemMessageTextField.StringValue = "CASHFLOW IS ALREADY ACTUAL";
         }
         else if (cashflow.MarkActual(System.DateTime.Today))
         {
             this.SystemMessageTextField.StringValue = "CASHFLOW MADE ACTUAL";
             this.ActualTextField.StringValue        = "Actual : " + true.ToString();
             cashflow.Save();
         }
         else
         {
             this.SystemMessageTextField.StringValue = "CASHFLOW EXPIRED, CAN'T MAKE ACTUAL";
         }
     }
     RedrawTable();
 }
コード例 #2
0
 partial void markTrueClicked(AppKit.NSButton sender)
 {
     if (Int32.TryParse(CashflowIDPopUp.SelectedItem.Title, out int i))
     {
         clsCashflow cf = new clsCashflow(Int32.Parse(CashflowIDPopUp.SelectedItem.Title));
         cf.MarkActual(System.DateTime.Today);
         cf.Save();
         loadRehabInfo();
     }
 }
コード例 #3
0
        partial void markTrueClicked(AppKit.NSButton sender)
        {
            int cfID = 0;

            cfID = Int32.Parse(cashflowID.StringValue);

            clsCashflow cf = new clsCashflow(cfID);

            cf.MarkActual(System.DateTime.Today);
            cf.Save();
            loadRehabInfo();
        }
コード例 #4
0
        partial void AddButtonPressed(AppKit.NSButton sender)
        {
            DateTime dtPay    = ((DateTime)this.DatePicker.DateValue).Date;
            DateTime dtRecord = ((DateTime)this.RecordDateOverridePicker.DateValue).Date;
            double   dAmount  = this.AmountTextField.DoubleValue;

            // VALIDATE ENTRIES
            if (this.typeChosen == clsCashflow.Type.Unknown)
            {
                this.SystemMessageTextField.StringValue = "INVALID CASHFLOW TYPE, UNABLE TO ADD";
            }
            else if (this.entityID < 0)
            {
                this.SystemMessageTextField.StringValue = "NO ENTITY SELECTED, UNABLE TO ADD";
            }
            else
            {
                // CREATE NEW CASHFLOW
                clsCashflow cashflow = new clsCashflow(dtPay, dtRecord, System.DateTime.MaxValue, -this.entityID, dAmount,
                                                       false, this.typeChosen, this.CommentTextField.StringValue);
                if (dtPay <= System.DateTime.Today.Date)
                {
                    cashflow.MarkActual(System.DateTime.Today.Date);
                }
                // SAVE TO TABLE
                cashflow.Save();
                this.CashflowIDTextField.IntValue = cashflow.ID();
                // UPDATE COMMENT BOX
                this.SystemMessageTextField.StringValue = "CASHFLOW SAVED.";
                if ((cashflow.TypeID() == clsCashflow.Type.InterestAdditional) && (cashflow.Amount() < 0D))
                {
                    this.SystemMessageTextField.StringValue += "\nCheck Amount.  Additional Interest is usually >= 0.";
                }
                else if ((cashflow.TypeID() == clsCashflow.Type.CapitalCall) && (cashflow.Amount() < 0D))
                {
                    this.SystemMessageTextField.StringValue += "\nCheck Amount.  Capital Calls are usually >= 0.";
                }
                else if ((cashflow.TypeID() == clsCashflow.Type.CatchUp) && (cashflow.Amount() < 0D))
                {
                    this.SystemMessageTextField.StringValue += "\nCheck Amount.  Catchup Payments are usually >= 0.";
                }
                else if (cashflow.Amount() > 0)
                {
                    this.SystemMessageTextField.StringValue += "\nCheck Amount.  Expenses are normally <0.";
                }
            }
            RedrawTable();
        }