コード例 #1
0
 public void AddNewPerson()
 {
     if (Officer.Checked)
     {
         sqlcommand.CommandText = "INSERT INTO [dbo].[PERSONS] VALUES ('O',N'" + PersonName.Text + "')";
     }
     else if (SubOfficer.Checked)
     {
         sqlcommand.CommandText = "INSERT INTO [dbo].[PERSONS] VALUES ('R',N'" + PersonName.Text + "')";
     }
     else if (Solider.Checked)
     {
         sqlcommand.CommandText = "INSERT INTO [dbo].[PERSONS] VALUES ('S',N'" + PersonName.Text + "')";
     }
     sqlcommand.ExecuteNonQuery();
     MessageBox.Show("تمت اضافة " + PersonName.Text + " قاعدة البيانات");
     PersonName.Clear();
     UpDateAllPersons();
 }
コード例 #2
0
 private void ClearTextBoxes()
 {
     PersonName.Clear();
     ProviderName.Clear();
     CatalogName.Clear();
 }