Esempio n. 1
0
        private void continua_Click(object sender, EventArgs e)
        {
            string name     = nume.Text;
            string tel      = numar.Text;
            string nick     = nickname.Text;
            string adr      = adresa.Text;
            string passwrd  = pass.Text;
            string passconf = passconfirmation.Text;

            if (passwrd == passconf && RegisterController.ValidatePassword(passwrd) == true)
            {
                try
                {
                    RegisterController.Register(name, email, tel, adr, passwrd, nick);
                    Magazin magazin = new Magazin();
                    magazin.Show();
                    this.Close();
                    ConfirmationMail.SendEmail(email, nick);
                }
                catch
                {
                    MessageBox.Show("A aparut o eroare", "Eroare", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            else
            {
                MessageBox.Show("Parola este invalida", "Eroare", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Esempio n. 2
0
 private void continua_Click(object sender, EventArgs e)
 {
     if (LoginController.CheckPass(email, parola.Text) == true)
     {
         User user = new User();
         user = UserController.GetUser(email);
         if (LoginController.CheckVanzator(user.UserId) == false && LoginController.CheckAdmin(user.UserId) == false)
         {
             Magazin magazin = new Magazin(user);
             magazin.Show();
         }
         else if (LoginController.CheckAdmin(user.UserId) == true && LoginController.CheckVanzator(user.UserId) == false)
         {
             AdministratorWindow administratorWindow = new AdministratorWindow();
             administratorWindow.Show();
         }
         else if (LoginController.CheckVanzator(user.UserId) == true && LoginController.CheckAdmin(user.UserId) == false)
         {
             AddProducts addProducts = new AddProducts();
             addProducts.Show();
             Magazin magazin = new Magazin();
             magazin.Visible = false;
         }
         this.Close();
     }
     else
     {
         MessageBox.Show("Parola nu este corecta", "Eroare", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Esempio n. 3
0
        public Form1()
        {
            InitializeComponent();
            ShopEntities shop    = new ShopEntities();
            Magazin      magazin = new Magazin();

            magazin.Show();
        }