// When the profile button is clicked. private void BtnProfile_Click(object sender, EventArgs e) { // Load form. ProfileFormX profilePage = new ProfileFormX(); profilePage.Show(); this.Close(); }
// When cancel button is clicked. private void CancelBtn_Click(object sender, EventArgs e) { // Load page. ProfileFormX profile = new ProfileFormX(); profile.Show(); this.Close(); }
// When the profile button is clicked. private void BtnProfile_Click(object sender, EventArgs e) { // Load form. ProfileFormX profile = new ProfileFormX(); profile.Show(); this.Close(); //display loading circle. LoadingCircle1.Visible = true; }
// When profile picture is clicked. private void PictureBox1_Click(object sender, EventArgs e) { // Show loading circle. loadingCircle.Visible = true; // Load form. ProfileFormX profile = new ProfileFormX(); profile.Show(); this.Close(); }
// When save button is clicked. private void SaveBtn_Click(object sender, EventArgs e) { // Using MVC. User selectedUser = Program.GetCurrentUser(); sepdbDataSetTableAdapters.usersTableAdapter usersTable = new sepdbDataSetTableAdapters.usersTableAdapter(); // Update user details using SQL statement. usersTable.UpdateUserDetails(TxtEmail.Text, TxtPhoneNo.Text, Convert.ToInt32(TxtID.Text)); // Update fields. selectedUser.EmailAddress = TxtEmail.Text; selectedUser.PhoneNo = TxtPhoneNo.Text; // Check if email is valid. if (IsValidEmail(TxtEmail.Text) == false || TxtEmail.Text == null) { MessageBox.Show("Please enter a valid email address."); } else { // Load page. ProfileFormX profile = new ProfileFormX(); profile.Show(); this.Close(); } }