private void displayDataGridView_CellClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex != -1 && e.ColumnIndex != -1) { if (e.ColumnIndex == 6) { DataGridViewRow row = displayDataGridView.Rows[e.RowIndex]; DialogResult dr = MessageBox.Show("Are you sure, you want to delete" + row.Cells["proGV"].Value.ToString() + "from purchase invoice?\n\t\t\tWARNING\nDELETION OF PRODUCT WILL EFFECT STOCK", "Question", MessageBoxButtons.YesNo, MessageBoxIcon.Question); int q; if (dr == DialogResult.Yes) { using (TransactionScope sc = new TransactionScope()) { i.insertDeletedItem(Convert.ToInt64(purchaseInvoiceComboBox.SelectedValue.ToString()), Convert.ToInt32(row.Cells["proIDGV"].Value.ToString()), Convert.ToInt32(row.Cells["quantGV"].Value.ToString()), retrival.USER_ID, DateTime.Today); object ob = r.getProductQuantity(Convert.ToInt32(row.Cells["proIDGV"].Value.ToString())); if (ob != null) { q = Convert.ToInt32(ob); q -= Convert.ToInt32(row.Cells["quantGV"].Value.ToString()); u.updateStock(Convert.ToInt32(row.Cells["proIDGV"].Value.ToString()), q); float tot = Convert.ToSingle(grossLabel.Text) - Convert.ToSingle(row.Cells["totalGV"].Value.ToString()); grossLabel.Text = tot.ToString(); d.delete(Convert.ToInt64(row.Cells["mPIDgv"].Value.ToString()), "sp_deleteProductFromPID", "@mPID"); displayDataGridView.Rows.Remove(row); } sc.Complete(); } } } } }
public override void deleteButton_Click(object sender, EventArgs e) { if (edit == 1) { DialogResult dr = MessageBox.Show("Are you sure, you want to Delete record?", "Question..", MessageBoxButtons.YesNo, MessageBoxIcon.Warning); if (dr == DialogResult.Yes) { deletion d = new deletion(); d.delete(prodId, "s_productDelete", "@proid"); r.showProducts(displayDataGridView, proIDGV, proGV, ExpiryGV, catGV, barcodeGV, CatIDGV); } } }
public override void deleteButton_Click(object sender, EventArgs e) { if (edit == 1) { DialogResult dr = MessageBox.Show("Are you sure, you want to Delete record?", "Question..", MessageBoxButtons.YesNo, MessageBoxIcon.Warning); if (dr == DialogResult.Yes) { deletion d = new deletion(); d.delete(userId, "st_deleteUser", "@id"); r.showUsers(displayDataGridView, userIDGV, NameGV, UserNameGV, passGV, EmailGV, PhoneGV, statusGV); } } }
public override void deleteButton_Click(object sender, EventArgs e) { if (edit == 1) { DialogResult dr = MessageBox.Show("Are you sure, you want to Delete record?", "Question..", MessageBoxButtons.YesNo, MessageBoxIcon.Warning); if (dr == DialogResult.Yes) { deletion d = new deletion(); d.delete(catId, "st_deleteCatergory", "@id"); r.showCategories(displayDataGridView, catIDGV, NameGV, statusGV); } } }
public override void deleteButton_Click(object sender, EventArgs e) { if (edit == 1) { DialogResult dr = MessageBox.Show("Are you sure, you want to Delete record?", "Question..", MessageBoxButtons.YesNo, MessageBoxIcon.Warning); if (dr == DialogResult.Yes) { deletion d = new deletion(); d.delete(supplierId, "sp_deleteSupplier", "@suppID"); r.showSuppliers(displayDataGridView, suppIDGV, comGV, conPerGV, phone1GV, phone2GV, addressGV, ntnGV, statusGV); } } }