Пример #1
0
        //Setting case to diagnose status and show the started case
        private void BtnStart_Click(object sender, RoutedEventArgs e)
        {
            selected = (Case)lsvComingCases.SelectedItem;
            try
            {
                TechnicianViewModel.SetCaseStatus(selected, "Diagnose");
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            TechnicianCurrentCaseView view = new TechnicianCurrentCaseView(selected, LoggedUser);

            view.Show();
            try
            {
                UpdateComingList(sender, e);
            }
            catch (Exception)
            {
                throw;
            }
            //lsvComingCases.DataContext = TechnicianViewModel.GetWorkOrders("'Registered'");
            //lsvComingCases.SelectedIndex = 0;
        }
Пример #2
0
 //Search individual cases from database
 private void BtnSearch_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         int  temp = Convert.ToInt32(txtCaseId.Text);
         Case job  = TechnicianViewModel.GetWorkOrder(temp);
         if (job.Id == 0)
         {
             MessageBox.Show("Keikkaa ei löydy");
         }
         else
         {
             TechnicianCurrentCaseView view = new TechnicianCurrentCaseView(job, LoggedUser);
             view.Show();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("Tapahtui virhe\n" + ex.Message);
     }
 }
Пример #3
0
        private void ShowCurrentCase(object sender, RoutedEventArgs e)
        {
            TechnicianCurrentCaseView view = new TechnicianCurrentCaseView(selected, LoggedUser);

            view.Show();
        }