private void button2_Click(object sender, EventArgs e) { SqlConnection connection = new SqlConnection(ConfigurationManager.ConnectionStrings["DBconnection"].ConnectionString); connection.Open(); string sql1 = "SELECT *FROM userpermissions WHERE userName= '******'AND Block='" + "yes" + "'"; SqlCommand command = new SqlCommand(sql1, connection); SqlDataReader reader = command.ExecuteReader(); if (reader.Read()) { MessageBox.Show("You cannot do this Operation. Please Contact Support Center. "); connection.Close(); } else { HouseHoldService h1 = new HouseHoldService(); this.Hide(); h1.Show(); connection.Close(); } }
private void button2_Click(object sender, EventArgs e) { HouseHoldService h1 = new HouseHoldService(); this.Hide(); h1.Show(); }
private void button1_Click_1(object sender, EventArgs e) { HouseHoldService hs = new HouseHoldService(); this.Hide(); hs.Show(); }
private void buttonBack_Click(object sender, EventArgs e) { HouseHoldService houseHoldService = new HouseHoldService(); this.Hide(); DialogResult d; d = MessageBox.Show("Do you want to Go Back?", "", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question); if (d == DialogResult.Yes) { houseHoldService.Show(); } else if (d == DialogResult.No) { this.Show(); } else { Close(); } }