Exemple #1
0
        private void WorksListBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            var selectedWork = WorksListBox.SelectedItem as Work;

            if (selectedWork != null)
            {
                if (selectedWork.State == "Felvett")
                {
                    if (MessageBox.Show("Elkezded ezt a munkát?", "Figyelmeztetés", MessageBoxButton.YesNo) == MessageBoxResult.Yes)
                    {
                        selectedWork.State = "Elkezdett";
                        WorkDataProvider.UpdateWork(selectedWork);
                        UpdateWork();
                    }
                }
                else if (selectedWork.State == "Elkezdett")
                {
                    if (MessageBox.Show("Befejezed ezt a munkát?", "Figyelmeztetés", MessageBoxButton.YesNo) == MessageBoxResult.Yes)
                    {
                        selectedWork.State = "Befejezett";
                        WorkDataProvider.UpdateWork(selectedWork);
                        UpdateWork();
                    }
                }
            }
            WorksListBox.UnselectAll();
        }
        private void WorksListBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            var selectedWork = WorksListBox.SelectedItem as Work;

            if (selectedWork != null)
            {
                var window = new ModifyWindow(selectedWork);
                if (window.ShowDialog() ?? false)
                {
                    UpdateWork();
                }
            }
            WorksListBox.UnselectAll();
        }