Ejemplo n.º 1
0
        // Functions

        void Auth(string login, string pass)
        {
            using (nkeEntities1 db = new nkeEntities1())
            {
                var User = db.Users.FirstOrDefault(x => x.Login == login && x.Password == pass);
                if (User != null)
                {
                    //switch (isUser.Role) {
                    //    case "Admin":
                    //        MessageBox.Show("Admin","Info",MessageBoxButton.OK,MessageBoxImage.Information);
                    //        break;
                    //    case "Teacher":
                    //        MessageBox.Show("Teacher", "Info", MessageBoxButton.OK, MessageBoxImage.Information);
                    //        break;
                    //    case "Student":
                    //        MessageBox.Show("Student", "Info", MessageBoxButton.OK, MessageBoxImage.Information);
                    //        break;
                    //    case "User":
                    //        MessageBox.Show("User", "Info", MessageBoxButton.OK, MessageBoxImage.Information);
                    //        break;
                    //    case "Internet":
                    //        MessageBox.Show("Internet", "Info", MessageBoxButton.OK, MessageBoxImage.Information);
                    //        break;
                    //}

                    UserPanel f = new UserPanel(User);
                    f.Show();
                }
                else
                {
                    System.Windows.MessageBox.Show("Неверный логин или пароль", "Ошибка", MessageBoxButton.OK, MessageBoxImage.Error);
                }
            }
        }
Ejemplo n.º 2
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.window = ((nke.UserPanel)(target));

            #line 10 "..\..\..\Pages\UserPanel.xaml"
                this.window.Closing += new System.ComponentModel.CancelEventHandler(this.window_Closing);

            #line default
            #line hidden
                return;

            case 3:
                this.TitleText = ((System.Windows.Controls.TextBlock)(target));
                return;

            case 4:
                this.spProgramms = ((System.Windows.Controls.StackPanel)(target));
                return;

            case 5:
                this.BrowserPublic = ((System.Windows.Controls.WebBrowser)(target));
                return;

            case 6:
                this.PublicBack = ((System.Windows.Controls.Button)(target));

            #line 79 "..\..\..\Pages\UserPanel.xaml"
                this.PublicBack.Click += new System.Windows.RoutedEventHandler(this.PublicBack_Click);

            #line default
            #line hidden
                return;

            case 7:
                this.PublicForward = ((System.Windows.Controls.Button)(target));

            #line 80 "..\..\..\Pages\UserPanel.xaml"
                this.PublicForward.Click += new System.Windows.RoutedEventHandler(this.PublicForward_Click);

            #line default
            #line hidden
                return;

            case 8:
                this.BrowserUser = ((System.Windows.Controls.WebBrowser)(target));
                return;

            case 9:
                this.UserBack = ((System.Windows.Controls.Button)(target));

            #line 87 "..\..\..\Pages\UserPanel.xaml"
                this.UserBack.Click += new System.Windows.RoutedEventHandler(this.UserBack_Click);

            #line default
            #line hidden
                return;

            case 10:
                this.UserForward = ((System.Windows.Controls.Button)(target));

            #line 88 "..\..\..\Pages\UserPanel.xaml"
                this.UserForward.Click += new System.Windows.RoutedEventHandler(this.UserForward_Click);

            #line default
            #line hidden
                return;

            case 11:
                this.StudentPanel = ((System.Windows.Forms.Integration.WindowsFormsHost)(target));
                return;

            case 12:
                this.panel1 = ((System.Windows.Forms.Panel)(target));
                return;

            case 13:
                this.AdminPanel = ((System.Windows.Controls.Grid)(target));
                return;

            case 14:
                this.UsersCB = ((System.Windows.Controls.ComboBox)(target));

            #line 109 "..\..\..\Pages\UserPanel.xaml"
                this.UsersCB.SelectionChanged += new System.Windows.Controls.SelectionChangedEventHandler(this.UsersCB_SelectionChanged);

            #line default
            #line hidden
                return;

            case 15:
                this.ProgrammsCheckBox = ((System.Windows.Controls.ListBox)(target));

            #line 112 "..\..\..\Pages\UserPanel.xaml"
                this.ProgrammsCheckBox.MouseDoubleClick += new System.Windows.Input.MouseButtonEventHandler(this.ProgrammsCheckBox_MouseDoubleClick);

            #line default
            #line hidden
                return;

            case 16:
                this.saveP = ((System.Windows.Controls.Button)(target));

            #line 120 "..\..\..\Pages\UserPanel.xaml"
                this.saveP.Click += new System.Windows.RoutedEventHandler(this.saveP_Click);

            #line default
            #line hidden
                return;

            case 17:
                this.addP = ((System.Windows.Controls.Button)(target));

            #line 121 "..\..\..\Pages\UserPanel.xaml"
                this.addP.Click += new System.Windows.RoutedEventHandler(this.addP_Click);

            #line default
            #line hidden
                return;

            case 18:
                this.ChatList = ((System.Windows.Controls.ListBox)(target));
                return;

            case 19:
                this.MessageText = ((System.Windows.Controls.TextBox)(target));

            #line 138 "..\..\..\Pages\UserPanel.xaml"
                this.MessageText.KeyDown += new System.Windows.Input.KeyEventHandler(this.MessageText_KeyDown);

            #line default
            #line hidden

            #line 138 "..\..\..\Pages\UserPanel.xaml"
                this.MessageText.PreviewDragEnter += new System.Windows.DragEventHandler(this.MessageText_DragEnter);

            #line default
            #line hidden

            #line 138 "..\..\..\Pages\UserPanel.xaml"
                this.MessageText.Drop += new System.Windows.DragEventHandler(this.MessageText_Drop);

            #line default
            #line hidden

            #line 138 "..\..\..\Pages\UserPanel.xaml"
                this.MessageText.DragEnter += new System.Windows.DragEventHandler(this.MessageText_DragEnter);

            #line default
            #line hidden

            #line 138 "..\..\..\Pages\UserPanel.xaml"
                this.MessageText.DragOver += new System.Windows.DragEventHandler(this.MessageText_DragOver);

            #line default
            #line hidden

            #line 138 "..\..\..\Pages\UserPanel.xaml"
                this.MessageText.PreviewDrop += new System.Windows.DragEventHandler(this.MessageText_Drop);

            #line default
            #line hidden

            #line 138 "..\..\..\Pages\UserPanel.xaml"
                this.MessageText.PreviewDragOver += new System.Windows.DragEventHandler(this.MessageText_DragOver);

            #line default
            #line hidden
                return;
            }
            this._contentLoaded = true;
        }
