Ejemplo n.º 1
0
        public async Task <Boolean> CreateUser(string Nama, string User)
        {
            Boolean Result = false;

            try
            {
                string Query = "CreateUser";
                dbAccess.strConn = conn;
                SqlParameter[] pParam = new SqlParameter[2];
                pParam[0]       = new SqlParameter("@Nama", SqlDbType.VarChar);
                pParam[0].Value = Nama;
                pParam[1]       = new SqlParameter("@User", SqlDbType.VarChar);
                pParam[1].Value = User;

                int res = await dbAccess.ExecQueryByCommand(Query, pParam);

                if (res == 1)
                {
                    Result = true;
                }
                else
                {
                    Result = false;
                }
            }
            catch (Exception ex)
            {
                Result = false;
                throw;
            }
            return(Result);
        }
Ejemplo n.º 2
0
        public async Task <Boolean> CreateTypeBPJS(string BPJSId, string Deskripsi, string User)
        {
            Boolean Result = false;

            try
            {
                string Query = "CreateTypeBPJS";

                dbAccess.strConn = conn;
                SqlParameter[] pParam = new SqlParameter[3];
                pParam[0]       = new SqlParameter("@BPJSId", SqlDbType.VarChar);
                pParam[0].Value = BPJSId;
                pParam[1]       = new SqlParameter("@Deskripsi", SqlDbType.VarChar);
                pParam[1].Value = Deskripsi;
                pParam[2]       = new SqlParameter("@User", SqlDbType.VarChar);
                pParam[2].Value = User;
                int res = await dbAccess.ExecQueryByCommand(Query, pParam);

                if (res == 1)
                {
                    Result = true;
                }
                else
                {
                    Result = false;
                }
            }
            catch (Exception ex)
            {
                Result = false;

                throw;
            }
            return(Result);
        }
Ejemplo n.º 3
0
        public async Task <Boolean> CreateMasterMenu(string MenuName, string MenuURL, string MenuIcon, string MenuParentId, string User)
        {
            Boolean Result = false;

            if (MenuIcon == null)
            {
                MenuIcon = "";
            }
            if (MenuParentId == null)
            {
                MenuParentId = "";
            }
            try
            {
                string Query = "CreateMasterMenu";

                dbAccess.strConn = conn;
                SqlParameter[] pParam = new SqlParameter[5];
                pParam[0]       = new SqlParameter("@MenuName", SqlDbType.VarChar);
                pParam[0].Value = MenuName;
                pParam[1]       = new SqlParameter("@MenuURL", SqlDbType.VarChar);
                pParam[1].Value = MenuURL;
                pParam[2]       = new SqlParameter("@MenuIcon", SqlDbType.VarChar);
                pParam[2].Value = MenuIcon;
                pParam[3]       = new SqlParameter("@MenuParentId", SqlDbType.VarChar);
                pParam[3].Value = MenuParentId;
                pParam[4]       = new SqlParameter("@User", SqlDbType.VarChar);
                pParam[4].Value = User;
                int res = await dbAccess.ExecQueryByCommand(Query, pParam);

                if (res == 1)
                {
                    Result = true;
                }
                else
                {
                    Result = false;
                }
            }
            catch (Exception ex)
            {
                Result = false;

                throw;
            }
            return(Result);
        }
Ejemplo n.º 4
0
        public async Task <Boolean> CreateSlider(string Photo, string Judul, string DesSingkat, string DesPanjang, string User)
        {
            Boolean Result = false;

            try
            {
                string Query = "CreateSlider";
                dbAccess.strConn = conn;
                SqlParameter[] pParam = new SqlParameter[5];
                pParam[0]       = new SqlParameter("@Photo", SqlDbType.VarChar);
                pParam[0].Value = Photo;
                pParam[1]       = new SqlParameter("@Judul", SqlDbType.VarChar);
                pParam[1].Value = Judul;
                pParam[2]       = new SqlParameter("@DesSingkat", SqlDbType.VarChar);
                pParam[2].Value = DesSingkat;
                pParam[3]       = new SqlParameter("@DesPanjang", SqlDbType.VarChar);
                pParam[3].Value = DesPanjang;
                pParam[4]       = new SqlParameter("@User", SqlDbType.VarChar);
                pParam[4].Value = User;

                int res = await dbAccess.ExecQueryByCommand(Query, pParam);

                if (res == 1)
                {
                    Result = true;
                }
                else
                {
                    Result = false;
                }
            }
            catch (Exception ex)
            {
                Result = false;
                throw;
            }
            return(Result);
        }
Ejemplo n.º 5
0
        public async Task <Boolean> Setting(string RoleId, string MenuIds, string Actives, string Creates, string Updates, string Deletes, string User)
        {
            Boolean Result   = false;
            var     MenuId   = "";
            var     Active   = "";
            var     Create   = "";
            var     Update   = "";
            var     Delete   = "";
            var     Sparator = ";";

            try
            {
                string Query = "DelteRoleMenuMapping";

                dbAccess.strConn = conn;
                SqlParameter[] pParam = new SqlParameter[1];
                pParam[0]       = new SqlParameter("@RoleId", SqlDbType.VarChar);
                pParam[0].Value = RoleId;
                int res = await dbAccess.ExecQueryByCommand(Query, pParam);

                if (res != -1)
                {
                    if (MenuIds != "")
                    {
                        int Count = MenuIds.Split(new string[] { Sparator }, StringSplitOptions.None).Length;
                        for (int i = 0; i < Count; i++)
                        {
                            MenuId = MenuIds.Split(new string[] { Sparator }, StringSplitOptions.None)[i];
                            Active = Actives.Split(new string[] { Sparator }, StringSplitOptions.None)[i];
                            Create = Creates.Split(new string[] { Sparator }, StringSplitOptions.None)[i];
                            Update = Updates.Split(new string[] { Sparator }, StringSplitOptions.None)[i];
                            Delete = Deletes.Split(new string[] { Sparator }, StringSplitOptions.None)[i];
                            string sql = "CreateRoleMenuMepping";
                            dbAccess.strConn = conn;
                            SqlParameter[] Param = new SqlParameter[7];
                            Param[0]       = new SqlParameter("@RoleId", SqlDbType.VarChar);
                            Param[0].Value = RoleId;
                            Param[1]       = new SqlParameter("@MenuId", SqlDbType.VarChar);
                            Param[1].Value = MenuId;
                            Param[2]       = new SqlParameter("@Active", SqlDbType.VarChar);
                            Param[2].Value = Active;
                            Param[3]       = new SqlParameter("@Create", SqlDbType.VarChar);
                            Param[3].Value = Create;
                            Param[4]       = new SqlParameter("@Update", SqlDbType.VarChar);
                            Param[4].Value = Update;
                            Param[5]       = new SqlParameter("@Delete", SqlDbType.VarChar);
                            Param[5].Value = Delete;
                            Param[6]       = new SqlParameter("@User", SqlDbType.VarChar);
                            Param[6].Value = User;
                            await dbAccess.ExecQueryByCommand(sql, Param);
                        }
                    }
                    Result = true;
                }
                else
                {
                    Result = false;
                }
            }
            catch (Exception ex)
            {
                Result = false;

                throw;
            }
            return(Result);
        }