private void dgvManagement_CellContentClick(object sender, DataGridViewCellEventArgs e)
 {
     if (dgvManagement.CurrentCell.ColumnIndex == 7) //remove
     {
         if (MessageBox.Show("Do you want to delete this record?", "", MessageBoxButtons.YesNo) == DialogResult.No)
         {
             return;
         }
         int       oiid      = Convert.ToInt32(dgvManagement.CurrentRow.Cells["OrderItemID"].Value);
         OrderItem orderitem = db.OrderItems.Where(x => x.ID == oiid).SingleOrDefault();
         db.OrderItems.Remove(orderitem);
         dgvManagement.Rows.Remove(dgvManagement.CurrentRow);
         db.SaveChanges();
     }
     else if (dgvManagement.CurrentCell.ColumnIndex == 6) //edit
     {
         int transactionid = Convert.ToInt32(dgvManagement.CurrentRow.Cells["TransactionTypeID"].Value);
         int oiid          = Convert.ToInt32(dgvManagement.CurrentRow.Cells["OrderItemID"].Value);
         if (transactionid == 1) //edit purchase order
         {
             PurchaseOrder form2 = new PurchaseOrder();
             form2.selectedOrderItem = db.OrderItems.Where(x => x.ID == oiid).SingleOrDefault();
             form2.ShowDialog();
         }
         else
         {
             WarehouseManagement form2 = new WarehouseManagement();
             form2.selectedOrderItem = db.OrderItems.Where(x => x.ID == oiid).SingleOrDefault();
             form2.ShowDialog();
         }
     }
 }
        private void warehouseManagementToolStripMenuItem_Click(object sender, EventArgs e)
        {
            WarehouseManagement form2 = new WarehouseManagement();

            form2.ShowDialog();
        }