Пример #1
0
        private void btnSingUpForm_Click(object sender, EventArgs e)
        {
            if (txtSingUpPassword.Text == txtSingUpConfirm.Text)
            {
                createdProfile.passwordUsers = txtSingUpPassword.Text;
                if (IsValidDataSingUp())
                {
                    createdProfile.firstNameUsers = txtSingUpFirstName.Text;
                    createdProfile.lastNameUsers  = txtSingUpLastName.Text;
                    createdProfile.emailUsers     = txtSingUpEmail.Text;
                    createdProfile.phoneUsers     = txtSingUpPhone.Text;
                    createdProfile.passwordUsers  = EncriptString.Encrypt(txtSingUpPassword.Text, "testEncript");
                    createdProfile.roleUsers      = "user";
                    createdProfile.updatedUsers   = DateTime.Today;
                    createdProfile.createdUsers   = DateTime.Today;
                    createdProfile.approvedUsers  = "0";

                    this.creativityProfile = createdProfile;
                    UsersDB_Class.CreateProfile(createdProfile);
                    MessageBox.Show("Please wait for approval.");

                    txtSingUpClear();
                }
            }
            else
            {
                MessageBox.Show("Password and confirm password do not match", Title);
                txtSingUpPassword.Clear();
                txtSingUpConfirm.Clear();
            }
        }
Пример #2
0
        private void btnCreate_Click(object sender, EventArgs e)
        {
            if (txtCreateAdminPassword.Text == txtCreateAdminPassword1.Text)
            {
                createdAdmin.passwordUsers = txtCreateAdminPassword.Text;
            }
            else
            {
                txtCreateAdminPassword.Clear();
                txtCreateAdminPassword1.Clear();
            }

            if (IsValidData())
            {
                createdAdmin.firstNameUsers = txtCreateAdminFirstName.Text;
                createdAdmin.lastNameUsers  = txtCreateAdminLastName.Text;
                createdAdmin.emailUsers     = txtCreateAdminEmail.Text;
                createdAdmin.phoneUsers     = txtCreateAdminPhone.Text;

                createdAdmin.passwordUsers = EncriptString.Encrypt(txtCreateAdminPassword.Text, "testEncript"); //Salt/Key
                createdAdmin.roleUsers     = "admin";
                createdAdmin.updatedUsers  = DateTime.Today;
                createdAdmin.createdUsers  = DateTime.Today;
                createdAdmin.approvedUsers = "1";

                this.creativity   = createdAdmin;
                this.DialogResult = DialogResult.OK;
                this.Close();
            }
        }
Пример #3
0
        private void btnModifyProfile_Click(object sender, EventArgs e)
        {
            try
            {
                if (txtModifyProfilePassword.Text == txtModifyProfileConfirm.Text)
                {
                    user.passwordUsers = txtModifyProfilePassword.Text;
                }
                else
                {
                    txtModifyProfilePassword.Clear();
                    txtModifyProfileConfirm.Clear();
                }
                if (IsValidData())
                {
                    user.firstNameUsers = txtModifyProfileFirstName.Text;
                    user.lastNameUsers  = txtModifyProfileLastName.Text;
                    user.emailUsers     = txtModifyProfileEmail.Text;
                    user.phoneUsers     = txtModifyProfilePhone.Text;
                    user.passwordUsers  = EncriptString.Encrypt(txtModifyProfilePassword.Text, "testEncript"); //Salt/Key

                    this.modify       = user;
                    this.DialogResult = DialogResult.OK;
                    this.Close();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message + "\n\n" +
                                ex.GetType().ToString() + "\n" +
                                ex.StackTrace, "Exception");
            }
        }
Пример #4
0
        private void btnChangeUsers_Click(object sender, EventArgs e)
        {
            if (IsValidData())
            {
                changeUser.firstNameUsers = txtChangeUsersFirstName.Text;
                changeUser.lastNameUsers  = txtChangeUsersLastName.Text;
                changeUser.emailUsers     = txtChangeUsersEmail.Text;
                changeUser.phoneUsers     = txtChangeUsersPhone.Text;
                changeUser.roleUsers      = comboBoxChangeUsersRole.Text;
                changeUser.updatedUsers   = DateTime.Now;
                changeUser.passwordUsers  = EncriptString.Encrypt(txtChangeUsersPassword.Text, "testEncript"); //Salt/Key

                this.changes      = changeUser;
                this.DialogResult = DialogResult.OK;
                this.Close();
            }
        }