Example #1
0
        private void btnEntrar_Click(object sender, RoutedEventArgs e)
        {
            string email = txtEmail.Text;
            string senha = txtSenha.Text;

            cliente  = UsuarioDAO.autenticarCliente(email, senha);
            autonomo = UsuarioDAO.autenticarAutonomo(email, senha);

            if (cliente != null)
            {
                MessageBox.Show("foi");

                PerfilC pc = new PerfilC(cliente);
                pc.ShowDialog();
            }
            else if (autonomo != null)
            {
                MessageBox.Show("foi");
                PerfilAuto pa = new PerfilAuto(autonomo);
                pa.ShowDialog();
            }
            else
            {
                MessageBox.Show("Não há cadastro de usuário com estes dados!", "Login", MessageBoxButton.OK, MessageBoxImage.Warning);
            }
        }
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.PerfilA = ((ProjetoCSharp.Views.PerfilAuto)(target));

            #line 8 "..\..\..\Views\PerfilAuto.xaml"
                this.PerfilA.Loaded += new System.Windows.RoutedEventHandler(this.PerfilA_Loaded);

            #line default
            #line hidden
                return;

            case 2:
                this.imgPerfil = ((System.Windows.Controls.Image)(target));
                return;

            case 3:
                this.Sair = ((System.Windows.Controls.Button)(target));

            #line 17 "..\..\..\Views\PerfilAuto.xaml"
                this.Sair.Click += new System.Windows.RoutedEventHandler(this.Sair_Click);

            #line default
            #line hidden
                return;

            case 4:
                this.Voltar = ((System.Windows.Controls.Button)(target));

            #line 18 "..\..\..\Views\PerfilAuto.xaml"
                this.Voltar.Click += new System.Windows.RoutedEventHandler(this.Voltar_Click);

            #line default
            #line hidden
                return;

            case 5:
                this.Historico = ((System.Windows.Controls.DataGrid)(target));
                return;

            case 6:
                this.NomeA = ((System.Windows.Controls.Label)(target));
                return;

            case 7:
                this.InfoA = ((System.Windows.Controls.Label)(target));
                return;

            case 8:
                this.txtLogo = ((System.Windows.Controls.TextBlock)(target));
                return;

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

            #line 33 "..\..\..\Views\PerfilAuto.xaml"
                this.btnAlterarDados.Click += new System.Windows.RoutedEventHandler(this.btnAlterarDados_Click);

            #line default
            #line hidden
                return;
            }
            this._contentLoaded = true;
        }