Ejemplo n.º 1
0
 private void btnRemoveInvoice_Click(object sender, EventArgs e)
 {
     if (dgvDetails.SelectedRows.Count > 0)
     {
         int          selectedRowIndex = dgvDetails.SelectedCells[1].RowIndex;
         string       InvoiceNo        = dgvDetails.Rows[selectedRowIndex].Cells[0].Value.ToString();
         DialogResult dr = MessageBox.Show(InvoiceNo + " هل تريد مسح الفاتوره رقم", "مسح فاتوره", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
         if (dr == DialogResult.OK)
         {
             int InvoiceID = int.Parse(dgvDetails.Rows[selectedRowIndex].Cells[1].Value.ToString());
             int s         = Invoices.DeleteInvoice(InvoiceID);
             if (s > 0)
             {
                 SelectAllInvoices();
             }
         }
     }
     else
     {
         MessageBox.Show("اختر الفاتوره التي ترد حزفها");
     }
 }