コード例 #1
0
        public void update()
        {
            string        TK = ManageSystem.TK();
            int           ID = ManageSystem.GetUserID(TK);
            List <string> a  = ManageSystem.UserInfoPersonal(ID);

            lblTen.Text       = a[1];
            lblBeginDate.Text = a[4];
            statisticResult.UpdateInfoResult();
        }
コード例 #2
0
        private void Update()
        {
            string        TK = ManageSystem.TK();
            int           ID = ManageSystem.GetUserID(TK);
            List <string> a  = ManageSystem.UserInfoPersonal(ID);

            lblDate.Text     = a[0];
            lblHoTen.Text    = a[1];
            lblGioiTinh.Text = a[2];
            lblGmail.Text    = a[3];
        }
コード例 #3
0
        private void btSavePassword_Click(object sender, EventArgs e)
        {
            if (txtOldPass.Text == "")
            {
                MessageBox.Show("Password can not be empty");
            }
            else if (CheckValidPass(txtOldPass.Text) == false)
            {
                MessageBox.Show("Password can not have invalid character");
            }
            else if (CheckValidPass(txtNewPass.Text) == false)
            {
                MessageBox.Show("Password can not have invalid character");
            }
            else
            {
                string ePassword = ManageSystem.EncryptPassword(txtOldPass.Text);
                if (!ManageSystem.Pass(ePassword))
                {
                    MessageBox.Show("Old password is not correct", "Thông báo");
                }
                else if (txtNewPass.Text == "")
                {
                    MessageBox.Show("Password can not be empty");
                }
                else if (txtNewPass.Text != txtReNewPass.Text)
                {
                    MessageBox.Show("Re-Password is not correct");
                }
                else if (txtNewPass.Text == txtOldPass.Text)
                {
                    MessageBox.Show("The new password is the same as the old password");
                }
                else
                {
                    string TK = ManageSystem.TK();

                    ManageSystem.UpdateNewPassword(ManageSystem.GetUserID(TK), txtNewPass.Text);
                    ManageSystem.UpdateNewPasswordToDatabase(ManageSystem.GetUserID(TK), txtNewPass.Text);

                    string ePassword1 = ManageSystem.EncryptPassword(txtNewPass.Text);
                    ManageSystem.UpdatePass(ePassword1);
                    MessageBox.Show("Save success!");
                    pnlEdit.Visible            = false;
                    pnlEdit.Enabled            = false;
                    pnlPersonalDetails.Visible = true;
                    pnlPersonalDetails.Enabled = true;
                    pnlSavePass.Visible        = false;
                    pnlSavePass.Enabled        = false;

                    ClearTextbox();
                }
            }
        }
コード例 #4
0
 private void btnSaveEdit_Click(object sender, EventArgs e)
 {
     if (txtHoTen.Text == "")
     {
         MessageBox.Show("Please fill in all the information!");
     }
     else
     {
         if (CheckValidName(txtHoTen.Text))
         {
             string gender = "";
             if (rbNam.Checked == true && rbNu.Checked == false)
             {
                 gender = "Nam";
             }
             else if (rbNam.Checked == false && rbNu.Checked == true)
             {
                 gender = "Nữ";
             }
             else
             {
                 gender = "Bê đê";
             }
             string TK = ManageSystem.TK();
             int    ID = ManageSystem.GetUserID(TK);
             ManageSystem.AddInfoPersonal(ID, dtpNgaySinh.Value.ToString("dd/MM/yyyy"), txtHoTen.Text, gender);
             MessageBox.Show("Save Succes!");
             pnlEdit.Visible            = false;
             pnlEdit.Enabled            = false;
             pnlPersonalDetails.Visible = true;
             pnlPersonalDetails.Enabled = true;
             pnlSavePass.Visible        = false;
             pnlSavePass.Enabled        = false;
             Update();
         }
         else
         {
             MessageBox.Show("Name has invalid character and number!");
         }
         ClearTextbox();
     }
 }
コード例 #5
0
ファイル: UserAccessForm.cs プロジェクト: ltk84/Vocabulary-Up
 private void SignUp()
 {
     if (ManageSystem.CheckSignUpIfValid(txtUsername_SignUp.Text, txtEmail_SignUp.Text, txtPassword_SignUp.Text, txtRePassword_SignUp.Text))
     {
         if (ManageSystem.CheckSignUp(txtUsername_SignUp.Text, txtEmail_SignUp.Text, txtPassword_SignUp.Text, txtRePassword_SignUp.Text))
         {
             string encodedPassword = ManageSystem.EncryptPassword(txtPassword_SignUp.Text);
             ManageSystem.AddUser(txtUsername_SignUp.Text, txtEmail_SignUp.Text, encodedPassword);
             InitLoadingForm(ManageSystem.GetUserID(txtUsername_SignUp.Text));
         }
         else
         {
             return;
         }
     }
     else
     {
         return;
     }
 }
コード例 #6
0
ファイル: UserAccessForm.cs プロジェクト: ltk84/Vocabulary-Up
        private void Login()
        {
            string encodedPassword = ManageSystem.EncryptPassword(txtPassword_Login.Text);

            if (ManageSystem.CheckLoginIfValid(txtUsename_Login.Text, txtPassword_Login.Text))
            {
                if (ManageSystem.CheckSignIn(txtUsename_Login.Text, encodedPassword))
                {
                    InitLoadingForm(ManageSystem.GetUserID(txtUsename_Login.Text));
                }
                else
                {
                    MessageBox.Show("Username or Password is not correct", "Notification");
                }
            }
            else
            {
                return;
            }
        }
コード例 #7
0
        public void UpdateInfoResult()
        {
            string        TK = ManageSystem.TK();
            int           ID = ManageSystem.GetUserID(TK);
            List <string> a  = ManageSystem.UserInfoPersonal(ID);

            lbTotal.Text = a[5];

            //
            lbTotal.Text        = ManageUserAction.GetItemOfAllCollection(0).ListFL.Count().ToString();
            lbLearned.Text      = lbTotal.Text;
            lbToLearn.Text      = (ManageSystem.CountAllFlashCards() - ManageUserAction.GetItemOfAllCollection(0).ListFL.Count()).ToString();
            pbAnimals.Value     = ManageUserAction.CalculateProgress(1, ID);
            pbPlants.Value      = ManageUserAction.CalculateProgress(2, ID);
            pbFruits.Value      = ManageUserAction.CalculateProgress(3, ID);
            pbJob.Value         = ManageUserAction.CalculateProgress(4, ID);
            pbFoodaDrinks.Value = ManageUserAction.CalculateProgress(5, ID);
            pbSport.Value       = ManageUserAction.CalculateProgress(6, ID);
            pbClothing.Value    = ManageUserAction.CalculateProgress(7, ID);
            pbTechnology.Value  = ManageUserAction.CalculateProgress(8, ID);
        }