Exemple #1
0
        // Вход администратора
        private void btLoginAdm_Click(object sender, RoutedEventArgs e)
        {
            Admin_panel openmain = new Admin_panel();

            try
            {
                FbConnectionStringBuilder fb_con = new FbConnectionStringBuilder();

                fb_con.Charset    = "UTF8";
                fb_con.UserID     = "SYSDBA";
                fb_con.Password   = "******";
                fb_con.Database   = "C:\\Users\\ARTEM\\Documents\\Visual Studio 2013\\Projects\\GreatestApplicatioInMyLife\\DB\\MAINDB.fdb";
                fb_con.ServerType = 0;
                fb = new FbConnection(fb_con.ToString());
                fb.Open();


                try
                {
                    ////////////////////////////////Процедура проверки пароля
                    FbCommand    sqlpas    = new FbCommand("select * from CHECK_ADMIN_PAS('" + pb_admin.Text + "')", fb);
                    FbDataReader readerpas = sqlpas.ExecuteReader();
                    DataTable    dt_pas    = new DataTable();
                    dt_pas.Load(readerpas);
                    if (dt_pas.Rows[0][0].ToString() == "1")
                    {
                        System.Windows.MessageBox.Show("Введите правильный пароль!");
                    }
                    else
                    {
                        try
                        {
                            openmain.preh = this;

                            openmain.Show();
                            this.Close();
                        }

                        catch
                        {
                            System.Windows.MessageBox.Show("Введенные данные неверны");
                        }
                    }
                }
                catch { System.Windows.MessageBox.Show("Укажите все необходимые данные!"); }
            }
            catch { System.Windows.MessageBox.Show("Не удается подключиться к базе данных!"); }
        }
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.admin_panel = ((GreatestApplicatioInMyLife.Admin_panel)(target));
                return;

            case 2:
                this.mainMenu = ((DevExpress.Xpf.Bars.MainMenuControl)(target));
                return;

            case 3:

            #line 28 "..\..\..\Admin_panel.xaml"
                ((DevExpress.Xpf.Bars.BarButtonItem)(target)).ItemClick += new DevExpress.Xpf.Bars.ItemClickEventHandler(this.BarButtonItem_ItemClick);

            #line default
            #line hidden
                return;

            case 4:
                this.btExitApp = ((DevExpress.Xpf.Bars.BarButtonItem)(target));

            #line 32 "..\..\..\Admin_panel.xaml"
                this.btExitApp.ItemClick += new DevExpress.Xpf.Bars.ItemClickEventHandler(this.btExitApp_ItemClick);

            #line default
            #line hidden
                return;

            case 5:

            #line 33 "..\..\..\Admin_panel.xaml"
                ((DevExpress.Xpf.Bars.BarButtonItem)(target)).ItemClick += new DevExpress.Xpf.Bars.ItemClickEventHandler(this.BarSubItem_ItemClick);

            #line default
            #line hidden
                return;

            case 6:
                this.statusBar = ((DevExpress.Xpf.Bars.StatusBarControl)(target));
                return;

            case 7:
                this.DemoDockContainer = ((DevExpress.Xpf.Docking.DockLayoutManager)(target));
                return;

            case 8:
                this.lgMain = ((DevExpress.Xpf.Docking.LayoutGroup)(target));
                return;

            case 9:
                this.DocumentHost = ((DevExpress.Xpf.Docking.DocumentGroup)(target));
                return;

            case 10:
                this.doc_container = ((DevExpress.Xpf.Docking.DockLayoutManager)(target));
                return;

            case 11:
                this.arrive_documents = ((DevExpress.Xpf.Docking.LayoutPanel)(target));
                return;

            case 12:
                this.space_tree = ((System.Windows.Controls.ColumnDefinition)(target));
                return;

            case 13:
                this.Tree_SP = ((System.Windows.Controls.StackPanel)(target));
                return;

            case 14:
                this.but_refresh_tree = ((DevExpress.Xpf.Bars.BarButtonItem)(target));

            #line 65 "..\..\..\Admin_panel.xaml"
                this.but_refresh_tree.ItemClick += new DevExpress.Xpf.Bars.ItemClickEventHandler(this.but_refresh_tree_ItemClick);

            #line default
            #line hidden
                return;

            case 15:
                this.grid_war = ((DevExpress.Xpf.Grid.GridControl)(target));

            #line 68 "..\..\..\Admin_panel.xaml"
                this.grid_war.SelectedItemChanged += new DevExpress.Xpf.Grid.SelectedItemChangedEventHandler(this.grid_war_SelectedItemChanged);

            #line default
            #line hidden

            #line 68 "..\..\..\Admin_panel.xaml"
                this.grid_war.Loaded += new System.Windows.RoutedEventHandler(this.grid_war_Loaded);

            #line default
            #line hidden
                return;

            case 16:
                this.view_grid_tree_war = ((DevExpress.Xpf.Grid.TableView)(target));
                return;

            case 17:
                this.but_nom = ((DevExpress.Xpf.Bars.BarButtonItem)(target));

            #line 78 "..\..\..\Admin_panel.xaml"
                this.but_nom.ItemClick += new DevExpress.Xpf.Bars.ItemClickEventHandler(this.but_nom_ItemClick);

            #line default
            #line hidden
                return;

            case 18:
                this.but_del = ((DevExpress.Xpf.Bars.BarButtonItem)(target));

            #line 79 "..\..\..\Admin_panel.xaml"
                this.but_del.ItemClick += new DevExpress.Xpf.Bars.ItemClickEventHandler(this.but_del_ItemClick);

            #line default
            #line hidden
                return;

            case 19:
                this.but_refresh = ((DevExpress.Xpf.Bars.BarButtonItem)(target));

            #line 80 "..\..\..\Admin_panel.xaml"
                this.but_refresh.ItemClick += new DevExpress.Xpf.Bars.ItemClickEventHandler(this.but_refresh_ItemClick);

            #line default
            #line hidden
                return;

            case 20:
                this.but_help = ((DevExpress.Xpf.Bars.BarButtonItem)(target));

            #line 81 "..\..\..\Admin_panel.xaml"
                this.but_help.ItemClick += new DevExpress.Xpf.Bars.ItemClickEventHandler(this.but_help_ItemClick);

            #line default
            #line hidden
                return;

            case 21:
                this.grid_res = ((DevExpress.Xpf.Grid.GridControl)(target));
                return;

            case 22:
                this.view_grid_res = ((DevExpress.Xpf.Grid.TableView)(target));
                return;

            case 23:
                this.roles_and_users = ((DevExpress.Xpf.Docking.LayoutPanel)(target));
                return;

            case 24:
                this.but_refresh_tree_roles = ((DevExpress.Xpf.Bars.BarButtonItem)(target));

            #line 102 "..\..\..\Admin_panel.xaml"
                this.but_refresh_tree_roles.ItemClick += new DevExpress.Xpf.Bars.ItemClickEventHandler(this.but_refresh_tree_roles_ItemClick);

            #line default
            #line hidden
                return;

            case 25:
                this.but_add_role = ((DevExpress.Xpf.Bars.BarButtonItem)(target));

            #line 103 "..\..\..\Admin_panel.xaml"
                this.but_add_role.ItemClick += new DevExpress.Xpf.Bars.ItemClickEventHandler(this.but_add_role1_ItemClick);

            #line default
            #line hidden
                return;

            case 26:
                this.but_change_role = ((DevExpress.Xpf.Bars.BarButtonItem)(target));

            #line 104 "..\..\..\Admin_panel.xaml"
                this.but_change_role.ItemClick += new DevExpress.Xpf.Bars.ItemClickEventHandler(this.but_change_role1_ItemClick);

            #line default
            #line hidden
                return;

            case 27:
                this.but_del_role = ((DevExpress.Xpf.Bars.BarButtonItem)(target));

            #line 105 "..\..\..\Admin_panel.xaml"
                this.but_del_role.ItemClick += new DevExpress.Xpf.Bars.ItemClickEventHandler(this.but_del_role1_ItemClick);

            #line default
            #line hidden
                return;

            case 28:
                this.grid_roles = ((DevExpress.Xpf.Grid.GridControl)(target));

            #line 108 "..\..\..\Admin_panel.xaml"
                this.grid_roles.Loaded += new System.Windows.RoutedEventHandler(this.grid_roles_Loaded);

            #line default
            #line hidden

            #line 108 "..\..\..\Admin_panel.xaml"
                this.grid_roles.SelectedItemChanged += new DevExpress.Xpf.Grid.SelectedItemChangedEventHandler(this.grid_roles_SelectedItemChanged);

            #line default
            #line hidden

            #line 108 "..\..\..\Admin_panel.xaml"
                this.grid_roles.KeyUp += new System.Windows.Input.KeyEventHandler(this.grid_roles1_KeyUp);

            #line default
            #line hidden
                return;

            case 29:
                this.view_grid_tree_roles = ((DevExpress.Xpf.Grid.TableView)(target));
                return;

            case 30:
                this.but_add_user = ((DevExpress.Xpf.Bars.BarButtonItem)(target));

            #line 118 "..\..\..\Admin_panel.xaml"
                this.but_add_user.ItemClick += new DevExpress.Xpf.Bars.ItemClickEventHandler(this.but_add_user_ItemClick);

            #line default
            #line hidden
                return;

            case 31:
                this.but_del_user = ((DevExpress.Xpf.Bars.BarButtonItem)(target));

            #line 119 "..\..\..\Admin_panel.xaml"
                this.but_del_user.ItemClick += new DevExpress.Xpf.Bars.ItemClickEventHandler(this.but_del_user_ItemClick);

            #line default
            #line hidden
                return;

            case 32:
                this.but_refresh_user = ((DevExpress.Xpf.Bars.BarButtonItem)(target));
                return;

            case 33:
                this.but_help_users = ((DevExpress.Xpf.Bars.BarButtonItem)(target));

            #line 121 "..\..\..\Admin_panel.xaml"
                this.but_help_users.ItemClick += new DevExpress.Xpf.Bars.ItemClickEventHandler(this.but_help_ItemClick);

            #line default
            #line hidden
                return;

            case 34:
                this.grid_users = ((DevExpress.Xpf.Grid.GridControl)(target));

            #line 123 "..\..\..\Admin_panel.xaml"
                this.grid_users.KeyUp += new System.Windows.Input.KeyEventHandler(this.grid_users_KeyUp);

            #line default
            #line hidden
                return;

            case 35:
                this.view_grid_users = ((DevExpress.Xpf.Grid.TableView)(target));
                return;
            }
            this._contentLoaded = true;
        }