Beispiel #1
0
        private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            int q;

            if (e.RowIndex != -1 && e.ColumnIndex != -1)
            {
                if (e.ColumnIndex == 6)
                {
                    DataGridViewRow row = dataGridView1.Rows[e.RowIndex];
                    DialogResult    dr  = MessageBox.Show("Are u sure,want to delete? " + row.Cells["proGV"].Value.ToString() + "from purchase invoice ?\nWARNING\t\nDELETION OF PRODUCT WILL EFFECT STOCK", "Question", MessageBoxButtons.YesNo, MessageBoxIcon.Information);
                    if (dr == DialogResult.Yes)
                    {
                        using (TransactionScope sc = new TransactionScope())
                        {
                            i.insertDeletedItem(Convert.ToInt64(purDD.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()), "st_deleteProductFromPID", "@mPID");
                                dataGridView1.Rows.Remove(row);
                            }

                            sc.Complete();
                        }
                    }
                }
            }
        }
Beispiel #2
0
 public virtual void deleteBtn_Click(object sender, EventArgs e)
 {
     if (edit == 1)
     {
         DialogResult dr = MessageBox.Show("Are you sure , you want to delete record?", "Question...", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
         if (dr == DialogResult.Yes)
         {
             deletion d = new deletion();
             d.delete(supplierID, "st_deleteSupplier", "@suppID");
             r.showSuppliers(dataGridView1, SuppIDGV, companyGV, personGV, phone1GV, phone2GV, addressGV, ntnGV, StatusGV);
         }
     }
 }
Beispiel #3
0
 public override void deleteBtn_Click(object sender, EventArgs e)
 {
     if (edit == 1)
     {
         DialogResult dr = MessageBox.Show("Are you sure , you want to delete record?", "Question...", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
         if (dr == DialogResult.Yes)
         {
             deletion d = new deletion();
             d.delete(catID, "st_deleteCategory", "@id");
             r.showCategories(dataGridView1, catIDGV, NameGV, StatusGV);
         }
     }
 }
Beispiel #4
0
 public override void deleteBtn_Click(object sender, EventArgs e)
 {
     if (edit == 1)
     {
         DialogResult dr = MessageBox.Show("Are you sure , you want to delete record?", "Question...", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
         if (dr == DialogResult.Yes)
         {
             deletion d = new deletion();
             d.delete(prodID, "st_productDelete", "@prodID");
             r.showProducts(dataGridView1, proIDGV, proGV, expiryGV, catGV, priceGV, barcodeGV, catIDGV);
         }
     }
 }
 public override void button4_Click(object sender, EventArgs e)
 {
     if (edit == 1)
     {
         {
             DialogResult dr = MessageBox.Show("Are you sure, you want to Delete Record", "Question..", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
             if (dr == DialogResult.Yes)
             {
                 deletion d = new deletion();
                 d.delete(userID, "st_deleteUser", "@id");
                 r.Showusers(dataGridView1, userIDGV, NameGV, UserNameGV, PassGV, EmailGV, PhoneGV, statusGV);
             }
         }
     }
 }
 public override void button4_Click(object sender, EventArgs e)
 {
     if (edit == 1)
     {
         {
             DialogResult dr = MessageBox.Show("Are you sure, you want to Delete Record", "Question..", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
             if (dr == DialogResult.Yes)
             {
                 deletion d = new deletion();
                 d.delete(SupplierID, "st_deleteSupplier", "@suppID");
                 r.showSupplier(dataGridView1, suppIDGV, companyGV, personGV, phone1GV, phone2GV, addressGV, ntnGV, statusGV);
             }
         }
     }
 }