protected void lnkExit_Click(object sender, EventArgs e) { try { GoodwaySSO.Sso.Singletion.LogoutUserState(Session["PassCode"].ToString()); } catch { } WebPortalService.Exit(); }
protected void lnkRelogin_Click(object sender, EventArgs e) { try { GoodwaySSO.Sso.Singletion.LogoutUserStateEx(Session["PassCode"].ToString(), "PC.IE"); } catch { } WebPortalService.LogoutAndRedirect(); }
protected void Page_Load(object sender, EventArgs e) { string id = Request["id"]; string strAction = Request["action"]; IList <SysModule> ents = null; if (strAction == "logout") { WebPortalService.LogoutAndRedirect(); } if (!string.IsNullOrEmpty(id)) { if (id == "-1") { // WebPortalService.CurrentUserContext.UserInfo.UserID ents = WebPortalService.CurrentUserContext.AccessibleModules.Where(tent => tent.ApplicationID == "d0f7290f-914c-4de0-af68-3ca340209e11").ToList(); ents = ents.Where(tent => String.IsNullOrEmpty(tent.ParentID)).ToList(); ents = ents.OrderBy(tent => tent.SortIndex).ToList(); } else { ents = WebPortalService.CurrentUserContext.AccessibleModules.Where(tent => tent.ParentID == id).ToList(); ents = ents.OrderBy(tent => tent.SortIndex).ToList(); } int i = 0; string result = "["; foreach (SysModule smEnt in ents) { if (i != ents.Count - 1) { result += "{id:'" + smEnt.ModuleID + "',name:'" + smEnt.Name + "',leaf:'" + smEnt.IsLeaf + "',url:'" + smEnt.Url + "'},"; } else { result += "{id:'" + smEnt.ModuleID + "',name:'" + smEnt.Name + "',leaf:'" + smEnt.IsLeaf + "',url:'" + smEnt.Url + "'}"; } i++; } result += "]"; Response.Write(result); Response.End(); } }
protected void lnkExit_Click(object sender, EventArgs e) { WebPortalService.Exit(); }
/// <summary> /// 初始化方法(先于Page_Load和OnLoad执行) /// </summary> /// <param name="e"></param> protected override void OnInit(EventArgs e) { base.OnInit(e); this.EnableViewState = false; // 禁用ViewState // 判断是否异步请求 if (!String.IsNullOrEmpty(Request["AsyncReq"]) && Request["AsyncReq"].Trim().ToUpper() == "TRUE") { this.IsAsyncRequest = true; } else { if (IsAsyncPage) { PageState.Add("AsyncState", true); // 异步状态 Form.Attributes["async"] = "true"; } } try { if (IsCheckLogon) { WebPortalService.CheckLogon(); } if (!String.IsNullOrEmpty(PageKey) && IsCheckAuth) { WebPortalService.CheckAuth(PageKey); } } catch (SecurityException sex) { // 非异步请求转向 if (!IsAsyncRequest) { // 登出并导航到登录页面 WebPortalService.LogoutAndRedirect(); } else { throw sex; } } // 解包请求 this.unPackRequest(); if (!this.IsAsyncRequest) { if (this.containter == null && Form != null) { Form.Attributes.Add("aimctrl", AimFormCtrlTag); Form.Attributes.Add("dsname", FormDataKey); this.containter = new PageStateContainer(); this.Form.Controls.Add(containter); } } }
protected void lnkRelogin_Click(object sender, EventArgs e) { WebPortalService.LogoutAndRedirect(); }
protected void Page_Load(object sender, EventArgs e) { switch (RequestActionString) { case "logout": WebPortalService.Logout(); break; default: if (Request.QueryString["tag"] != null && Request.QueryString["tag"] == "Refresh") { try { GoodwaySSO.Sso.Singletion.RefreshUserState(Session["PassCode"].ToString()); } catch { } //在线人数 int urcts = 0; Aim.Portal.ServicesProvider.WebPortalServiceProvider ws = (Aim.Portal.ServicesProvider.WebPortalServiceProvider)WebPortalService.GetDefaultProvider(); urcts = Aim.Common.ServiceHelper.DeserializeFromBytes <SysUser[]>(ws.USService.GetSystemData("<container><parameters><parameter Name='SessionID'></parameter><parameter Name='Operation'>getonlineusers</parameter></parameters></container>")).Length; Response.Write(urcts); Response.End(); } //string connStr = ConfigurationManager.AppSettings["BJKY_Examine"].ToString(); //SqlConnection conn = new SqlConnection(connStr); //string sql = "select Id from BJKY_Examine..PersonConfig where ClerkIds like '%" + UserInfo.UserID + "%' and GroupType <>'系统部门'";//判定登陆人是不是员工 //SqlCommand com = new SqlCommand(sql, conn); //conn.Open(); //DataSet ds = new DataSet(); //SqlDataAdapter da = new SqlDataAdapter(com); //da.Fill(ds); //conn.Close(); //if (ds.Tables[0].Rows.Count > 0) //{ // PageState.Add("IsClerk", "T"); //} //else //{ // PageState.Add("IsClerk", "F"); //} IEnumerable <SysModule> topAuthExamMdls = new List <SysModule>(); string appcode = EXAMINING_APP_CODE; if (this.Request.QueryString["App"] != null && this.Request.QueryString["App"].Trim() != "") { appcode = this.Request.QueryString["App"]; } if (UserContext.AccessibleApplications.Count > 0) { SysApplication examApp = UserContext.AccessibleApplications.FirstOrDefault(tent => tent.Code == appcode); if (examApp != null && UserContext.AccessibleModules.Count > 0) { topAuthExamMdls = UserContext.AccessibleModules.Where(tent => tent.ApplicationID == examApp.ApplicationID && String.IsNullOrEmpty(tent.ParentID)); topAuthExamMdls = topAuthExamMdls.OrderBy(tent => tent.SortIndex); } } if (Session["PassCode"] == null) { SqlDataAdapter sda = new SqlDataAdapter("select Id,WorkNo,UserName,SystemName from OgUser where SystemName='" + this.UserInfo.LoginName + "' ", System.Configuration.ConfigurationManager.ConnectionStrings["BJKY_BeAdmin"].ConnectionString); DataTable dt = new DataTable(); sda.Fill(dt); if (dt.Rows.Count > 0) { DataRow row = dt.Rows[0]; string template = "<Form Name='" + row["Id"] + "'><Id>" + row["Id"] + "</Id><WorkNo>" + row["WorkNo"] + "</WorkNo><UserName>" + row["UserName"] + "</UserName><SystemName>" + row["SystemName"] + "</SystemName><Password></Password><Field></Field></Form>"; string passCode = ""; // 20140409 潘注释 不然导致首页加载非常慢 try { passCode = GoodwaySSO.Sso.LoginGW(template, row["Id"].ToString(), row["UserName"].ToString()); } catch { } PageState.Add("PassCode", passCode); Session["PassCode"] = passCode; } else { Session["PassCode"] = ""; } } IList <SysApplication> saEnts = UserContext.AccessibleApplications.OrderBy(tens => tens.SortIndex).Where(ent => ent.Status == 1).ToArray(); this.PageState.Add("Modules", saEnts); DataTable dtps = DataHelper.QueryDataTable("select GroupID DeptId,Name DeptName from SysGroup where GroupID in (select BaseTemplateId from WebPartTemplate where BlockType='DeptPortal')"); this.PageState.Add("Depts", DataHelper.DataTableToDictList(dtps)); //在线人数 int urs = 0; Aim.Portal.ServicesProvider.WebPortalServiceProvider uss = (Aim.Portal.ServicesProvider.WebPortalServiceProvider)WebPortalService.GetDefaultProvider(); urs = Aim.Common.ServiceHelper.DeserializeFromBytes <SysUser[]>(uss.USService.GetSystemData("<container><parameters><parameter Name='SessionID'></parameter><parameter Name='Operation'>getonlineusers</parameter></parameters></container>")).Length; this.PageState.Add("UserOnLine", urs); //PopWin(); break; } }
protected void ImageButton1_Click(object sender, ImageClickEventArgs e) { WebPortalService.LogoutAndRedirect("Login.aspx"); }
/// <summary> /// 查询 /// </summary> private void DoSelect() { string sql = @"select * from SysUser where UserID in ( select UserID from ( select count(UserID)%2 cnt,UserID from SysEvent where DateTime>=dateadd(day,-2,GetDate()) and Type is null group by UserID) a where cnt>0)"; if (SearchCriterion.GetSearchValue <string>("Name") != "") { sql += " and Name like '%" + SearchCriterion.GetSearchValue <string>("Name") + "%'"; } //PageState.Add("AbsenceApplyList", GetPageData(sql, SearchCriterion)); //ents = AbsenceApply.FindAll(SearchCriterion); //this.PageState.Add("AbsenceApplyList", ents); Aim.Portal.ServicesProvider.WebPortalServiceProvider ws = (Aim.Portal.ServicesProvider.WebPortalServiceProvider)WebPortalService.GetDefaultProvider(); SysUser[] users = Aim.Common.ServiceHelper.DeserializeFromBytes <SysUser[]>(ws.USService.GetSystemData("<container><parameters><parameter Name='SessionID'></parameter><parameter Name='Operation'>getonlineusers</parameter></parameters></container>")); PageState.Add("AbsenceApplyList", users); }