示例#1
0
 public void GetPermission(HttpRequest request, HttpResponse response, HttpContext context, GCL.Project.VESH.V.Control.Session.SessionDataManager session) {
     var ret = manager.ExcuteQuery("lvde", "VESHTest.Module.admin.GetPermission");
     if (ret.DataSet.Tables.Count > 0) {
         var dt = ret.DataSet.Tables[0];
         int rowNum = ret.DataSet.Tables[0].Rows.Count;
         StringBuilder sb = new StringBuilder();
         try {
             sb.Append(@"window.Pers={");
             for (int i = 0; i < rowNum; i++) {
                 sb.Append(i == 0 ? ("'" + dt.Rows[i][0].ToString()) : (",'" + dt.Rows[i][0].ToString()));
                 sb.Append(@"':'");
                 sb.Append(dt.Rows[i][1].ToString());
                 sb.Append("'");
             }
             sb.Append(@"};");
             string savePath = null;
             savePath = request.PhysicalApplicationPath + "Scripts\\permission.js";
             session.Status = sb.ToString();
             if (System.IO.File.Exists(savePath))
                 System.IO.File.Delete(savePath);
             System.IO.File.WriteAllText(savePath, sb.ToString());
         } finally {
             sb.Clear();
             sb = null;
         }
     } else {
         session.Status = "[False]";
     }
 }
示例#2
0
 public void minilogin(HttpRequest request, HttpResponse response, HttpContext context, GCL.Project.VESH.V.Control.Session.SessionDataManager session) {
     //处理登陆并进行会话保存
     string userName = Convert.ToString(request["userName"]);
     string pwd = Convert.ToString(Tool.GetCRCHashCode(request["pwd"]));
     var ret = manager.ExcuteQuery("lvde", "VESHTest.Module.admin.Login", new Hashtable() { { "_UserName", userName }, { "_Password", pwd }, { "SystemType", 1 } });
     if (ret.DataSet.Tables.Count > 0) {
         //todo 获取用户信息 选择默认角色 获取角色串 权限串 获取菜单栏准备转向 设置Login
         session.DBResult.Add("user", ret.DataSet);
         session.UserInfo.UserID = Convert.ToString(ret.GetCell("ID"));
         session.UserInfo.EntityID = Convert.ToString(ret.GetCell("EntityID"));
         session.UserInfo["UserName"] = Convert.ToString(ret.GetCell("UserName"));
         //这里需要可用的登陆时间 不用手动设置session.UserInfo.LoginTime = GCL.Common.Tool.FormatNow();
         session.UserInfo.SystemID = "admin";
         session.UserInfo["Mail"] = Convert.ToString(ret.GetCell("Mail"));
         session.UserInfo["Phone"] = Convert.ToString(ret.GetCell("Phone"));
         //数据库中没有 添加默认值
         session.UserInfo["Icon"] = "../../Images/home/demo.jpg";
         session.UserInfo.EIDS = Convert.ToString(ret.GetCell(1, 0));
         //session.UserInfo["PIDS"] = Convert.ToString(ret.GetCell(1, 1));
         session.PermissionData.Init(Convert.ToString(ret.GetCell(1, 1)));
         session.UserInfo.SessionID = SessionData.CreateGUIDSessionID();
         session.Login();
         ret = session.NiTemplateManager.ExcuteQuery("lvde", "VESHTest.Module.admin.GetMenu", new Hashtable() { { "_PerIDs", session.PermissionData.PermissionCollection.PermissionCollections }, { "_SystemID", "admin" } });
         var menu = ret.Fill<VESHTest.Entity.Menu>(0);
         if (menu != null && menu.Length > 0) {
             session.DBResult.Add("Menu", ret.DataSet);
             var menu2 = GCL.Common.Tool.Serializer.Serialize(menu);
             session[".Menu"][".value"] = menu2;
         }
     } else {
         session.DBResult.Add("user", null);
     }
 }
示例#3
0
        public void LawyerLogin(HttpRequest request, HttpResponse response, HttpContext context, GCL.Project.VESH.V.Control.Session.SessionDataManager session) {
            //处理登陆并进行会话保存
            string userName = Convert.ToString(request["userName"]);
            string pwd = Convert.ToString(Tool.GetCRCHashCode(request["pwd"]));
            var ret = manager.ExcuteQuery("lvde", "VESHTest.Module.login.LawyerLogin", new Hashtable() { { "_UserName", userName }, { "_Password", pwd } });
            if (ret.DataSet.Tables.Count > 0) {
                //todo 获取用户信息 选择默认角色 获取角色串 权限串 获取菜单栏准备转向 设置Login
                session.DBResult.Add("user", ret.DataSet);
                session.UserInfo.UserID = Convert.ToString(ret.GetCell("ID"));
                session.UserInfo.EntityID = Convert.ToString(ret.GetCell("EntityID"));
                session.UserInfo["UserName"] = Convert.ToString(ret.GetCell("LName"));
                //这里需要可用的登陆时间 不用手动设置session.UserInfo.LoginTime = GCL.Common.Tool.FormatNow();
                session.UserInfo.SystemID = "my";
                session.UserInfo["Icon"] = Convert.ToString(ret.GetCell("Icon"));
                session.UserInfo["Mail"] = Convert.ToString(ret.GetCell("Mail"));
                session.UserInfo["Phone"] = Convert.ToString(ret.GetCell("Phone"));
                session.UserInfo["QQ"] = Convert.ToString(ret.GetCell("QQ"));
                session.UserInfo["bankNo"] = Convert.ToString(ret.GetCell("bankNo"));
                session.UserInfo["Name"] = Convert.ToString(ret.GetCell("Name"));
                session.UserInfo["LoginCount"] = Convert.ToString(ret.GetCell("LoginCount"));

                session.UserInfo.EIDS = Convert.ToString(ret.GetCell(1, 0));
                session.PermissionData.Init(Convert.ToString(ret.GetCell(1, 1)));
                session.UserInfo.SessionID = SessionData.CreateGUIDSessionID();
                session.Login();
                session.Status = string.Format("[{0}]", GCL.Common.Tool.Serializer.Serialize(new { ID = session.UserInfo.UserID, SessionID = session.UserInfo.SessionID, UserName = session.UserInfo["UserName"], EntityID = session.UserInfo.EntityID, EIDS = session.UserInfo.EIDS, PIDS = session.PermissionData.PermissionCollection.PermissionCollections }));
            } else {
                session.DBResult.Add("user", null);
            }
        }
示例#4
0
        public void Upload(HttpRequest request, HttpResponse response, HttpContext context, GCL.Project.VESH.V.Control.Session.SessionDataManager session) {
            string filePathName = string.Empty;
            string urlPath = "../../upload";
            string localPath = Path.Combine(HttpRuntime.AppDomainAppPath, "upload");
            if (request.Files.Count == 0) {
                session.Status = GCL.Common.Tool.Serializer.Serialize(new { jsonrpc = 2.0, error = new { code = 102, message = "保存失败" }, id = "id" });
            }
            try {
                var dataPath = GCL.Common.Tool.FormatNow("yyyy/MM/dd/");
                filePathName = dataPath + Guid.NewGuid().ToString().Replace("-", "") + request.Files[0].FileName.Substring(request.Files[0].FileName.IndexOf('.'));//自己在这里处理文件保存 Request.Files[0]

                if (!System.IO.Directory.Exists(dataPath)) {
                    System.IO.Directory.CreateDirectory(localPath + "/" + dataPath);
                }
                //todo 入库
                request.Files[0].SaveAs(string.Format("{0}/{1}", localPath, filePathName));
            } catch (Exception ex) {
                session.Status = GCL.Common.Tool.Serializer.Serialize(new { jsonrpc = 2.0, error = new { code = 103, message = "保存失败" }, id = "id" });
                return;
            }

            session.Status = GCL.Common.Tool.Serializer.Serialize(new {
                jsonrpc = "2.0",
                id = "id",
                filePath = string.Format("{0}/{1}", urlPath, filePathName)
            });
        }
示例#5
0
 public void getlCard(HttpRequest request, HttpResponse response, HttpContext context, GCL.Project.VESH.V.Control.Session.SessionDataManager session)
 {
     var ret = new GCL.Db.Ni.NiTemplateManager(session.Middler, "Ni").ExcuteQuery("db2", "VESHTest.Module.reg.getlCard", new System.Collections.Hashtable() { { "IDCard", request["IDCard"] } });
     if (ret.DataSet.Tables.Count > 0)
     {
         session.Status = Convert.ToString(ret.GetFirstCell(0));
     }
 }
示例#6
0
 public static IntPtr SetClassLong(IntPtr hWnd, GCL nIndex, IntPtr dwNewLong)
 {
     if (IntPtr.Size == 4)
     {
         return(SetClassLongW(hWnd, nIndex, dwNewLong));
     }
     return(SetClassLongPtrW(hWnd, nIndex, dwNewLong));
 }
        public static IntPtr GetClassLong(IntPtr hWnd, GCL nIndex)
        {
            if (IntPtr.Size == 4)
            {
                return(GetClassLongW(hWnd, nIndex));
            }

            return(GetClassLongPtrW(hWnd, nIndex));
        }
示例#8
0
 public static IntPtr SetClassLongPtr(HWND hwnd, GCL nIndex, IntPtr dwNewLong)
 {
     if (IntPtr.Size == 4)
     {
         // The SetWindowLongPtr entrypoint may not exist on 32-bit
         // OSes, so use the legacy SetWindowLong function instead.
         return(new IntPtr(SetClassLong(hwnd, nIndex, dwNewLong.ToInt32())));
     }
     return(_SetClassLongPtr(hwnd, nIndex, dwNewLong));
 }
示例#9
0
 public static IntPtr GetClassLongPtr(HWND hwnd, GCL nIndex)
 {
     if (IntPtr.Size == 4)
     {
         // The GetClassLongPtr entrypoint may not exist on 32-bit
         // OSes, so use the legacy SetWindowLong function instead.
         return(new IntPtr(GetClassLong(hwnd, nIndex)));
     }
     return(_GetClassLongPtr(hwnd, nIndex));
 }
示例#10
0
 public static uint GetWindowClassLong(IntPtr hWnd, GCL nIndex)
 {
     if (IntPtr.Size > 4)
     {
         return(GetClassLongPtr(hWnd, nIndex));
     }
     else
     {
         return(GetClassLong(hWnd, nIndex));
     }
 }
示例#11
0
 public static extern int GetClassLong(HWND hwnd, GCL nIndex);
示例#12
0
 public void PreLoad(HttpRequest request, HttpResponse response, HttpContext context, GCL.Project.VESH.V.Control.Session.SessionDataManager session) {
     if (manager == null) { manager = new NiTemplateManager(session.Middler, "Ni"); }
 }
示例#13
0
 public void Logout(HttpRequest request, HttpResponse response, HttpContext context, GCL.Project.VESH.V.Control.Session.SessionDataManager session) {
     session.Logout();
 }
示例#14
0
 public static IntPtr SetClassLongPtr(HWND hwnd, GCL nIndex, IntPtr dwNewLong)
 {
     if (IntPtr.Size == 4)
     {
         // The SetWindowLongPtr entrypoint may not exist on 32-bit
         // OSes, so use the legacy SetWindowLong function instead.
         return new IntPtr(SetClassLong(hwnd, nIndex, dwNewLong.ToInt32()));
     }
     else
     {
         return _SetClassLongPtr(hwnd, nIndex, dwNewLong);
     }
 }
示例#15
0
 public static extern int GetClassLong(HWND hwnd, GCL nIndex);
示例#16
0
 private static extern IntPtr _GetClassLongPtr(HWND hwnd, GCL nIndex);
示例#17
0
        public void PreLoad(HttpRequest request, HttpResponse response, HttpContext context, GCL.Project.VESH.V.Control.Session.SessionDataManager session) {

        }
示例#18
0
 public static extern int GetClassLongA(IntPtr hWnd, GCL nIndex);
示例#19
0
 private static partial IntPtr SetClassLongPtrW(IntPtr hwnd, GCL nIndex, IntPtr dwNewLong);
示例#20
0
 public static uint GetWindowClassLong(IntPtr hWnd, GCL nIndex)
 {
     if (IntPtr.Size > 4)
         return GetClassLongPtr(hWnd, nIndex);
     else
         return GetClassLong(hWnd, nIndex);
 }
示例#21
0
 private static extern IntPtr _SetClassLongPtr(HWND hwnd, GCL nIndex, IntPtr dwNewLong);
示例#22
0
 private static partial IntPtr GetClassLongPtrW(IntPtr hWnd, GCL nIndex);
示例#23
0
 private static extern IntPtr _GetClassLongPtr(HWND hwnd, GCL nIndex);
示例#24
0
 public static extern uint GetClassLongPtr(IntPtr hWnd, [MarshalAs(UnmanagedType.I4)] GCL nIndex);
 private static extern IntPtr GetClassLongPtrW(IntPtr hWnd, GCL nIndex);
示例#26
0
 private static extern IntPtr _SetClassLongPtr(HWND hwnd, GCL nIndex, IntPtr dwNewLong);
示例#27
0
 private static extern IntPtr SetClassLongPtrW(IntPtr hwnd, GCL nIndex, IntPtr dwNewLong);
示例#28
0
 public static IntPtr GetClassLongPtr(HWND hwnd, GCL nIndex)
 {
     if (IntPtr.Size == 4)
     {
         // The GetClassLongPtr entrypoint may not exist on 32-bit
         // OSes, so use the legacy SetWindowLong function instead.
         return new IntPtr(GetClassLong(hwnd, nIndex));
     }
     else
     {
         return _GetClassLongPtr(hwnd, nIndex);
     }
 }
示例#29
0
 public static extern int SetClassLong(HWND hwnd, GCL nIndex, int dwNewLong);
示例#30
0
 public static extern int SetClassLong(HWND hwnd, GCL nIndex, int dwNewLong);