예제 #1
0
 private void btnDeleteSelected_Click(object sender, EventArgs e)
 {
     if (MessageBox.Show("Are you sure to delete this Product.", "Delete Product", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation) == DialogResult.Yes)
     {
         prd.DELETE_PRODUCT(this.dataGridView1.CurrentRow.Cells[0].Value.ToString());
         MessageBox.Show("Product Deleted Successfully.", "Delete Product", MessageBoxButtons.OK, MessageBoxIcon.Information);
         this.dataGridView1.DataSource = prd.GetAllProducts();
     }
     else
     {
         MessageBox.Show("Product Not Deleted", "Prodcut Delete", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
 private void button_DELETE_PRODUCT_Click(object sender, EventArgs e)
 {
     if (gridView1.RowCount > 0)
     {
         if (MessageBox.Show("هل  تريد حذف المنتج", "حذف", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation) == DialogResult.Yes)
         {
             String ID_PRD = gridView1.GetRowCellValue(gridView1.FocusedRowHandle, gridView1.Columns["ID_PRODUCT"]).ToString();
             PRD.DELETE_PRODUCT(ID_PRD);
             MessageBox.Show("تمت عملية الحذف", "حذف");
             this.GridControl_PRODUCTS.DataSource = PRD.GET_ALL_PRODUCTS();
         }
     }
 }
예제 #3
0
 private void btnDeleteProd_Click(object sender, EventArgs e)
 {
     if (dataGridViewPROD.RowCount > 0)
     {
         if (MessageBox.Show("هل تريد اتمام عملية الحذف؟", "عملية حذف", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation) == DialogResult.Yes)
         {
             prod.DELETE_PRODUCT(Convert.ToInt32(this.dataGridViewPROD.CurrentRow.Cells[0].Value));
             MessageBox.Show("تم الحذف");
             dataGridViewPROD.DataSource       = prod.GET_ALL_PRODUCTS(is_item_inner);
             dataGridViewsTATISTICS.DataSource = receipt_cls.GET_SALES_STATISTICS();
         }
         else
         {
             MessageBox.Show("تم الغاء عملية الحذف");
         }
     }
     else
     {
         MessageBox.Show("عفوا لا توجد منتجات ");
     }
 }