private void btnChangePhoto_Click(object sender, EventArgs e) { try { DialogResult dialogResult = MessageBox.Show("UPDATE YOUR PROFILE PHOTO?", "UPDATE PROFILE PICTURE?", MessageBoxButtons.YesNo, MessageBoxIcon.Warning); if (dialogResult == DialogResult.Yes) { if (tbEmpPhoto.Text == "") { MessageBox.Show("PLEASE SELECT THE PHOTO FIRST", "WARNING", MessageBoxButtons.OK, MessageBoxIcon.Warning); btnBrowse.Focus(); } else { Admin A = new Admin(); A.UserUpdatePhoto(tbEmpPhoto.Text, lblUser.Text); MessageBox.Show("PROFILE PHOTO UPDATED", "UPDATE PHOTO SUCCESS", MessageBoxButtons.OK, MessageBoxIcon.Information); BindDetails(); } } } catch (SqlException) { MessageBox.Show("MICROSOFT SQL SERVER DATABASE ERROR!", "ERROR OCCURS", MessageBoxButtons.OK, MessageBoxIcon.Error); } catch (InvalidOperationException) { MessageBox.Show("INVALID OPERATION!", "ERROR OCCURS", MessageBoxButtons.OK, MessageBoxIcon.Error); } catch (Exception ex) { MessageBox.Show(ex.ToString(), "ERROR OCCURS", MessageBoxButtons.OK, MessageBoxIcon.Error); } }