public DataTable GetAll() { string query = "SELECT nip,nama,jabatan FROM guru"; MySQLDB db = new MySQLDB(); return(db.GetData(query)); }
public DataTable Getall() { string query = "SELECT kd_matpel,nama_matpel FROM matpel"; MySQLDB db = new MySQLDB(); return(db.GetData(query)); }
public DataTable GetAll() { string query = "SELECT nis,nama,kelas FROM siswa"; MySQLDB db = new MySQLDB(); return(db.GetData(query)); }
public DataTable GetByName(string nama) { string query = "SELECT nip,nama,jabatan FROM guru WHERE nama LIKE =@kreteria"; MySQLDB db = new MySQLDB(); return(db.GetData(query, new Dictionary <string, dynamic>() { { "@kreteria", "%" + nama + "%" } })); }
public DataTable GetByNama_Matpel(string nama_matpel) { string query = "SELECT kd_matpel,nama_matpel FROM matpel WHERE kd_matpel LIKE @kreteria"; MySQLDB db = new MySQLDB(); return(db.GetData(query, new Dictionary <string, dynamic>() { { "@kreteria", "%" + nama_matpel + "%" } })); }
public MatpelMdl GetByKd_Matpel(string kd_matpel) { MatpelMdl data = null; string query = "SELECT kd_matpel,nama_matpel FROM matpel WHERE kd_matpel=@kreteria"; MySQLDB db = new MySQLDB(); DataTable dtmatpel = db.GetData(query, new Dictionary <string, dynamic>() { { "@kreteria", kd_matpel } }); if (dtmatpel.Rows.Count == 1) { DataRow row = dtmatpel.Rows[0]; data = new MatpelMdl(); data.kd_matpel = row["kd_matpel"].ToString(); data.nama_matpel = row["nama_matpel"].ToString(); } return(data); }
public GuruMdl GetBynip(string nip) { GuruMdl data = null; string query = "SELECT nip,nama,jabatan FROM guru WHERE nia=@kreteria"; MySQLDB db = new MySQLDB(); DataTable dtguru = db.GetData(query, new Dictionary <string, dynamic>() { { "@kreteria", nip } }); if (dtguru.Rows.Count == 1) { DataRow row = dtguru.Rows[0]; data = new GuruMdl(); data.nip = row["nip"].ToString(); data.nama = row["nama"].ToString(); data.jabatan = row["jabatan"].ToString(); } return(data); }
public SiswaMdl GetByNis(string nis) { SiswaMdl data = null; string query = "SELECT nis,nama,kelas FROM siswa WHERE nia=@kreteria"; MySQLDB db = new MySQLDB(); DataTable dtsiswa = db.GetData(query, new Dictionary <string, dynamic>() { { "@kreteria", nis } }); if (dtsiswa.Rows.Count == 1) { DataRow row = dtsiswa.Rows[0]; data = new SiswaMdl(); data.nis = row["nis"].ToString(); data.nama = row["nama"].ToString(); data.kelas = row["kelas"].ToString(); } return(data); }