private void DGV_Student_DoubleClick(object sender, EventArgs e)
        {
            if (DGV_Student.SelectedRows.Count == 0)
            {
                return;
            }

            string Gender = this.DGV_Student.CurrentRow.Cells[4].Value.ToString();

            if (Gender == "ذكر")
            {
                Radio_M.Checked = true;
            }
            else
            {
                Radio_F.Checked = true;
            }

            RText_Name.Text       = DGV_Student.CurrentRow.Cells[1].Value.ToString();
            RText_Landline.Text   = DGV_Student.CurrentRow.Cells[2].Value.ToString();
            RText_Number.Text     = DGV_Student.CurrentRow.Cells[3].Value.ToString();
            Com_Spicaliztion.Text = DGV_Student.CurrentRow.Cells[5].Value.ToString();


            DGV_Student.ClearSelection();
            Btn_Update.Enabled = true;
            Enable_BtnAdd      = false;
            Btn_Add.Enabled    = false;
        }
Esempio n. 2
0
        private void Btn_Search_Click(object sender, EventArgs e)
        {
            SqlDataAdapter ad = new SqlDataAdapter("select Id_S as 'الرقم' ,Name as 'اسم الطالب' , Land_Line as 'الهاتف' , Phone as 'الموبايل' , Gender as 'الجنس' ,Specializtion.Name_Specializtion as 'الاختصاص'from  Students inner join Specializtion on Specializtion.Id_Specializtion=Students.Id_Specializtion where Name like '%" + RText_Search.Text + "%' or Name_Specializtion like '%" + RText_Search.Text + "%' ", DB.sqlconnection);
            DataTable      dt = new DataTable();

            ad.Fill(dt);

            DGV_Student.DataSource = dt;

            DGV_Student.ClearSelection();
        }
        private void Btn_Reset_Click(object sender, EventArgs e)
        {
            Btn_Add.Enabled    = true;
            Btn_Update.Enabled = false;

            RText_Name.ResetText();
            RText_Number.ResetText();
            RText_Landline.ResetText();
            Radio_F.Checked = false;
            Radio_M.Checked = true;
            Com_Spicaliztion.SelectedIndex = -1;

            DGV_Student.ClearSelection();
        }
        private void Btn_Search_Click(object sender, EventArgs e)
        {
            DGV_Student.DataSource = student.Search_Student(RText_Search.Text);

            DGV_Student.ClearSelection();
        }
 private void Frm_Students_Load(object sender, EventArgs e)
 {
     DGV_Student.ClearSelection();
 }