Exemplo n.º 1
0
 private void PurchasedataGridView_CellClick(object sender, DataGridViewCellEventArgs e)
 {
     if (e.RowIndex != -1 && e.ColumnIndex != -1)
     {
         if (e.ColumnIndex == 6)
         {
             DataGridViewRow row = PurchasedataGridView.Rows[e.RowIndex];
             DialogResult    dr  = MessageBox.Show("Are you sure, you want to delete " + row.Cells["NameGV"].Value.ToString() + " from purchase invoice?\n\t\tWARNING\nDELETION OF PRODUCT WILL EFFECT STOCK", "Question...", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
             if (dr == DialogResult.Yes)
             {
                 using (TransactionScope sc = new TransactionScope())
                 {
                     i.insertDeletedItem(Convert.ToInt64(InvoiceDD.SelectedValue.ToString()), retrieval.USER_ID, Convert.ToInt32(row.Cells["ProductIDGV"].Value.ToString()), Convert.ToInt32(row.Cells["QuantityGV"].Value.ToString()), DateTime.Today);
                     object ob = r.getProductQuantity(Convert.ToInt32(row.Cells["ProductIDGV"].Value.ToString()));
                     int    q  = Convert.ToInt32(ob);
                     if (ob != null)
                     {
                         q -= Convert.ToInt32(row.Cells["ProductIDGV"].Value.ToString());
                         u.UpdateStock(Convert.ToInt32(row.Cells["ProductIDGV"].Value.ToString()), Convert.ToInt32(row.Cells["QuantityGV"].Value.ToString()));
                         float tot = Convert.ToSingle(GrossLbl.Text) - Convert.ToSingle(row.Cells["TotGV"].Value.ToString());
                         GrossLbl.Text = tot.ToString();
                         d.delete(Convert.ToInt64(row.Cells["PIDGV"].Value.ToString()), "st_deleteProductFromPID", "@PID");
                         PurchasedataGridView.Rows.Remove(row);
                     }
                     sc.Complete();
                 }
             }
         }
     }
 }
Exemplo n.º 2
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?", "Confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
         if (dr == DialogResult.Yes)
         {
             Deletion d = new Deletion();
             d.delete(catID, "st_deleteCategory", "@id");
             r.showCategory(CatdataGridView, categoryIDGV, CatNameGV, CatStatusGV);
         }
     }
 }
Exemplo n.º 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?", "Confirmation", 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);
         }
     }
 }
Exemplo n.º 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?", "Confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
         if (dr == DialogResult.Yes)
         {
             Deletion d = new Deletion();
             d.delete(suppID, "st_deleteSupplier", "@suppID");
             r.showSupplier(SupplierdataGridView, SupplierIDGV, CompanyGV, ContactPersonGV, Phone1GV, Phone2GV, AddressGV, TinGV, StatusGV);
         }
     }
 }
Exemplo n.º 5
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?", "Confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
         if (dr == DialogResult.Yes)
         {
             Deletion d = new Deletion();
             d.delete(proID, "st_deleteProduct", "@id");
             r.showProduct(ProductdataGridView, ProductIDGV, NameGV, BarcodeGV, ExpiryGV, CategoryGV, CategoryIDGV);
         }
     }
 }