예제 #1
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.Messages = ((eBuy.View.General.Control.ACTMessages)(target));
                return;

            case 2:
                this.lblColor = ((System.Windows.Controls.Label)(target));
                return;

            case 3:
                this.imgSucess = ((System.Windows.Controls.Image)(target));
                return;

            case 4:
                this.imgError = ((System.Windows.Controls.Image)(target));
                return;

            case 5:
                this.imgInformation = ((System.Windows.Controls.Image)(target));
                return;

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

            #line 64 "..\..\..\..\..\View\General\Control\ACTMessages.xaml"
                this.btnOK.Click += new System.Windows.RoutedEventHandler(this.btnOK_Click);

            #line default
            #line hidden
                return;

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

            case 8:
                this.lblMessage = ((System.Windows.Controls.Label)(target));
                return;

            case 9:
                this.img1 = ((System.Windows.Controls.Image)(target));
                return;

            case 10:
                this.img2 = ((System.Windows.Controls.Image)(target));
                return;

            case 11:
                this.img3 = ((System.Windows.Controls.Image)(target));
                return;

            case 12:
                this.img4 = ((System.Windows.Controls.Image)(target));
                return;
            }
            this._contentLoaded = true;
        }
예제 #2
0
        private void btnRegister_Click(object sender, RoutedEventArgs e)
        {
            //verification for blank email.
            if (TOUser.Email == "")
            {
                ACTMessages message = new ACTMessages(TOUser, "eBuy", "O campo de email não pode estar vazio.", 2);
                txtEmail.BorderBrush = Brushes.Red;
                message.ShowDialog();
                txtEmail.Focus();
            }
            //verification for valid email.
            else if (TOUser.IsValidEmail(TOUser.Email) == false)
            {
                ACTMessages message = new ACTMessages(TOUser, "eBuy", "Email inválido.", 2);
                txtEmail.BorderBrush = Brushes.Red;
                message.ShowDialog();
                txtEmail.Focus();
            }
            //verification for an account that already uses that email.
            else if (uDAO.VerifyAccountEmail(TOUser.Email))
            {
                //generate method to sendmail.

                //email sent.
                txtEmail.BorderBrush = Brushes.White;
                ACTMessages message = new ACTMessages(TOUser, "eBuy", "Email enviado!", 1);
                message.ShowDialog();
            }
        }
예제 #3
0
        private void btnLogin_Click(object sender, RoutedEventArgs e)
        {
            //loggin in.
            Model.DAO.DAOUser uDAO  = new Model.DAO.DAOUser();
            Model.TOUser      tUser = new Model.TOUser();

            tUser = uDAO.Login(txtUser.Text, psbPassword.Password.ToString());
            if (tUser.Id != 0)
            {
                ACTHome     home    = new ACTHome(tUser);
                ACTMessages message = new ACTMessages(tUser, "eBuy", "Bem-vindo ao eBuy, " + tUser.Name + "!", 1);
                message.ShowDialog();
                home.Show();
                this.Close();
            }
            else
            {
                ACTMessages message = new ACTMessages(tUser, "eBuy", "Algo errado aconteceu durante o login.", 3);
                message.ShowDialog();
            }
        }