private void NViewLeaveBtn_Click(object sender, EventArgs e) { ViewStaffLeaves newStffLeave = new ViewStaffLeaves(); this.Hide(); newStffLeave.ShowDialog(); }
private void UpdateBtn_Click(object sender, EventArgs e) { con.Open(); SqlCommand cmd = con.CreateCommand(); cmd.CommandType = CommandType.Text; if (acTDeclinecomboBox.Text.Equals("Accept")) { cmd.CommandText = "UPDATE staffLeaves SET status='Accepted' where leaveID = '" + leaveID + "'"; cmd.ExecuteNonQuery(); } else if (acTDeclinecomboBox.Text.Equals("Decline")) { cmd.CommandText = "UPDATE staffLeaves SET status='Decline' where leaveID = '" + leaveID + "'"; cmd.ExecuteNonQuery(); } con.Close(); MessageBox.Show("Leave Status Update Succesfully"); ViewStaffLeaves viewStaffLeaves = new ViewStaffLeaves(); this.Hide(); viewStaffLeaves.ShowDialog(); }