Esempio n. 1
0
        public async Task <List <RoleMenu> > GetRole()
        {
            List <RoleMenu> Result = new List <RoleMenu>();

            try
            {
                string    Query = "GetRoleMaster";
                DataTable dt    = new DataTable();
                dbAccess.strConn = conn;
                dt = await dbAccess.GetDataTable(Query);

                foreach (DataRow dr in dt.Rows)
                {
                    Result.Add(
                        new RoleMenu
                    {
                        RoleID   = Convert.ToString(dr["RoleID"]),
                        RoleName = Convert.ToString(dr["Name"]),
                    });
                }
                return(Result);
            }
            catch (Exception e)
            {
                throw;
            }
        }
Esempio n. 2
0
        public async Task <List <MasterMenu> > GetMasterMenu()
        {
            List <MasterMenu> Result = new List <MasterMenu>();

            try
            {
                string    Query = "GetMasterMenu";
                DataTable dt    = new DataTable();
                dbAccess.strConn = conn;
                dt = await dbAccess.GetDataTable(Query);

                foreach (DataRow dr in dt.Rows)
                {
                    Result.Add(
                        new MasterMenu
                    {
                        MenuId       = Convert.ToString(dr["MenuId"]),
                        MenuName     = Convert.ToString(dr["MenuName"]),
                        MenuURL      = Convert.ToString(dr["MenuURL"]),
                        MenuIcon     = Convert.ToString(dr["MenuIcon"]),
                        MenuParentId = Convert.ToString(dr["MenuParentId"]),
                        MenuParent   = Convert.ToString(dr["MenuParent"]),
                    });
                }
                return(Result);
            }
            catch (Exception e)
            {
                throw;
            }
        }
Esempio n. 3
0
        public async Task <List <MasterSlider> > GetSlider()
        {
            List <MasterSlider> Result = new List <MasterSlider>();

            try
            {
                string    Query = "GetSlider";
                DataTable dt    = new DataTable();
                dbAccess.strConn = conn;
                dt = await dbAccess.GetDataTable(Query);

                foreach (DataRow dr in dt.Rows)
                {
                    string path        = HttpContext.Current.Server.MapPath(Convert.ToString(dr["Photo"]));
                    var    ImageBase64 = GetBase64StringForImage(path);
                    Result.Add(
                        new MasterSlider
                    {
                        ID         = Convert.ToString(dr["Id"]),
                        Photo      = "data:image/png;base64," + ImageBase64,
                        Judul      = Convert.ToString(dr["Judul"]),
                        DesSingkat = Convert.ToString(dr["DesSingkat"]),
                        DesPanjang = Convert.ToString(dr["DesPanjang"])
                    });
                }
                return(Result);
            }
            catch (Exception e)
            {
                throw;
            }
        }
Esempio n. 4
0
        public async Task <List <MasterPulsa> > GetPulsa()
        {
            List <MasterPulsa> Result = new List <MasterPulsa>();

            try
            {
                string    Query = "GetPulsa";
                DataTable dt    = new DataTable();
                dbAccess.strConn = conn;
                dt = await dbAccess.GetDataTable(Query);

                foreach (DataRow dr in dt.Rows)
                {
                    Result.Add(
                        new MasterPulsa
                    {
                        PulsaId   = Convert.ToString(dr["PulsaId"]),
                        Deskripsi = Convert.ToString(dr["Deskripsi"]),
                    });
                }
                return(Result);
            }
            catch (Exception e)
            {
                throw;
            }
        }
Esempio n. 5
0
        public async Task <List <User> > GetUser()
        {
            List <User> Result = new List <User>();

            try
            {
                string    Query = "GetUser";
                DataTable dt    = new DataTable();
                dbAccess.strConn = conn;
                dt = await dbAccess.GetDataTable(Query);

                foreach (DataRow dr in dt.Rows)
                {
                    Result.Add(
                        new User
                    {
                        UserID = Convert.ToString(dr["UserID"]),
                        Name   = Convert.ToString(dr["Name"]),
                    });
                }
                return(Result);
            }
            catch (Exception e)
            {
                throw;
            }
        }
Esempio n. 6
0
        public async Task <List <MasterTypeMember> > GetTypeMember()
        {
            List <MasterTypeMember> Result = new List <MasterTypeMember>();

            try
            {
                string    Query = "GetTypemember";
                DataTable dt    = new DataTable();
                dbAccess.strConn = conn;
                dt = await dbAccess.GetDataTable(Query);

                foreach (DataRow dr in dt.Rows)
                {
                    Result.Add(
                        new MasterTypeMember
                    {
                        TypeMember = Convert.ToString(dr["TypeMember"]),
                        Deskripsi  = Convert.ToString(dr["Deskripsi"]),
                    });
                }
                return(Result);
            }
            catch (Exception e)
            {
                throw;
            }
        }
Esempio n. 7
0
        public async Task <List <MasterMember> > GetMember()
        {
            List <MasterMember> Result = new List <MasterMember>();

            try
            {
                string    Query = "GetMember";
                DataTable dt    = new DataTable();
                dbAccess.strConn = conn;
                dt = await dbAccess.GetDataTable(Query);

                foreach (DataRow dr in dt.Rows)
                {
                    Result.Add(
                        new MasterMember
                    {
                        MemberId      = Convert.ToString(dr["MemberId"]),
                        Photo         = Convert.ToString(dr["Photo"]),
                        NamaMember    = Convert.ToString(dr["Nama"]),
                        Email         = Convert.ToString(dr["Email"]),
                        NoTepon       = Convert.ToString(dr["NoTelpon"]),
                        KodeReverall  = Convert.ToString(dr["KodeReverall"]),
                        TypeMember    = Convert.ToString(dr["Deskripsi"]),
                        TanggalGabung = Convert.ToString(dr["TglBergabung"]),
                    });
                }
                return(Result);
            }
            catch (Exception e)
            {
                throw;
            }
        }