예제 #1
0
        public Dam(List <SpExtrato> _ListaSelecionados, List <SpExtrato> _ListaTributos)
        {
            InitializeComponent();
            tBar.Renderer                  = new MySR();
            _lista_selecionados            = _ListaSelecionados;
            _extrato                       = _ListaTributos;
            DataVencimentoText.Text        = DateTime.Now.ToString("dd/MM/yyyy");
            HonoraioCheckBox.Enabled       = gtiCore.GetBinaryAccess((int)TAcesso.DAM_Honorario);
            DesativarRefisCheckBox.Enabled = gtiCore.GetBinaryAccess((int)TAcesso.DAM_Desativar_Refis);
            bool bAllow = gtiCore.GetBinaryAccess((int)TAcesso.DAM_Desconto);

            if (!bAllow)
            {
                MultaUpDown.Enabled           = false;
                CorrecaoUpDown.Enabled        = false;
                JurosUpDown.Enabled           = false;
                MultaRefreshButton.Enabled    = false;
                JurosRefreshButton.Enabled    = false;
                CorrecaoRefreshButton.Enabled = false;
                MultaUpDown.BackColor         = BackColor;
                JurosUpDown.BackColor         = BackColor;
                CorrecaoUpDown.BackColor      = BackColor;
            }
            Header();
            Carrega_Lista();
            MainListView.Items[0].Selected = true;
            MainListView.Focus();
        }
예제 #2
0
 private void CancelarButton_Click(object sender, EventArgs e)
 {
     bAddNew = false;
     ControlBehaviour(true);
     MainListView.Focus();
     if (MainListView.SelectedItems.Count == 0)
     {
         MainListView.Items[0].Selected = true;
     }
     MainListView_SelectedIndexChanged(null, null);
 }
 private void SearchStringPreviewKeyDown(object sender, KeyEventArgs e)
 {
     if (e.Key == Key.Enter)
     {
         e.Handled = true;
         ViewModel.SelectFullMatch();
     }
     else if (e.Key == Key.Down)
     {
         if (ViewModel.FoundEntities.Count > 0)
         {
             e.Handled = true;
             MainListView.Focus();
         }
     }
 }
예제 #4
0
 private void SearchStringPreviewKeyDown(object sender, KeyEventArgs e)
 {
     if (e.Key == Key.Enter)
     {
         e.Handled = true;
         if (ViewModel.SelectEntityCommand.CanExecute(""))
         {
             ViewModel.SelectEntityCommand.Execute("");
         }
     }
     else if (e.Key == Key.Down)
     {
         if (ViewModel.FoundEntities.Count > 0)
         {
             e.Handled = true;
             MainListView.Focus();
         }
     }
 }
예제 #5
0
 private void FoucsToListViewAndUp()
 {
     if (!_listViewFoucsed)
     {
         _listViewSelectedRowOffset = MainListView.Items.Count - 1 > 0 ? MainListView.Items.Count - 1 : 0;
         _listViewFoucsed           = true;
         MainListView.Focus();
         MainListView.Items[_listViewSelectedRowOffset].Selected = true;
     }
     else
     {
         _listViewSelectedRowOffset -= 1;
         if (_listViewSelectedRowOffset < 0)
         {
             _listViewSelectedRowOffset = MainListView.Items.Count - 1 > 0 ? MainListView.Items.Count - 1 : 0;
         }
         MainListView.Focus();
         MainListView.Items[_listViewSelectedRowOffset].Selected = true;
     }
 }
예제 #6
0
 private void FoucsToListViewAndDown()
 {
     if (!_listViewFoucsed)
     {
         _listViewSelectedRowOffset = 0;
         _listViewFoucsed           = true;
         MainListView.Focus();
         MainListView.Items[_listViewSelectedRowOffset].Selected = true;
     }
     else
     {
         _listViewSelectedRowOffset += 1;
         if (_listViewSelectedRowOffset >= MainListView.Items.Count)
         {
             _listViewSelectedRowOffset = 0;
         }
         MainListView.Focus();
         MainListView.Items[_listViewSelectedRowOffset].Selected = true;
     }
 }
예제 #7
0
        private void AddFileMenuItem_Click(object sender, RoutedEventArgs e)
        {
            var addFileMenuItem = e.Source as MenuItem;

            if (addFileMenuItem != null)
            {
                var formatInfo = FileDialogFormatInfoFactory.Create(addFileMenuItem.Tag.ToString());

                var openFileDialog = new Microsoft.Win32.OpenFileDialog
                {
                    RestoreDirectory = true,

                    Multiselect = true,
                    Title       = formatInfo.Title,
                    Filter      = formatInfo.Filter
                };

                var dialogRes = openFileDialog.ShowDialog();

                if (dialogRes.HasValue && dialogRes.Value == true)
                {
                    if (formatInfo.Format != LcmsIdentificationTool.Description)
                    {
                        foreach (var fileName in openFileDialog.FileNames)
                        {
                            if (fileName.EndsWith("msgfdb_syn.txt"))
                            {
                                formatInfo.Format = LcmsIdentificationTool.MsgfPlus;
                            }
                            else if (fileName.EndsWith("_syn.txt"))
                            {
                                formatInfo.Format = LcmsIdentificationTool.Sequest;
                            }
                            else if (fileName.EndsWith("_xt.txt"))
                            {
                                formatInfo.Format = LcmsIdentificationTool.XTandem;
                            }
                            else if (fileName.EndsWith("msalign_syn.txt"))
                            {
                                formatInfo.Format = LcmsIdentificationTool.MSAlign;
                            }

                            AnalysisJobViewModel.AnalysisJobItems.Add(new AnalysisJobItem(fileName, formatInfo.Format));

                            if (formatInfo.Format == LcmsIdentificationTool.MSAlign)
                            {
                                AnalysisJobViewModel.Options.TargetFilterType = TargetWorkflowType.TOP_DOWN;
                            }
                        }
                    }
                    else
                    {
                        var analysisJobDescriptionReader = new AnalysisJobDescriptionReader();

                        foreach (var fileName in openFileDialog.FileNames)
                        {
                            try
                            {
                                foreach (var analysisJobItem in analysisJobDescriptionReader.Read(fileName))
                                {
                                    AnalysisJobViewModel.AnalysisJobItems.Add(analysisJobItem);
                                }
                            }
                            catch
                            {
                                MessageBox.Show(
                                    this, String.Format(
                                        "MTDB Creator cannot read this file.{0}This is not a valid Dataset Description file, or its format is not correct.{0}{0}{1}",
                                        Environment.NewLine, fileName), Application.Current.MainWindow.Tag.ToString(),
                                    MessageBoxButton.OK, MessageBoxImage.Warning);
                            }
                        }
                    }

                    MainListView.Focus();
                }
            }
        }