You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
DS7/DSWebMobile/Handler/UserPopedom.ashx

108 lines
3.6 KiB
Plaintext

<%@ WebHandler Language="C#" Class="UserPopedom" %>
using System;
using System.Collections;
using System.Collections.Generic;
using System.Data;
using System.Text;
using System.Text.RegularExpressions;
using System.Web;
using System.Web.SessionState;
using DSWeb.Areas.CommMng.DAL;
using HcUtility.Comm;
using Microsoft.Practices.EnterpriseLibrary.Data;
using Newtonsoft.Json;
using DSWebMobileService.Common;
public class UserPopedom : IHttpHandler ,System.Web.SessionState.IRequiresSessionState
{
public void ProcessRequest (HttpContext context) {
string action = context.Request.QueryString["action"].ToString();
switch (action)
{
case "0":
GetProModuTreeList(context);
break;
case "1":
GetProParentModuTreeList(context);
break;
}
}
private void GetProParentModuTreeList(HttpContext context)
{
string relParentID = "";
string id = Encrypt.DesDecrypt("#7c&e@63", context.Request.QueryString["id"].ToString());
string pattern = "\0";
string replacement = "";
Regex rgx = new Regex(pattern);
relParentID = rgx.Replace(id, replacement);
pattern = "\t";
Regex rgx2 = new Regex(pattern);
relParentID = rgx2.Replace(relParentID, replacement);
var dbparams = new List<CustomDbParamter>();
var parampsOrgCode = new CustomDbParamter();
parampsOrgCode.ParameterName = "@oper";
parampsOrgCode.DbType = DbType.String;
parampsOrgCode.Direction = ParameterDirection.Input;
parampsOrgCode.Value = Convert.ToString(SessionUtil.Session["USERID"]);
dbparams.Add(parampsOrgCode);
var parampsExpDateBgn = new CustomDbParamter();
parampsExpDateBgn.ParameterName = "@strCondition";
parampsExpDateBgn.DbType = DbType.String;
parampsExpDateBgn.Direction = ParameterDirection.Input;
parampsExpDateBgn.Value = " and PARENTID='" + relParentID + "'";
dbparams.Add(parampsExpDateBgn);
var dbRptResult = PubSysDAL.GetMsSqlPrcDataSet("P_userRight", dbparams, "Result_Set");
string result = JsonConvert.SerializeObject(dbRptResult);
string result2 = result.Substring(25, result.Length - 72);
context.Response.ContentType = "text/plain";
context.Response.Write(result2);
context.Response.End();
}
private void GetProModuTreeList(HttpContext context)
{
var dbparams = new List<CustomDbParamter>();
var parampsOrgCode = new CustomDbParamter();
parampsOrgCode.ParameterName = "@oper";
parampsOrgCode.DbType = DbType.String;
parampsOrgCode.Direction = ParameterDirection.Input;
parampsOrgCode.Value = Convert.ToString(SessionUtil.Session["USERID"]);
dbparams.Add(parampsOrgCode);
var aa = SessionUtil.Session["USERID"];
var parampsExpDateBgn = new CustomDbParamter();
parampsExpDateBgn.ParameterName = "@strCondition";
parampsExpDateBgn.DbType = DbType.String;
parampsExpDateBgn.Direction = ParameterDirection.Input;
parampsExpDateBgn.Value = " and PARENTID='0'";
dbparams.Add(parampsExpDateBgn);
var dbRptResult = PubSysDAL.GetMsSqlPrcDataSet("P_userRight", dbparams, "Result_Set");
string result = JsonConvert.SerializeObject(dbRptResult);
string result2 = result.Substring(25, result.Length-72);
context.Response.ContentType = "text/plain";
context.Response.Write(result2);
context.Response.End();
}
public bool IsReusable {
get {
return false;
}
}
}