Example #1
0
        private void menuItemUpdate_Click(object sender, RoutedEventArgs e)
        {
            var command = ((MenuItem)sender).Command;

            if (command.CanExecute(null))
            {
                int id;
                if (Int32.TryParse(tbSelectedId.Text, out id))
                {
                    try
                    {
                        command.Execute(id);

                        EditOrderWindow w = new EditOrderWindow();
                        w.ShowDialog();
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show(ex.Message, "Không thể thực hiện thao tác này", MessageBoxButton.OK, MessageBoxImage.Error);
                    }
                }
            }
        }
Example #2
0
        private void MenuItem_Click(object sender, RoutedEventArgs e)
        {
            EditOrderWindow w = new EditOrderWindow();

            w.ShowDialog();
        }