/// <summary> /// 判断是否登录成功 /// </summary> /// <returns></returns> private bool Is_Login() { int userguid = 0; bool f = true; if (CookieManage2.IsHaveCookie()) { userguid = Convert.ToInt32(CookieManage2.GetCookieValue()); if (user_bll_h.Exists(userguid)) { //结束时间 DateTime end_time = CookieManage2.GetCookieValue(2); //判断是否已经过期 if (!TimeParser.IsMoreSevenDays(DateTime.Now, end_time)) { f = false; } else { f = true; } } else { f = false; } } else { f = false; } return(f); }
/// <summary> /// 取得当前登录ID /// </summary> /// <returns></returns> public void GetUserID() { if (Is_Login()) { if (!String.IsNullOrEmpty(CookieManage2.GetCookieValue())) { UserID = Convert.ToInt32(CookieManage2.GetCookieValue()); } } }
/// <summary> /// 获取当前登录用户的ID,红人议会 /// </summary> /// <returns></returns> private int GetCurUserID() { int user_id = 0; if (Is_Logins()) { if (!String.IsNullOrEmpty(CookieManage2.GetCookieValue())) { user_id = Convert.ToInt32(CookieManage2.GetCookieValue()); } } return(user_id); }