예제 #1
0
 private void Btn_Add_Item_Click(object sender, EventArgs e)
 {
     if (string.IsNullOrEmpty(RText_Items.Text))
     {
         MessageBox.Show("لا يمكن ترك اسم الاختصاص فارغ  ", "تحذير", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning);
         return;
     }
     else
     {
         Student_Sp.Add_Specialization(RText_Items.Text);
         MessageBox.Show("تمت عملية الإضافة بنجاح", "عملية الإضافة", MessageBoxButtons.OK, MessageBoxIcon.Information);
         Fill_ListItems();
     }
     RText_Items.ResetText();
     listBox1.ClearSelected();
 }
예제 #2
0
        private void Btn_Add_Item_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(RText_Items.Text))
            {
                MessageBox.Show("لا يمكن ترك اسم الاختصاص فارغ  ", "تحذير", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning);
                return;
            }
            else
            {
                SqlCommand cmd = new SqlCommand("insert into Specializtion values ('" + RText_Items.Text + "')", DB.sqlconnection);
                DB.Open();
                cmd.ExecuteNonQuery();
                DB.Close();

                MessageBox.Show("تمت عملية الإضافة بنجاح", "عملية الإضافة", MessageBoxButtons.OK, MessageBoxIcon.Information);
                Fill_ListItems();
            }
            RText_Items.ResetText();
            listBox1.ClearSelected();
        }