Example #1
0
        private void btnSearchWorker_Click(object sender, RoutedEventArgs e)
        {
            SearchWorker searchWorker = new SearchWorker();

            searchWorker.ShowDialog();
            if (SearchWorker.findedWorker.Count != 0)
            {
                tbIdWorker.Text = SearchWorker.findedWorker[0].idWorker.ToString();
            }
            else
            {
                tbIdWorker.Text = string.Empty;
            }
        }
        private void btnAccept_Click(object sender, RoutedEventArgs e)
        {
            findedWorker = ProcessFactory.GetWorkerProcess().SearchWorker(tbNameWorker.Text);

            if (findedWorker.Count == 0)
            {
                if (MessageBox.Show("Not found. Repeat?", "Error search", MessageBoxButton.YesNo) == MessageBoxResult.Yes)
                {
                    this.Close();
                    SearchWorker searchWorker = new SearchWorker();
                    searchWorker.ShowDialog();
                }
            }
            this.Close();
        }