コード例 #1
0
        public DataTable GetAll()
        {
            string  query = "SELECT nip,nama,jabatan FROM guru";
            MySQLDB db    = new MySQLDB();

            return(db.GetData(query));
        }
コード例 #2
0
        public DataTable Getall()
        {
            string  query = "SELECT kd_matpel,nama_matpel FROM matpel";
            MySQLDB db    = new MySQLDB();

            return(db.GetData(query));
        }
コード例 #3
0
        public DataTable GetAll()
        {
            string  query = "SELECT nis,nama,kelas FROM siswa";
            MySQLDB db    = new MySQLDB();

            return(db.GetData(query));
        }
コード例 #4
0
        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 + "%" }
            }));
        }
コード例 #5
0
        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 + "%" }
            }));
        }
コード例 #6
0
        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);
        }
コード例 #7
0
        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);
        }
コード例 #8
0
        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);
        }