Esempio n. 1
0
        private void OpenDetails()
        {
            if (dataGridView.Rows.Count < 1)
            {
                return;
            }

            var selectedTransaction = dataGridView.SelectedRows[0].Cells[0].Value;

            var payable = this._payables
                          .SingleOrDefault(_ => _.Id == Guid.Parse(selectedTransaction.ToString()));

            var form = new frmPayable(payable);

            form.ShowDialog();
            if (!form.IsCancelled)
            {
                dataGridView.SelectedRows[0].Cells[1].Value = form._Payable.PurchaseDate.ToShortDateString();
                dataGridView.SelectedRows[0].Cells[2].Value = form._Payable.PaymentTerms == 1 ? "30 Days" : "60 Days";
                dataGridView.SelectedRows[0].Cells[3].Value = form._Payable.GetAmount().ToString("#,##0.00");
                dataGridView.SelectedRows[0].Cells[4].Value = form._Payable.PurchaseDate.AddMonths(form._Payable.PaymentTerms).ToShortDateString();
                dataGridView.SelectedRows[0].Cells[5].Value = form._Payable.Notes;

                this._payables.Remove(payable);
                this._payables.Add(form._Payable);
                Filter();
            }
        }
Esempio n. 2
0
        private void BtnNew_Click(object sender, EventArgs e)
        {
            var form = new frmPayable(null);

            form.ShowDialog();
            if (!form.IsCancelled)
            {
                this._payables.Add(form._Payable);
                Filter();
            }
        }