Ejemplo n.º 1
0
        private void btnInsertPayment_Click(object sender, EventArgs e)
        {
            frmPaymentInsertUpdate frm = new frmPaymentInsertUpdate(dtCust, this);

            frm.ShowDialog();
            btnRefreshPayment_Click(null, null);
        }
Ejemplo n.º 2
0
 private void grdPayment_CommandCellClick(object sender, EventArgs e)
 {
     if (grdPayment.CurrentColumn.Name == "cmdDelete")
     {
         if (MessageBox.Show("تمامی اطلاعات مربوط به این پرداخت حذف خواهند گردید. آیا تأیید می نمایید؟", "", MessageBoxButtons.YesNo) == DialogResult.Yes)
         {
             dataAccess.ExecuteAccess("delete from tbl_Payment where cntr_no = " + grdPayment.SelectedRows[0].Cells["Tbl_Payment.Cntr_No"].Value.ToString() +
                                      " and Pay_Date = '" + grdPayment.SelectedRows[0].Cells["Pay_Date"].Value.ToString() +
                                      "' and Pay_Balance = " + grdPayment.SelectedRows[0].Cells["Pay_Balance"].Value.ToString());
             btnRefreshPayment_Click(null, null);
         }
     }
     else if (grdPayment.CurrentColumn.Name == "cmdUpdate")
     {
         frmPaymentInsertUpdate frm = new frmPaymentInsertUpdate(dtCust, this,
                                                                 grdPayment.CurrentRow.Cells["Cust_No"].Value.ToString(),
                                                                 grdPayment.CurrentRow.Cells["Pay_Balance"].Value.ToString(),
                                                                 grdPayment.CurrentRow.Cells["Pay_Date"].Value.ToString());
         if (frm.ShowDialog() == DialogResult.OK)
         {
             btnRefreshPayment_Click(null, null);
         }
     }
 }