private void BtnSave_Click(object sender, RoutedEventArgs e)
 {
     if (PW.Access(1) && Utl.YesNo("Сохранить протокол?"))
     {
         ViewProtocolController.SaveProtocol();
     }
 }
        private void btnClick(object sender, RoutedEventArgs e)
        {
            Button btn = sender as Button;

            switch (btn.Name)
            {
            case "btnBack":
                ((MainWindow)App.Current.MainWindow).btn_BackMenu();
                break;

            case "btnDel":
                if (SavedListBox.SelectedItems.Count != 0)
                {
                    if (PW.Access(1))
                    {
                        if (Utl.YesNo("Удалить выбранные?"))
                        {
                            spm.DeleteMarked(SavedListBox.SelectedItems);
                        }
                    }
                    SavedListBox.SelectedIndex = -1;
                }
                break;

            case "btnMarkAll":

                if (!markedAll)
                {
                    SavedListBox.SelectAll();
                    markedAll          = true;
                    btnMarkAll.Content = "снять выделение";
                }
                else
                {
                    SavedListBox.UnselectAll();
                    markedAll          = false;
                    btnMarkAll.Content = "выделить всё";
                }
                break;

            case "btnOpen":
                if (SavedListBox.SelectedItems.Count != 0)
                {
                    if (SavedListBox.SelectedItems.Count == 1)
                    {
                        ViewProtocolController vpc =
                            new ViewProtocolController(
                                ((SavedProtocolsManager.SavedElement)SavedListBox.SelectedItems[0]).ProtocolPath);
                        vpc.ShowProtocolPage();

                        SavedListBox.SelectedIndex = -1;
                    }
                    else
                    {
                        Utl.Message("Для просмотра выберите только один протокол");
                    }
                }
                break;
            }
        }
        private void Print_Click(object sender, RoutedEventArgs e)
        {
            if (PW.Access(1) && Utl.YesNo("Печатать?"))
            {
                switch (EngineerMenu.PC.PrintWaySlType.V)
                {
                case 0:
                    ViewProtocolController.Print();
                    break;

                case 1:
                    ViewProtocolController.PrintPdf();
                    break;

                default:
                    ViewProtocolController.PrintPdf();
                    break;
                }
            }
        }