public EndErrand()
        {
            InitializeComponent();

            _userService     = new UserService();
            _mechanicService = new MechanicService();
            _mechanicdb      = new DataAccess <Mechanic>();
            //errandList = _userService.ListErrands();
            //_activeErrandList = _mechanicService.ListActiveErrands();
            //_endErrandList = _mechanicService.ListEndErrands();

            Errands.ItemsSource    = _mechanicService.ListActiveErrands();
            EndErrands.ItemsSource = _mechanicService.ListEndErrands();
        }
        private void EndErrand_button_Click(object sender, RoutedEventArgs e)
        {
            if (Errands.SelectedItem == null)
            {
                MessageBox.Show("Du har inte valt ett ärende.");

                return;
            }

            Errand selectedErrand = (Errand)Errands.SelectedItem;

            _userService.EndActiveErrand(selectedErrand);

            //_activeErrandList = _mechanicService.ListActiveErrands();
            //_endErrandList = _mechanicService.ListEndErrands();
            Errands.ItemsSource    = _mechanicService.ListActiveErrands();
            EndErrands.ItemsSource = _mechanicService.ListEndErrands();
        }