Ejemplo n.º 1
0
 private void register_Click(object sender, EventArgs e)
 {
     if (password.Text == passwordAgain.Text)
     {
         var dataWorker = DataWorker.Instance;
         if (!dataWorker.LoginExist(login.Text))
         {
             dataWorker.AddUser(new User(nameAndSurname.Text, login.Text, password.Text));
             DataWorker.CurrentUser = new User(nameAndSurname.Text, login.Text, password.Text);
             var indox = new Inbox();
             Hide();
             indox.ShowDialog();
             Close();
         }
         else
         {
             MessageBox.Show(this, "Username already exist", "Error", MessageBoxButtons.OK,
                             MessageBoxIcon.Exclamation);
         }
     }
     else
     {
         MessageBox.Show(this, "Passwords do not match", "Error", MessageBoxButtons.OK,
                         MessageBoxIcon.Exclamation);
     }
 }
Ejemplo n.º 2
0
        public void PerformRefresh()
        {
            var inbox = new Inbox();

            Hide();
            inbox.ShowDialog();
            Close();
        }
Ejemplo n.º 3
0
        private void FolerManager_Closing(object sender, EventArgs e)
        {
            var inbox = new Inbox();

            Hide();
            inbox.ShowDialog();
            Close();
        }
Ejemplo n.º 4
0
        private void signIn_Click(object sender, EventArgs e)
        {
            var dataWorker         = DataWorker.Instance;
            var accountCkeckResult = dataWorker.Login(login.Text, password.Text);

            if (accountCkeckResult == DataWorker.LoginErrors.UsernameNotExist)
            {
                MessageBox.Show(this, "Username does not exist", "Error", MessageBoxButtons.OK,
                                MessageBoxIcon.Exclamation);
            }
            else if (accountCkeckResult == DataWorker.LoginErrors.PasswordNotCorrect)
            {
                MessageBox.Show(this, "Password does not correct", "Error", MessageBoxButtons.OK,
                                MessageBoxIcon.Exclamation);
            }
            else
            {
                var indoxForm = new Inbox();
                Hide();
                indoxForm.ShowDialog();
                Close();
            }
        }