protected void Button4_Click(object sender, EventArgs e) { LMsg.Text = ""; if (DropDownList1.SelectedIndex == 0) { LMsg.Text = "ابتدا عضو مورد نظر را از ليست انتخاب كنيد !"; DropDownList1.Focus(); return; } if (CheckBox1.Checked == false) { LMsg.Text = "ابتدا گزينه مربوط به ( تاييد حذف ) را فعال كنيد !"; CheckBox1.Focus(); return; } conn.Close(); SqlCommand cmd4 = new SqlCommand("update User_Pass set Manager = 'No' where User_Name = '" + DropDownList1.SelectedItem.Text + "'", conn); conn.Open(); SqlDataReader reader4; reader4 = cmd4.ExecuteReader(); conn.Close(); LMsg.Text = "براي عضو انتخاب شده اجازه دسترسي به بخش مديريت لغو شد !"; Label8.Text = "No"; CheckBox1.Checked = false; }
protected void Button1_Click1(object sender, EventArgs e) { LMsg.Text = ""; if (DropDownList1.SelectedIndex == 0) { LMsg.Text = "ابتدا عضو مورد نظر را از ليست انتخاب كنيد !"; DropDownList1.Focus(); return; } if (CheckBox1.Checked == false) { LMsg.Text = "ابتدا گزينه مربوط به ( تاييد حذف ) را فعال كنيد !"; CheckBox1.Focus(); return; } conn.Close(); SqlCommand cmd4 = new SqlCommand("Delete from User_Pass where User_Name = '" + DropDownList1.SelectedItem.Text + "'", conn); conn.Open(); SqlDataReader reader4; reader4 = cmd4.ExecuteReader(); conn.Close(); LMsg.Text = "عضو انتخاب شده از ليست اعضاء حذف شد !"; Label3.Text = ""; Label4.Text = ""; Label5.Text = ""; Label6.Text = ""; Label7.Text = ""; Label8.Text = ""; Label9.Text = ""; Label10.Text = ""; CheckBox1.Checked = false; DropDownList1.Items.Remove(DropDownList1.SelectedItem); }