private void btnLoading_Click(object sender, RoutedEventArgs e) { WindowEffects.ApplyEffect(this); // Выбрать Excel-файл и загрузить данные из него. Microsoft.Win32.OpenFileDialog dlg = new Microsoft.Win32.OpenFileDialog(); dlg.Title = "Выбрать шаблон для АСУ МС"; dlg.FileName = "Document"; dlg.DefaultExt = ".xlsm"; dlg.Filter = "Excel (macros) |*.xlsm|Excel documents (.xlsx)|*.xlsx|Excel documents 2003 (.xls)|*.xls"; Nullable <bool> result = dlg.ShowDialog(); if (result == true) { string fileName = dlg.FileName; PathToExcelDocument = fileName; // Записать путь к документу. AddUser_WriteMessageToConsole(String.Format("Подключен документ: {0}", PathToExcelDocument)); LoadDataFromExcel(); WindowEffects.ClearEffect(this); } else { WindowEffects.ClearEffect(this); return; } }
private void btnDrivers_Click(object sender, RoutedEventArgs e) { WindowEffects.ApplyEffect(this); AdditionalWindow additions = new AdditionalWindow(); additions.Owner = this; additions.ShowDialog(); WindowEffects.ClearEffect(this); }
private void btnLookData_Click(object sender, RoutedEventArgs e) { WindowEffects.ApplyEffect(this); CheckData dataWindow = new CheckData(ExcelData); dataWindow.Owner = this; dataWindow.ShowDialog(); WindowEffects.ClearEffect(this); }
private void TxtAbout_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e) { // О программе. About about = new About(); about.Owner = this; WindowEffects.ApplyEffect(this); about.ShowDialog(); WindowEffects.ClearEffect(this); }
private void btnAddUser_Click_1(object sender, RoutedEventArgs e) { // Добавление пользователя в prmUsers. WindowEffects.ApplyEffect(this); View.UserAdding addUser = new View.UserAdding(); addUser.Owner = this; addUser.WriteMessageToConsole += AddUser_WriteMessageToConsole; addUser.ShowDialog(); WindowEffects.ClearEffect(this); }
private void BtnSettings_Click(object sender, RoutedEventArgs e) { // окно настроек приложения. if (_settingsWindow == null) { _settingsWindow = new View.SettingsWindow(); _settingsWindow.Owner = this; WindowEffects.ApplyEffect(this); _settingsWindow.ShowDialog(); WindowEffects.ClearEffect(this); } else { WindowEffects.ApplyEffect(this); _settingsWindow.Visibility = Visibility; WindowEffects.ClearEffect(this); } }