Boolean InsertKelas(Entity.EntMateri em) { status = false; try { query = "INSERT INTO kode_kelas VALUES ('" + em.GetKelas() + "')"; koneksi.Open(); command = koneksi.CreateCommand(); command.CommandText = query; command.ExecuteNonQuery(); status = true; koneksi.Close(); } catch (SqlException se) { Console.WriteLine("ERROR" + se); } return(status); }
public Boolean SelectKelas(Entity.EntMateri em) { status = false; try { query = "SELECT kode_kelas FROM KELAS kode_kelas WHERE kode_kelas = '" + em.GetKelas() + "'"; koneksi.Open(); command = koneksi.CreateCommand(); command.CommandText = query; command.ExecuteNonQuery(); status = true; koneksi.Close(); } catch (SqlException se) { Console.WriteLine("ERROR" + se); } return(status); }