Esempio n. 1
0
        public string GetBlackListById(Stream stream)
        {
            string ID = string.Empty;

            StreamReader sr = new StreamReader(stream);


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

                Helper.ResponseHelper.SetHeaderInfo();
                NameValueCollection nvc = System.Web.HttpUtility.ParseQueryString(s);
                ID = nvc["Id"];
                string Token = nvc["Token"];
                UserBill.CheckToken(Token);
                int    id  = Convert.ToInt32(ID);
                string str = BlackListBill.GetBlackListById(id);
                return(str);
            }
            catch (Exception ex)
            {
                return(RestConsoleDemo.BLL.Helper.ResponseHelper.ResponseMsg("-1", ex.Message, ""));
            }
        }
Esempio n. 2
0
        public string UpdateBlackList(Stream stream)
        {
            StreamReader sr = new StreamReader(stream);

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

                NameValueCollection nvc = System.Web.HttpUtility.ParseQueryString(s);
                string addStr           = nvc["str"];
                string Token            = nvc["Token"];
                UserBill.CheckToken(Token);
                string str = BlackListBill.UpdateBlackList(addStr);
                return(str);
            }
            catch (Exception ex)
            {
                return(RestConsoleDemo.BLL.Helper.ResponseHelper.ResponseMsg("-1", ex.Message, ""));
            }
        }
Esempio n. 3
0
        public string GetAllBlackListInfo(Stream stream)
        {
            StreamReader sr = new StreamReader(stream);

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

                Helper.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 = BlackListBill.GetAllBlackListInfo(ParameterStr, PageSize, CurrentPage);
                return(str);
            }
            catch (Exception ex)
            {
                return(RestConsoleDemo.BLL.Helper.ResponseHelper.ResponseMsg("-1", ex.Message, ""));
            }
        }