예제 #1
0
        private void AddCustomers_Click(object sender, RoutedEventArgs e)
        {
            CustomersWindow customersWindow = new CustomersWindow()
            {
                UserData    = this.UserData,
                RecordsData = customers,
            };

            customersWindow.ShowDialog();
        }
예제 #2
0
        private void Customers_Click(object sender, RoutedEventArgs e)
        {
            var customersWindow = new CustomersWindow()
            {
                UserData = this.UserData
            };

            customersWindow.ShowDialog();
            if (UserData.AccessQuote == true)
            {
                //using (SqlConnection connection = new SqlConnection(Database.ConnectionString))
                //    newProjects = InquiryController.CountNewInquiries(connection, UserData.UserID);

                //DataContext = new { newProjects };
            }
        }
        public MainWindowViewModel()
        {
            LoadedWindowCommand = new RelayCommand <Window>((p) => { return(true); }, (p) =>
            {
                isLoaded = true;
                if (p == null)
                {
                    return;
                }
                p.Hide();
                LoginWindow loginWindow = new LoginWindow();
                loginWindow.ShowDialog();

                if (loginWindow.DataContext == null)
                {
                    return;
                }
                var loginVM = loginWindow.DataContext as LoginWindowViewModel;
                if (loginVM.IsLogin)
                {
                    p.Show();
                }
                else
                {
                    p.Close();
                }
            });

            OpenUnitWindowCommand = new RelayCommand <object>((p) => { return(true); }, (p) =>
            {
                UnitWindow unitWindow = new UnitWindow();
                unitWindow.ShowDialog();
            });

            OpenSuppliersWindowCommand = new RelayCommand <object>((p) => { return(true); }, (p) => { SuppliersWindow sW = new SuppliersWindow(); sW.ShowDialog(); });
            OpenCustomersWindowCommand = new RelayCommand <object>((p) => { return(true); }, (p) => { CustomersWindow cW = new CustomersWindow(); cW.ShowDialog(); });
            OpenProductsWindowCommand  = new RelayCommand <object>((p) => { return(true); }, (p) => { ProductsWindow pW = new ProductsWindow(); pW.ShowDialog(); });
            OpenUsersWindowCommand     = new RelayCommand <object>((p) => { return(true); }, (p) => { UsersWindow pW = new UsersWindow(); pW.ShowDialog(); });
            OpenInputWindowCommand     = new RelayCommand <object>((p) => { return(true); }, (p) => { InputWindow pW = new InputWindow(); pW.ShowDialog(); });
            OpenOutputWindowCommand    = new RelayCommand <object>((p) => { return(true); }, (p) => { OutputWindow pW = new OutputWindow(); pW.ShowDialog(); });
        }