/// <summary> /// Constructeur de la classe MainWindow /// </summary> public MainWindow() { try { InitializeComponent(); import = new ImportWindow(); createIndic = new CreateIndicWindow(); compareIndic = new CompareIndicWindow(); extract = new ExtractWindow(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void buttonImport_Click(object sender, RoutedEventArgs e) { ImportWindow importWindow = new ImportWindow(); if (importWindow.ShowDialog() == false) { if (importWindow.dataWasImported) { if (ValidationService.TableIsValid(importWindow.mainTable)) { mainDataGrid = DataTableService.InsertDataToGrid(importWindow.mainTable, mainDataGrid); mainTable = importWindow.mainTable; } else { MessageBox.Show("W pliku występują braki danych!", "Błąd", MessageBoxButton.OK, MessageBoxImage.Error); } } } }
private void PushImportPage(object obj) { List <ObjectItemTypeDefinationModel> selectedData = GetAllSelectedChildrens(Tree); MaskDescriptionModel mappedDesc = new MaskDescriptionModel(); List <ObjectitemTabTree> Tabmodel = new List <ObjectitemTabTree>(); List <ObjectitemToDragToTree> attModel = new List <ObjectitemToDragToTree>(); var definations = GetAllAttribute(); definations.ForEach(x => { if (x.Name != "Project System Templates") { attModel.Add(new ObjectitemToDragToTree(x)); } }); //attModel.Add(new ObjectitemToDragToTree(definations)); foreach (var item in selectedData) { mappedDesc.FolderName = item.Name; List <MaskDescriptionModel> ListmappedDesc = new List <MaskDescriptionModel>(); foreach (var types in item.FolderChildren) { var maskDesc = GetMaskDescription(types.Source.Id); MaskDescriptionModel childMapping = new MaskDescriptionModel(); childMapping.TreeView = MapMaskDescriptionModel(maskDesc); childMapping.Typename = types.Name; ListmappedDesc.Add(childMapping); } mappedDesc.TreeView = ListmappedDesc; Tabmodel.Add(new ObjectitemTabTree(mappedDesc)); } if (selectedData.Count == 0) { System.Windows.MessageBox.Show("Please Select Some Data!!!"); } else { ImportWindow importPage = new ImportWindow(); importPage.DataContext = new ImportWindowViewModel(this.myApplication, Tabmodel, attModel); importPage.ShowDialog(); } }
/// <summary> /// 支出管理 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void tsbExpenditure_Click(object sender, EventArgs e) { if (null == importWindow || importWindow.IsDisposed) { importWindow = new ImportWindow(); importWindow.MdiParent = this; importWindow.StartLoad += (obj, ev) => { StartLoad(obj); }; importWindow.StopLoad += (obj, ev) => { StopLoad(obj); }; importWindow.Show(); } SetSelect(tsbExpenditure, tsmiExpenditure); importWindow.Activate(); }
/// <summary> /// Command callback /// Opens the import window. /// </summary> private void OnImport() { ImportWindow wnd = new ImportWindow(); wnd.Show(); }
/// <summary> /// 点击 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private async void ButtonClick(object sender, RoutedEventArgs e) { if (!(sender is Button btn)) { return; } if (btn.Name.Equals(BtnChoose.Name)) { var dialog = new OpenFileDialog { Filter = "文本文件 (*.txt)|*.txt", RestoreDirectory = true }; if (dialog.ShowDialog() == true) { _vm.LogText = $"用户选择了账号文件:{dialog.FileName}"; _vm.Status.AccountFile = dialog.FileName; LoadUsers(_vm.Status.AccountFile); } } if (btn.Name.Equals(BtnSave.Name)) { if (_vm.Goods != null) { //验证字段是否 SaveGoods(_vm.Goods); } } if (btn.Name.Equals(BtnImport.Name)) { var im = new ImportWindow(this); im.Closed += ImportWindowClosed; im.Show(); } if (btn.Name.Equals(BtnRefresh.Name)) { //查询 _loadList(); } if (btn.Name.Equals(BtnRestart.Name)) { RestartTask(); } if (btn.Name.Equals(BtnStartRelease.Name)) { StartTask(); } if (btn.Name.Equals(BtnStopRelease.Name)) { StopTask(); } //保存配置文件 if (btn.Name.Equals(BtnSaveConfig.Name)) { SaveConfig(); Api.EnableProxy = _vm.Status.UseProxy; } }
public void ShowWindow() { Show(); ImportWindow.OnShowWindow(NewImportWindow.NewOrImport.New); }
public MainViewModel() { ImportWindow = new RelayCommand <Window>((p) => { return(true); }, (p) => { if (_UserIDRole != 1) { LoadDialogErrorNotPermission(); return; } ImportWindow wd = new ImportWindow(); wd.ShowDialog(); }); SellWindow = new RelayCommand <Window>((p) => { return(true); }, (p) => { SellWindow wd = new SellWindow(); wd.ShowDialog(); }); CustomerWindow = new RelayCommand <Window>((p) => { return(true); }, (p) => { if (_UserIDRole != 1) { LoadDialogErrorNotPermission(); return; } CustomerWindow wd = new CustomerWindow(); wd.ShowDialog(); }); ProductWindow = new RelayCommand <Window>((p) => { return(true); }, (p) => { if (_UserIDRole != 1) { LoadDialogErrorNotPermission(); return; } ProductWindow wd = new ProductWindow(); wd.ShowDialog(); }); SupplierWindow = new RelayCommand <Window>((p) => { return(true); }, (p) => { if (_UserIDRole != 1) { LoadDialogErrorNotPermission(); return; } SupplierWindow wd = new SupplierWindow(); wd.ShowDialog(); }); StatisticalWindow = new RelayCommand <Window>((p) => { return(true); }, (p) => { if (_UserIDRole != 1) { LoadDialogErrorNotPermission(); return; } StatisticalWindow wd = new StatisticalWindow(); wd.ShowDialog(); }); UnitWindow = new RelayCommand <Window>((p) => { return(true); }, (p) => { if (_UserIDRole != 1) { LoadDialogErrorNotPermission(); return; } UnitWindow wd = new UnitWindow(); wd.ShowDialog(); }); UserListWindow = new RelayCommand <Window>((p) => { return(true); }, (p) => { if (_UserIDRole != 1) { LoadDialogErrorNotPermission(); return; } UserListWindow wd = new UserListWindow(); wd.ShowDialog(); }); AccountCreateWindow = new RelayCommand <Window>((p) => { return(true); }, (p) => { if (_UserIDRole != 1) { LoadDialogErrorNotPermission(); return; } AccountCreateWindow wd = new AccountCreateWindow(); wd.ShowDialog(); }); BillWindow = new RelayCommand <Window>((p) => { return(true); }, (p) => { if (_UserIDRole != 1) { LoadDialogErrorNotPermission(); return; } BillWindow wd = new BillWindow(); wd.ShowDialog(); }); LoadMainWindow = new RelayCommand <Window>((p) => { return(true); }, (p) => { if (!isLoaded) { isLoaded = true; if (p == null) { return; } p.Hide(); LoginWindow wd = new LoginWindow(); wd.ShowDialog(); var loginViewModel = wd.DataContext as LoginViewModel; if (loginViewModel == null) { return; } if (loginViewModel.isLogin) { loadUserCurrentLogin(); p.Show(); } else { p.Close(); } } }); LoadEditCommand = new RelayCommand <object>((p) => { return(true); }, (p) => { LoadDialogAccountEdit(); }); }