예제 #1
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.adminWindow = ((Barcode.AdminWindow)(target));
                return;

            case 2:
                this.dataGrid = ((System.Windows.Controls.DataGrid)(target));
                return;

            case 3:

            #line 26 "..\..\AdminWindow.xaml"
                ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Delete);

            #line default
            #line hidden
                return;

            case 4:

            #line 27 "..\..\AdminWindow.xaml"
                ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Update);

            #line default
            #line hidden
                return;
            }
            this._contentLoaded = true;
        }
예제 #2
0
        private void LogIn(object sender, RoutedEventArgs e)
        {
            Window  window = null;
            Profile prof   = Authorization.Auth(txtLoginBox.Text, passBox.Password);

            if (prof is Admin)
            {
                window = new AdminWindow();
            }
            else if (prof is User)
            {
                window = new UserWindow();
            }
            else
            {
                MessageBox.Show("Неверные логин или пароль.", "Ошибка");
                return;
            }
            window.Show();
            this.Close();
        }