Пример #1
0
        private void btnUpdate_Click(object sender, EventArgs e)
        {
            Utility utl = new Utility();

            byte[] photo = utl.ConvertImageToBytes(picUser.Image);

            User usr = new User(lblUserID.Text, txtFirstName.Text, txtLastName.Text, lblTitle.Text, lblUserLevel.Text, txtUserName.Text, txtPassword.Text, txtEmailAdd.Text, Convert.ToDateTime(lblDate.Text), lblTime.Text, photo);

            if (txtPassword.Text != "")
            {
                if (usr.UpdateUser(usr))
                {
                    MessageBox.Show("User Modification is successful!", "Successfully", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    clear_Txt();
                }
                else
                {
                    MessageBox.Show("Modification Rejected!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            else
            {
                MessageBox.Show("Empty password not allowed", "Successfully", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Пример #2
0
        private void radButton2_Click(object sender, EventArgs e)
        {
            byte[] userPhoto = UTL.ConvertImageToBytes(picUser.Image);

            User newUser = new User(lblUserID.Text, txtFirstName.Text, txtLastName.Text, lstTitle.SelectedText, lstUserLevels.SelectedText, txtUsername.Text, txtPassword.Text, txtEmail.Text, Convert.ToDateTime(lblCreatedDate.Value.ToShortDateString()), lblCreatedTime.Text, userPhoto);

            if (newUser.InsertUser(newUser))
            {
                MessageBox.Show("New user crated successfuly!", "Successfully", MessageBoxButtons.OK, MessageBoxIcon.Information);
                clear_Txt();
            }
            else
            {
                MessageBox.Show("Insert incompleted!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Пример #3
0
        private void btnUpdate_Click(object sender, EventArgs e)
        {
            Utility utl = new Utility();
            byte[] photo = utl.ConvertImageToBytes(picUser.Image);

            User usr = new User(lblUserID.Text, txtFirstName.Text, txtLastName.Text, lblTitle.Text, lblUserLevel.Text, txtUserName.Text, txtPassword.Text, txtEmailAdd.Text, Convert.ToDateTime(lblDate.Text), lblTime.Text,photo);

            if (txtPassword.Text != "")
            {
                if (usr.UpdateUser(usr))
                {
                    MessageBox.Show("User Modification is successful!", "Successfully", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    clear_Txt();
                }
                else
                {
                    MessageBox.Show("Modification Rejected!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            else
            {
                MessageBox.Show("Empty password not allowed", "Successfully", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }