public string GetDeptById(Stream stream) { string ID = 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); ID = nvc["Id"]; string Token = nvc["Token"]; UserBill.CheckToken(Token); int id = Convert.ToInt32(ID); string str = DeptBill.GetDeptById(id); return(str); } catch (Exception ex) { return(RestConsoleDemo.BLL.Helper.ResponseHelper.ResponseMsg("-1", ex.Message, "")); } }
public string GetAllDeptForTransfer(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 = DeptBill.GetAllDeptForTransfer(); return(str); } catch (Exception ex) { return(RestConsoleDemo.BLL.Helper.ResponseHelper.ResponseMsg("-1", ex.Message, "")); } }
public string GetAllDeptInfo(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 = DeptBill.GetAllDeptInfo(ParameterStr, PageSize, CurrentPage); return(str); } catch (Exception ex) { return(RestConsoleDemo.BLL.Helper.ResponseHelper.ResponseMsg("-1", ex.Message, "")); } }
public string SetUserDept(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 userIds = nvc["userId"]; int userId = Convert.ToInt32(userIds); string deptStr = nvc["deptStr"]; string Token = nvc["Token"]; UserBill.CheckToken(Token); string str = DeptBill.SetUserDept(userId, deptStr); return(str); } catch (Exception ex) { return(BLL.Helper.ResponseHelper.ResponseMsg("-1", ex.Message, "")); } }