public dynamic GetAllDsn(string npp)
        {
            OutPutApi output = new OutPutApi();

            output.status = true;
            using (SqlConnection conn = new SqlConnection(DBKoneksi.koneksi))
            {
                try
                {
                    string query = @"SELECT D.NPP, D.NAMA_DOSEN_LENGKAP
                                    FROM MST_DOSEN D
                                    WHERE KD_STATUS_DOSEN ='A'";
                    var    data  = conn.Query <dynamic>(query, new { npp = npp }).ToList();

                    output.data = data;

                    return(output);
                }
                catch (Exception ex)
                {
                    output.status = false;
                    output.pesan  = ex.Message;
                    output.data   = new List <string>();
                    return(output);
                }
                finally
                {
                    conn.Dispose();
                }
            }
        }
Пример #2
0
        public dynamic GetAllMhs(string npm)
        {
            OutPutApi output = new OutPutApi();

            output.status = true;
            using (SqlConnection conn = new SqlConnection(DBKoneksi.koneksi))
            {
                try
                {
                    string query = @"SELECT m.NPM, m.NAMA_MHS
                                    FROM dbo.MST_MHS_AKTIF m
                                    WHERE m.KD_STATUS_MHS ='A'";
                    var    data  = conn.Query <dynamic>(query, new { npm = npm }).ToList();

                    output.data = data;

                    return(output);
                }
                catch (Exception ex)
                {
                    output.status = false;
                    output.pesan  = ex.Message;
                    output.data   = new List <string>();
                    return(output);
                }
                finally
                {
                    conn.Dispose();
                }
            }
        }
        public OutPutApi GetDsnProfil(string npp)
        {
            OutPutApi dt = new OutPutApi();

            dt.status = true;
            dt.pesan  = "Berhasil Mengambil data";

            var data = dao.GetAllDsn(npp);;

            if (data != null)
            {
                dt.data = data;
            }
            else
            {
                dt.status = false;
                dt.pesan  = "Tidak ada data";
            }

            return(dt);
        }
 public DsnBM()
 {
     dao    = new DsnDAO();
     output = new OutPutApi();
 }
Пример #5
0
 public AuthBM()
 {
     dao    = new AuthDAO();
     output = new OutPutApi();
 }
 public MhsBM()
 {
     dao    = new MhsDAO();
     output = new OutPutApi();
 }