Exemple #1
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.Wdnm = ((frmQuanLy.MainWindow)(target));

            #line 9 "..\..\MainWindow.xaml"
                this.Wdnm.Loaded += new System.Windows.RoutedEventHandler(this.Wdnm_Loaded);

            #line default
            #line hidden
                return;

            case 2:
                this.Background = ((System.Windows.Controls.Border)(target));
                return;

            case 3:
                this.cbFuncSelect = ((System.Windows.Controls.ComboBox)(target));
                return;

            case 4:

            #line 44 "..\..\MainWindow.xaml"
                ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.OpenFunc);

            #line default
            #line hidden
                return;

            case 5:

            #line 47 "..\..\MainWindow.xaml"
                ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.CloseFrm);

            #line default
            #line hidden
                return;

            case 6:
                this.NVPlugin = ((System.Windows.Controls.CheckBox)(target));

            #line 51 "..\..\MainWindow.xaml"
                this.NVPlugin.Checked += new System.Windows.RoutedEventHandler(this.NVPlugin_Checked);

            #line default
            #line hidden
                return;

            case 7:
                this.PluginResult = ((System.Windows.Controls.Label)(target));
                return;
            }
            this._contentLoaded = true;
        }
        private void btnOk_Click(object sender, RoutedEventArgs e)
        {
            if (txtId.Text == "" || pbxPass.Password == "")
            {
                MessageBox.Show("Nhap thieu tai khoan hoac mat khau. Vui long nhap day du");
            }
            else
            {
                string tk = txtId.Text;
                string mk = pbxPass.Password;

                int result = XLKD.Khoi_dong_dang_nhap(tk, mk);

                if (result == 0)
                {
                    MessageBox.Show("Nhập sai tài khoản hay mật khẩu", "Lỗi đăng nhập", MessageBoxButton.OK);
                }
                else if (result != 0)
                {
                    MessageBox.Show("Đăng nhập thành công");
                    if (result == 1)
                    {
                        DTO.DefaultConfig.localbg = (LinearGradientBrush)Background.Background;
                        frmQuanLy.MainWindow quanly = new frmQuanLy.MainWindow();
                        DTO.NguoiDung.GetND(tk, "Quản lý");
                        this.Close();
                        quanly.ShowDialog();
                    }
                    else if (result == 2)
                    {
                        DTO.DefaultConfig.localbg = (LinearGradientBrush)Background.Background;
                        frmKhachSan.MainWindow chuks = new frmKhachSan.MainWindow();
                        DTO.NguoiDung.GetND(tk, "Chủ khách sạn");
                        this.Close();
                        chuks.ShowDialog();
                    }
                    else
                    {
                    }
                }
                else
                {
                }
            }
        }
        private void btnOk_Click(object sender, RoutedEventArgs e)
        {
            if (txtId.Text == "" || pbxPass.Password == "")
            {
                MessageBox.Show("Nhap thieu tai khoan hoac mat khau. Vui long nhap day du");
            }
            else
            {
                string tk = txtId.Text;
                string mk = pbxPass.Password;

                int result = XLKD.Khoi_dong_dang_nhap(tk, mk);

                if (result == 0)
                    MessageBox.Show("Nhập sai tài khoản hay mật khẩu", "Lỗi đăng nhập", MessageBoxButton.OK);
                else if (result != 0)
                {
                    MessageBox.Show("Đăng nhập thành công");
                    if (result == 1)
                    {
                        DTO.DefaultConfig.localbg = (LinearGradientBrush)Background.Background;
                        frmQuanLy.MainWindow quanly = new frmQuanLy.MainWindow();
                        DTO.NguoiDung.GetND(tk, "Quản lý");
                        this.Close();
                        quanly.ShowDialog();
                    }
                    else if (result == 2)
                    {
                        DTO.DefaultConfig.localbg = (LinearGradientBrush)Background.Background;
                        frmKhachSan.MainWindow chuks = new frmKhachSan.MainWindow();
                        DTO.NguoiDung.GetND(tk, "Chủ khách sạn");
                        this.Close();
                        chuks.ShowDialog();
                    }
                    else
                    {

                    }
                }
                else
                {

                }
            }
        }
 void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
     switch (connectionId)
     {
     case 1:
     this.Wdnm = ((frmQuanLy.MainWindow)(target));
     
     #line 9 "..\..\MainWindow.xaml"
     this.Wdnm.Loaded += new System.Windows.RoutedEventHandler(this.Wdnm_Loaded);
     
     #line default
     #line hidden
     return;
     case 2:
     this.Background = ((System.Windows.Controls.Border)(target));
     return;
     case 3:
     this.cbFuncSelect = ((System.Windows.Controls.ComboBox)(target));
     return;
     case 4:
     
     #line 44 "..\..\MainWindow.xaml"
     ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.OpenFunc);
     
     #line default
     #line hidden
     return;
     case 5:
     
     #line 47 "..\..\MainWindow.xaml"
     ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.CloseFrm);
     
     #line default
     #line hidden
     return;
     case 6:
     this.NVPlugin = ((System.Windows.Controls.CheckBox)(target));
     
     #line 51 "..\..\MainWindow.xaml"
     this.NVPlugin.Checked += new System.Windows.RoutedEventHandler(this.NVPlugin_Checked);
     
     #line default
     #line hidden
     return;
     case 7:
     this.PluginResult = ((System.Windows.Controls.Label)(target));
     return;
     }
     this._contentLoaded = true;
 }