Exemple #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();
        }
 private void NewMonthlySoftBill_Added(object sender, NewSoftBillAddedEventArgs e)
 {
     _year.AddSoftBill(e.Name, e.Amount, false);
     RefreshPage();
 }
 private void NewAnnualSoftBill_Added(object sender, NewSoftBillAddedEventArgs e)
 {
     _year.AddSoftBill(e.Name, e.Amount, true);
     RefreshPage();
 }
 private void NewSoftBill_Added(object sender, NewSoftBillAddedEventArgs e)
 {
     _year.AddSoftBill(e.Name, e.Amount, _monthSelected);
     RefreshPage();
 }
Exemple #5
0
 protected virtual void OnNewSoftBillAdded(NewSoftBillAddedEventArgs e)
 {
     NewSoftBillAdded?.Invoke(this, e);
 }