Пример #1
0
        public bool ThemHS(Hocsinh hs)
        {
            bool ktra = false;

            if (isConnect())
            {
                SqlCommand com = new SqlCommand();
                com.CommandText = "ThemDL";
                com.CommandType = CommandType.StoredProcedure;
                com.Parameters.AddWithValue("@HoTen", hs.Name1);
                com.Parameters.AddWithValue("@GT", hs.GT1);
                com.Parameters.AddWithValue("@NS", hs.NS1);
                com.Parameters.AddWithValue("@Lop", hs.Lop1);
                com.Parameters.AddWithValue("@Khoa", hs.Khoa1);
                com.Connection = con;
                int i = com.ExecuteNonQuery();
                ktra = i > 0 ? true : false;
            }
            con.Close();
            return(ktra);
        }
Пример #2
0
 public bool ThemHS(Hocsinh hs)
 {
     bool ktra = false;
     if (isConnect())
     {
         SqlCommand com = new SqlCommand();
         com.CommandText = "ThemDL";
         com.CommandType = CommandType.StoredProcedure;
         com.Parameters.AddWithValue("@HoTen", hs.Name1);
         com.Parameters.AddWithValue("@GT", hs.GT1);
         com.Parameters.AddWithValue("@NS", hs.NS1);
         com.Parameters.AddWithValue("@Lop", hs.Lop1);
         com.Parameters.AddWithValue("@Khoa", hs.Khoa1);
         com.Connection = con;
         int i = com.ExecuteNonQuery();
         ktra = i > 0 ? true : false;
     }
     con.Close();
     return ktra;
 }