예제 #1
0
 private void btn_print_Click(object sender, RoutedEventArgs e)
 {
     if (App.LevelAccess == "shipment")
     {
         Forms.PrintShipments print = new Forms.PrintShipments();
         print.ShowDialog();
     }
     else if (App.LevelAccess == "warehouse")
     {
         Forms.PrintWarehouse print = new Forms.PrintWarehouse();
         print.ShowDialog();
     }
     else
     {
         MessageBoxResult result = MessageBox.Show("Вам открыть окно вид для сбыта?", "Внимание", MessageBoxButton.YesNo, MessageBoxImage.Asterisk);
         if (result == MessageBoxResult.Yes)
         {
             Forms.PrintShipments print = new Forms.PrintShipments();
             print.ShowDialog();
         }
         else
         {
             Forms.PrintWarehouse print = new Forms.PrintWarehouse();
             print.ShowDialog();
         }
     }
 }
예제 #2
0
        private void btn_print_Click(object sender, RoutedEventArgs e)
        {
            switch (App.LevelAccess)
            {
            case "shipment":
            {
                Forms.PrintShipments print = new Forms.PrintShipments();
                print.ShowDialog();
                break;
            }

            case "warehouse":
            {
                Forms.PrintWarehouse print = new Forms.PrintWarehouse();
                print.ShowDialog();
                break;
            }

            default:
            {
                MessageBoxResult?result = MessageBox.Show("Открыть окно вид для сбыта?", "Внимание",
                                                          MessageBoxButton.YesNo, MessageBoxImage.Asterisk);
                if (result == MessageBoxResult.Yes)
                {
                    Forms.PrintShipments print = new Forms.PrintShipments();
                    print.ShowDialog();
                }
                else
                {
                    Forms.PrintWarehouse print = new Forms.PrintWarehouse();
                    print.ShowDialog();
                }
                break;
            }
            }
        }