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]"; } }
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); } }
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); } }
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) }); }
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)); } }
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)); }
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)); }
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)); }
public static uint GetWindowClassLong(IntPtr hWnd, GCL nIndex) { if (IntPtr.Size > 4) { return(GetClassLongPtr(hWnd, nIndex)); } else { return(GetClassLong(hWnd, nIndex)); } }
public static extern int GetClassLong(HWND hwnd, GCL nIndex);
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"); } }
public void Logout(HttpRequest request, HttpResponse response, HttpContext context, GCL.Project.VESH.V.Control.Session.SessionDataManager session) { session.Logout(); }
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); } }
private static extern IntPtr _GetClassLongPtr(HWND hwnd, GCL nIndex);
public void PreLoad(HttpRequest request, HttpResponse response, HttpContext context, GCL.Project.VESH.V.Control.Session.SessionDataManager session) { }
public static extern int GetClassLongA(IntPtr hWnd, GCL nIndex);
private static partial IntPtr SetClassLongPtrW(IntPtr hwnd, GCL nIndex, IntPtr dwNewLong);
public static uint GetWindowClassLong(IntPtr hWnd, GCL nIndex) { if (IntPtr.Size > 4) return GetClassLongPtr(hWnd, nIndex); else return GetClassLong(hWnd, nIndex); }
private static extern IntPtr _SetClassLongPtr(HWND hwnd, GCL nIndex, IntPtr dwNewLong);
private static partial IntPtr GetClassLongPtrW(IntPtr hWnd, GCL nIndex);
public static extern uint GetClassLongPtr(IntPtr hWnd, [MarshalAs(UnmanagedType.I4)] GCL nIndex);
private static extern IntPtr GetClassLongPtrW(IntPtr hWnd, GCL nIndex);
private static extern IntPtr SetClassLongPtrW(IntPtr hwnd, GCL nIndex, IntPtr dwNewLong);
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); } }
public static extern int SetClassLong(HWND hwnd, GCL nIndex, int dwNewLong);