Ejemplo n.º 3
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.window = ((nke.UserPanel)(target));

            #line 9 "..\..\UserPanel.xaml"
                this.window.Loaded += new System.Windows.RoutedEventHandler(this.window_Loaded);

            #line default
            #line hidden
                return;

            case 2:
                this.spProgramms = ((System.Windows.Controls.StackPanel)(target));
                return;

            case 3:
                this.TitleText = ((System.Windows.Controls.TextBlock)(target));
                return;

            case 4:

            #line 61 "..\..\UserPanel.xaml"
                ((System.Windows.Controls.StackPanel)(target)).AddHandler(System.Windows.Controls.Primitives.ButtonBase.ClickEvent, new System.Windows.RoutedEventHandler(this.OpenProgramm));

            #line default
            #line hidden
                return;

            case 5:
                this.BrowserPublic = ((System.Windows.Controls.WebBrowser)(target));
                return;

            case 6:
                this.PublicBack = ((System.Windows.Controls.Button)(target));

            #line 65 "..\..\UserPanel.xaml"
                this.PublicBack.Click += new System.Windows.RoutedEventHandler(this.PublicBack_Click);

            #line default
            #line hidden
                return;

            case 7:
                this.PublicForward = ((System.Windows.Controls.Button)(target));

            #line 66 "..\..\UserPanel.xaml"
                this.PublicForward.Click += new System.Windows.RoutedEventHandler(this.PublicForward_Click);

            #line default
            #line hidden
                return;

            case 8:
                this.BrowserUser = ((System.Windows.Controls.WebBrowser)(target));
                return;

            case 9:
                this.UserBack = ((System.Windows.Controls.Button)(target));

            #line 76 "..\..\UserPanel.xaml"
                this.UserBack.Click += new System.Windows.RoutedEventHandler(this.UserBack_Click);

            #line default
            #line hidden
                return;

            case 10:
                this.UserForward = ((System.Windows.Controls.Button)(target));

            #line 77 "..\..\UserPanel.xaml"
                this.UserForward.Click += new System.Windows.RoutedEventHandler(this.UserForward_Click);

            #line default
            #line hidden
                return;

            case 11:
                this.panel1 = ((System.Windows.Forms.Panel)(target));
                return;
            }
            this._contentLoaded = true;
        }