Exemplo n.º 1
0
 private void buttonEdit_Click(object sender, EventArgs e)
 {
     if (listViewOrder.SelectedItems.Count > 0)
     {
         this.Hide();
         //get item seleted
         try
         {
             orderIdSelected = listViewOrder.SelectedItems[0].SubItems[0].Text;
         }
         catch (Exception exception)
         {
             Console.WriteLine("An error occurred: '{0}'", exception);
         }
         //show new form
         FormUpdateOrder formUpdateOrder = new FormUpdateOrder();
         formUpdateOrder.Show();
     }
     else
     {
         MessageBox.Show("Please select one row to update!");
     }
 }
Exemplo n.º 2
0
        private void buttonEdit_Click(object sender, EventArgs e)
        {
            if (listViewOrder.SelectedItems.Count > 0)
            {

                this.Hide();
                //get item seleted
                try
                {
                    orderIdSelected = listViewOrder.SelectedItems[0].SubItems[0].Text;
                }
                catch (Exception exception)
                {
                    Console.WriteLine("An error occurred: '{0}'", exception);
                }
                //show new form
                FormUpdateOrder formUpdateOrder = new FormUpdateOrder();
                formUpdateOrder.Show();
            }
            else
            {
                MessageBox.Show("Please select one row to update!");
            }
        }