Esempio n. 1
0
        private void saveBtn_Click_1(object sender, EventArgs e)
        {
            NewSoftBillAddedEventArgs args = new NewSoftBillAddedEventArgs();

            decimal amount;

            if (decimal.TryParse(amountTb.Text, out amount))
            {
                _amount = amount;
            }
            else
            {
                amountTb.Text = _amount.ToString();
                MessageBox.Show("Invalid amount!");
                return;
            }
            _name = nameTb.Text;

            args.Name   = _name;
            args.Amount = _amount;
            OnNewSoftBillAdded(args);

            this.Close();
        }
Esempio n. 2
0
 private void NewMonthlySoftBill_Added(object sender, NewSoftBillAddedEventArgs e)
 {
     _year.AddSoftBill(e.Name, e.Amount, false);
     RefreshPage();
 }
Esempio n. 3
0
 private void NewAnnualSoftBill_Added(object sender, NewSoftBillAddedEventArgs e)
 {
     _year.AddSoftBill(e.Name, e.Amount, true);
     RefreshPage();
 }
Esempio n. 4
0
 private void NewSoftBill_Added(object sender, NewSoftBillAddedEventArgs e)
 {
     _year.AddSoftBill(e.Name, e.Amount, _monthSelected);
     RefreshPage();
 }
Esempio n. 5
0
 protected virtual void OnNewSoftBillAdded(NewSoftBillAddedEventArgs e)
 {
     NewSoftBillAdded?.Invoke(this, e);
 }