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 nip,nama,jabatan FROM guru"; 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 void Hapus(String nip) { string query = "DELETE FROM guru WHERE nip=@kreteria"; MySQLDB db = new MySQLDB(); db.Execute(query, new Dictionary <string, dynamic>() { { "@kreteria", nip } }); }
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 void Hapus(string kd_matpel) { string query = "DELETE FROM kd_matpel WHERE kd_matpel=@kreteria"; MySQLDB db = new MySQLDB(); db.Execute(query, new Dictionary <string, dynamic>() { { "@kreteria", kd_matpel } }); }
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 void Add(MatpelMdl data) { string query = "INSERT INTO matpel (kd_matpel,nama_matpel) VALUES (@kd_matpel,@nama_matpel)"; MySQLDB db = new MySQLDB(); db.Execute(query, new Dictionary <string, dynamic>() { { "@kd_matpel", data.kd_matpel }, { "@nama_matpel", data.nama_matpel } }); }
public void Add(GuruMdl data) { string query = "INSERT INTO guru (nip,nama,jabatan) VALUES (@nip,@nama,@jabatan)"; MySQLDB db = new MySQLDB(); db.Execute(query, new Dictionary <string, dynamic>() { { "@nip", data.nip }, { "@nama", data.nama }, { "@jabatan", data.jabatan } }); }
public void Edit(string kd_matpel, MatpelMdl data) { string query = "UPDATE matpel SET kd_matpel=@kd_matpelbaru,nama_matpel=@nama_matpelbaru WHERE kd_matpel=@kd_matpellama"; MySQLDB db = new MySQLDB(); db.Execute(query, new Dictionary <string, dynamic>() { { "@kd_matpelbaru", data.kd_matpel }, { "@nama_matpelbaru", data.nama_matpel }, { "@kd_matpellama", kd_matpel } }); }
public void Add(SiswaMdl data) { string query = "INSERT INTO siswa (nis,nama,kelas) VALUES (@nis,@nama,@kelas)"; MySQLDB db = new MySQLDB(); db.Execute(query, new Dictionary <string, dynamic>() { { "@nis", data.nis }, { "@nama", data.nama }, { "@kelas", data.kelas } }); }
public void Edit(string nip, GuruMdl data) { string query = "UPDATE nip=@nipbaru,nama=@namabaru,jabatan=@jabatanbaru FROM guru WHERE nip=@niplama"; MySQLDB db = new MySQLDB(); db.Execute(query, new Dictionary <string, dynamic>() { { "@nipbaru", data.nip }, { "@namabaru", data.nama }, { "@jabatanbaru", data.jabatan }, { "@niplama", nip } }); }
public void Edit(string nis, SiswaMdl data) { string query = "UPDATE nis=@nisbaru,nama=@namabaru,kelas=@kelasbaru FROM siswa WHERE nis=@nislama"; MySQLDB db = new MySQLDB(); db.Execute(query, new Dictionary <string, dynamic>() { { "@nisbaru", data.nis }, { "@namabaru", data.nama }, { "@kelasbaru", data.kelas }, { "@nislama", nis } }); }
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); }