Пример #1
0
        public frmExtraPayment(ExtraPayment ep)
        {
            InitializeComponent();

            ExtraPaymentName   = ep.Name;
            Recurring          = ep.Recurring;
            StartDate          = ep.StartDate;
            StopDate           = ep.StopDate;
            IndefiniteStopDate = ep.IndefiniteStopDate;
            Amount             = ep.Amount;
        }
Пример #2
0
        public ExtraPaymentDisplay(ExtraPayment ep)
        {
            Name      = ep.Name;
            Recurring = ep.Recurring;
            StartDate = ep.StartDate.ToShortDateString();
            Amount    = ep.Amount.ToString("C2");
            Enabled   = ep.Enabled;

            if (ep.IndefiniteStopDate)
            {
                StopDate = "Indefinite";
            }
            else
            {
                StopDate = ep.StopDate.ToShortDateString();
            }
        }
        private void dgvExtraPayments_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            frmExtraPayment f = new frmExtraPayment(debtList.ExtraPayments[e.RowIndex]);

            f.ShowDialog();
            if (f.Value == DialogResult.OK)
            {
                ExtraPayment ep = new ExtraPayment();
                ep.Name               = f.ExtraPaymentName;
                ep.Amount             = f.Amount;
                ep.Recurring          = f.Recurring;
                ep.StartDate          = f.StartDate;
                ep.StopDate           = f.StopDate;
                ep.IndefiniteStopDate = f.IndefiniteStopDate;

                debtList.ExtraPayments[e.RowIndex] = ep;

                DebtList.Save(debtList, path);

                RefreshData();
            }
        }
        private void button1_Click(object sender, EventArgs e)
        {
            frmExtraPayment f = new frmExtraPayment();

            f.ShowDialog();
            if (f.Value == DialogResult.OK)
            {
                ExtraPayment ep = new ExtraPayment();
                ep.Name               = f.ExtraPaymentName;
                ep.Amount             = f.Amount;
                ep.Recurring          = f.Recurring;
                ep.StartDate          = f.StartDate;
                ep.StopDate           = f.StopDate;
                ep.IndefiniteStopDate = f.IndefiniteStopDate;

                debtList.ExtraPayments.Add(ep);

                DebtList.Save(debtList, path);

                RefreshData();
            }
        }