Пример #1
0
        //txbEmail_TextChanged
        private void txbEmail_TextChanged(object sender, TextChangedEventArgs e)
        {
            if (flag_zero_load == true)
            {
                try
                {
                    EC_tb_User ec_tb_user = GetUser();
                    HandleControl();
                    imgEmail.Visibility = System.Windows.Visibility.Visible;

                    if (bus_tb_user.UpdateUser(ec_tb_user, StaticClass.GeneralClass.flag_database_type_general) == 1)
                    {
                        imgEmail.Source = ok_bitmapimage;
                    }
                    else
                    {
                        imgEmail.Source = failed_bitmapimage;
                    }
                }
                catch (Exception ex)
                {
                    Pages.Notification page = new Pages.Notification();
                    page.tblNotification.Text = ex.Message;
                    page.ShowDialog();
                }
            }
        }
Пример #2
0
        private void btnSua_Click(object sender, EventArgs e)
        {
            DTO_tb_user.USER    = txtUserName.Text;
            DTO_tb_user.NEWPASS = txtNewPass.Text;
            DTO_tb_user.PASS    = txtPass.Text;
            DTO_tb_user.ID      = Convert.ToBoolean(chk_Usertype.CheckState);
            BUS_user.UpdateUser(DTO_tb_user.USER, DTO_tb_user.PASS, DTO_tb_user.NEWPASS, DTO_tb_user.ID);
            dgvUser.DataSource = BUS_user.LoadDL();

            txtUserName.Text     = null;
            txtPass.Text         = null;
            chk_Usertype.Checked = false;
            txtNewPass.Text      = null;
        }
Пример #3
0
        //btnOK_Click
        private void btnOK_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                EC_tb_User ec_tb_user = new EC_tb_User();
                ec_tb_user.ID       = Convert.ToInt32(tblID.Text.Trim().ToString());
                ec_tb_user.Name     = StaticClass.GeneralClass.HandlingSpecialCharacter(tblName.Text.Trim().ToString());
                ec_tb_user.Email    = StaticClass.GeneralClass.HandlingSpecialCharacter(txbEmail.Text.Trim().ToString());
                ec_tb_user.Address  = StaticClass.GeneralClass.HandlingSpecialCharacter(txbAddress.Text.Trim().ToString());
                ec_tb_user.Question = StaticClass.GeneralClass.HandlingSpecialCharacter(txbQuestion.Text.Trim().ToString());
                ec_tb_user.Answer   = StaticClass.GeneralClass.HandlingSpecialCharacter(txbAnswer.Text.Trim().ToString());

                if (pwbPassword.Password.Trim() == "" && pwbConfirmPassword.Password.Trim() != "")
                {
                    tblNotification.Text = FindResource("password_null").ToString();
                    pwbConfirmPassword.Focus();
                    return;
                }

                if (pwbPassword.Password != "" && pwbConfirmPassword.Password == "")
                {
                    tblNotification.Text = FindResource("confirm_password_null").ToString();
                    pwbPassword.Focus();
                    return;
                }

                if (pwbPassword.Password.Trim() != "" && pwbConfirmPassword.Password.Trim() != "")
                {
                    if (pwbPassword.Password != pwbConfirmPassword.Password)
                    {
                        tblNotification.Text = FindResource("new_password_confirm_password_incorrect").ToString();
                        pwbConfirmPassword.Focus();
                        return;
                    }
                    else
                    {
                        ec_tb_user.Password = StaticClass.GeneralClass.MD5Hash(pwbPassword.Password.Trim().ToString());
                        if (bus_tb_user.UpdateUser(ec_tb_user, StaticClass.GeneralClass.flag_database_type_general) == 1)
                        {
                            if (btnedit_delegate != null)
                            {
                                btnedit_delegate();
                                this.Close();
                            }
                        }
                        else
                        {
                            ec_tb_user.Password = "";
                        }
                    }
                }
                else
                {
                    if (bus_tb_user.UpdateUserNonPassword(ec_tb_user, StaticClass.GeneralClass.flag_database_type_general) == 1)
                    {
                        if (btnedit_delegate != null)
                        {
                            btnedit_delegate();
                            this.Close();
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                tblNotification.Text = ex.Message;
            }
        }