Example #1
0
        private void btnUpdatePayment_Click_1(object sender, EventArgs e)
        {
            Form frm = Application.OpenForms["UpdatePaymentForm"];

            try
            {
                if (payments.Count > 0)
                {
                    if (frm == null)
                    {
                        UpdatePaymentForm updatePaymentForm = new UpdatePaymentForm(this);
                        updatePaymentForm.idIndex     = int.Parse(dataGridView2.CurrentRow.Cells[0].Value.ToString());
                        updatePaymentForm.name        = dataGridView2.CurrentRow.Cells[1].Value.ToString();
                        updatePaymentForm.pay         = double.Parse(dataGridView2.CurrentRow.Cells[2].Value.ToString());
                        updatePaymentForm.paymentDate = DateTime.Parse(dataGridView2.CurrentRow.Cells[3].Value.ToString());
                        updatePaymentForm.Show();
                    }
                }
                else
                {
                    MessageBox.Show("Lütfen Ödeme Girişi Yapın !", "", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
            catch (Exception)
            {
                MessageBox.Show("Bir Hata Oluştu! Lütfen Ödeme Seçtiğinize Emin Olun", "", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            GC.Collect();
            GC.WaitForPendingFinalizers();
        }
Example #2
0
        private void dataGridView2_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            Form frm = Application.OpenForms["UpdatePaymentForm"];

            try
            {
                if (frm == null)
                {
                    UpdatePaymentForm updatePaymentForm = new UpdatePaymentForm(this);
                    updatePaymentForm.idIndex     = int.Parse(dataGridView2.CurrentRow.Cells[0].Value.ToString());
                    updatePaymentForm.name        = dataGridView2.CurrentRow.Cells[1].Value.ToString();
                    updatePaymentForm.pay         = double.Parse(dataGridView2.CurrentRow.Cells[2].Value.ToString());
                    updatePaymentForm.paymentDate = DateTime.Parse(dataGridView2.CurrentRow.Cells[3].Value.ToString());
                    updatePaymentForm.Show();
                }
            }
            catch (Exception)
            {
                MessageBox.Show("Bir Hata Oluştu!", "", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            GC.Collect();
            GC.WaitForPendingFinalizers();
        }