Exemplo n.º 1
0
 private void productsLw_SelectedIndexChanged(object sender, EventArgs e)
 {
     try
     {
         Product product = Products.FindProduct(int.Parse(productsLw.SelectedItems[0].SubItems[0].Text));
         if (product != null)
         {
             ProductForm productForm = new ProductForm(product);
             productForm.Focus();
             productForm.Show();
         }
         else
         {
             MessageBox.Show("Couldn't find the user, please try again", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
     }
     catch (Exception exception)
     {
         Console.WriteLine(exception);
     }
 }
Exemplo n.º 2
0
 private void resultsLb_SelectedValueChanged(object sender, EventArgs e)
 {
     try
     {
         if (type == ManageType.EMPLOYEE)
         {
             EmployeeForm employeeForm = new EmployeeForm(foundUsers[resultsLb.SelectedIndex]);
             employeeForm.Show();
         }
         else
         {
             ProductForm productForm = new ProductForm(Products.FindProduct(resultsLb.SelectedItem.ToString()));
             productForm.Show();
         }
         resultsLb.Items.Clear();
     }
     catch (Exception exception)
     {
         Console.WriteLine(exception);
     }
 }