public string SetMenuRole(Stream stream)
        {
            string       menuIds = string.Empty;
            string       roleIds = string.Empty;
            string       menuStr = string.Empty;
            StreamReader sr      = new StreamReader(stream);


            try
            {
                string s = sr.ReadToEnd(); s = RestConsoleDemo.BLL.Helper.Base64Helper.DecodeBase64NotEnd(s);

                ResponseHelper.SetHeaderInfo();
                NameValueCollection nvc = System.Web.HttpUtility.ParseQueryString(s);

                roleIds = nvc["roleId"];
                menuStr = nvc["menuStr"];
                string Token = nvc["Token"];
                UserBill.CheckToken(Token);

                int    roleId = Convert.ToInt32(roleIds);
                string str    = RoleBill.SetMenuRole(roleId, menuStr);
                return(str);
            }
            catch (Exception ex)
            {
                return(RestConsoleDemo.BLL.Helper.ResponseHelper.ResponseMsg("-1", ex.Message, ""));
            }
        }
示例#2
0
 private BillRole getBillRole(RoleBill roleBill)
 {
     return(new BillRole {
         Amount = roleBill.Amount,
         Account = roleBill.Owner.Account,
         Owner = roleBill.Owner.Id,
         RoleName = roleBill.Owner.RoleType.GetDescription(),
         Status = roleBill.Success
     });
 }
        public string GetAllRoleForTransfer(Stream stream)
        {
            StreamReader sr = new StreamReader(stream);

            try
            {
                string s = sr.ReadToEnd(); s = RestConsoleDemo.BLL.Helper.Base64Helper.DecodeBase64NotEnd(s);
                NameValueCollection nvc = System.Web.HttpUtility.ParseQueryString(s);

                ResponseHelper.SetHeaderInfo();
                string Token = nvc["Token"];
                UserBill.CheckToken(Token);
                string str = RoleBill.GetAllRoleForTransfer();
                return(str);
            }
            catch (Exception ex)
            {
                return(RestConsoleDemo.BLL.Helper.ResponseHelper.ResponseMsg("-1", ex.Message, ""));
            }
        }
        public string DeleteRole(Stream stream)
        {
            StreamReader sr = new StreamReader(stream);

            try
            {
                ResponseHelper.SetHeaderInfo();
                string s = sr.ReadToEnd(); s = RestConsoleDemo.BLL.Helper.Base64Helper.DecodeBase64NotEnd(s);

                NameValueCollection nvc = System.Web.HttpUtility.ParseQueryString(s);
                string Token            = nvc["Token"];
                UserBill.CheckToken(Token);
                string   delStr = nvc["str"];
                string[] list   = delStr.Split(',');
                string   str    = RoleBill.DeleteRole(list);
                return(str);
            }
            catch (Exception ex)
            {
                return(RestConsoleDemo.BLL.Helper.ResponseHelper.ResponseMsg("-1", ex.Message, ""));
            }
        }
        public string GetAllRoleInfo(Stream stream)
        {
            StreamReader sr = new StreamReader(stream);

            try
            {
                string s = sr.ReadToEnd(); s = RestConsoleDemo.BLL.Helper.Base64Helper.DecodeBase64NotEnd(s);

                ResponseHelper.SetHeaderInfo();
                NameValueCollection nvc = System.Web.HttpUtility.ParseQueryString(s);
                string ParameterStr     = nvc["ParameterStr"];
                int    PageSize         = Convert.ToInt32(nvc["PageSize"]);
                int    CurrentPage      = Convert.ToInt32(nvc["CurrentPage"]);
                string Token            = nvc["Token"];
                UserBill.CheckToken(Token);
                string str = RoleBill.GetAllRoleInfo(ParameterStr, PageSize, CurrentPage);
                return(str);
            }
            catch (Exception ex)
            {
                return(RestConsoleDemo.BLL.Helper.ResponseHelper.ResponseMsg("-1", ex.Message, ""));
            }
        }