예제 #1
0
 private void SignUp_button_Click(object sender, EventArgs e)
 {
     if (Email_textbox.Text != "" && Name_textbox.Text != "" && Pass_textbox.Text != "" && ConfirmPass_textbox.Text != "")
     {
         if (!SupportUtility.IsExistEmail(Email_textbox.Text))
         {
             if (!SupportUtility.IsExistAccount(Name_textbox.Text))
             {
                 if (ConfirmPass_textbox.Text == Pass_textbox.Text)
                 {
                     verifyCode = rdCode.Next(100000, 999999).ToString();
                     try
                     {
                         SupportUtility.SendConfirmEmailToCreateAccount(Email_textbox.Text, verifyCode);
                         confirmNewAccount = new ConfirmNewAccount(this);
                         confirmNewAccount.Show();
                         this.Hide();
                     }
                     catch (Exception)
                     {
                         MessageBox.Show("Không thể gửi mail", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                     }
                 }
                 else
                 {
                     MessageBox.Show("Mật khẩu không trùng khớp", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                 }
             }
             else
             {
                 MessageBox.Show("Tên người dùng đã được sử dụng", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Warning);
             }
         }
         else
         {
             MessageBox.Show("Email đã được sử dụng", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Warning);
         }
     }
     else
     {
         MessageBox.Show("Vui lòng nhập đủ thông tin", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Warning);
     }
 }
예제 #2
0
 //--------------------------
 // Handle Event
 private void SignIn_button_Click(object sender, EventArgs e)
 {
     if (this.Name_textbox.Text != "" && this.Pass_textbox.Text != "")
     {
         if (SupportUtility.IsExistAccount(this.Name_textbox.Text))
         {
             if (SupportUtility.IsCorrectAccount(this.Name_textbox.Text, this.Pass_textbox.Text))
             {
                 if (!SupportUtility.IsSignIn(Name_textbox.Text))
                 {
                     //inRoom = new RoomChose(this.Name_textbox.Text);
                     inRoom = new RoomChose(this.Name_textbox.Text, this);
                     this.Hide();
                     inRoom.Show();
                     SupportUtility.SetSignIn(Name_textbox.Text);
                 }
                 else
                 {
                     MessageBox.Show("Tài khoản đang được sử dụng", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                 }
             }
             else
             {
                 MessageBox.Show("Mật khẩu không đúng", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Warning);
             }
         }
         else
         {
             MessageBox.Show("Tài khoản không tồn tại", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Warning);
         }
     }
     else
     {
         MessageBox.Show("Vui lòng nhập đủ thông tin", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Warning);
     }
 }