public JsonResult ChangeTeacher(string data, int code) { try { CookieModel modelssss = new CookieModel(); if (string.IsNullOrEmpty(modelssss.UserCookieID) && string.IsNullOrEmpty(modelssss.UserCookieName) && string.IsNullOrEmpty(modelssss.UserCookiePwd)) { return(new JsonResult() { Data = new { code = 10002, result = 0, message = "权限已过期" } }); } ViewTeacher_bll viewTeacherBll = new ViewTeacher_bll(); JsonResult jr = new JsonResult(); bool result = viewTeacherBll.Operation(data, code); if (result) { jr.Data = new { code = 10000, result = true, message = "修改成功!" }; } else { jr.Data = new { code = 10001, result = false, message = "修改失败!" }; } return(jr); } catch (Exception ex) { FileHelper.Log("Admin", ex.Message, ""); throw; } }
public JsonResult GetCheckTimeByClass(Info_Schedule model) { CookieModel modelssss = new CookieModel(); if (string.IsNullOrEmpty(modelssss.UserCookieID) && string.IsNullOrEmpty(modelssss.UserCookieName) && string.IsNullOrEmpty(modelssss.UserCookiePwd)) { return(new JsonResult() { Data = new { code = 10002, result = 0, message = "权限已过期" } }); } InfoSchedule_bll infoSchedulebll = new InfoSchedule_bll(); JsonResult jr = new JsonResult(); List <Info_Schedule> schedulelist = infoSchedulebll.GetList(model.ScheduleType).ToList(); if (schedulelist.Count != 0) { jr.Data = new { code = 10000, result = true, message = "查询成功!", data = schedulelist.ToList() }; } else { jr.Data = new { code = 10001, result = false, message = "服务器连接超时!" }; } return(jr); }
public JsonResult GetCheckWorkByStudent(string _search, int currentPage = 1, int PageSize = 10) { CookieModel modelssss = new CookieModel(); if (string.IsNullOrEmpty(modelssss.UserCookieID) && string.IsNullOrEmpty(modelssss.UserCookieName) && string.IsNullOrEmpty(modelssss.UserCookiePwd)) { return(new JsonResult() { Data = new { code = 10002, result = 0, message = "权限已过期" } }); } ViewAttendance_bll viewattendanceBll = new ViewAttendance_bll(); JsonResult jr = new JsonResult(); List <V_S_T_C> attendanceList = viewattendanceBll.GetList(_search).ToList(); attendanceList.Skip((currentPage - 1) * PageSize).Take(PageSize).ToList(); if (attendanceList.Count != 0) { jr.Data = new { code = 10000, result = true, message = "查询成功!", data = attendanceList.ToList() }; } else { jr.Data = new { code = 10001, result = false, message = "查询失败!" }; } return(jr); }
/// <summary> /// 保存登录状态 /// </summary> /// <param name="m">参见CookieModel</param> public static void SaveLoginState(CookieModel m) { ClearLoginState(); string str = ""; str += ClsStr.EncryptA01(m.UID, "DKIDLEKD") + ","; str += ClsStr.EncryptA01(m.userName, "DKIDLEKD") + ","; str += ClsStr.EncryptA01(m.trueName, "DKIDLEKD") + ","; str = ClsStr.EncryptA01(str, "LOKUDJIE"); System.Web.HttpContext.Current.Session["SpringerSystemSession"] = str; if (m.SaveType == "false") { } else { HttpCookie _cookie = new HttpCookie("SpringerSystem"); switch (m.SaveType) { case "true": _cookie.Expires = DateTime.Now.AddYears(1); //.AddDays(1); break; default: _cookie.Expires = DateTime.Now.AddMinutes(10); //.AddYears(1);//.AddMinutes(10);//保存10分钟 break; } _cookie.Values.Add("SpringerSystemCookie", str); HttpContext.Current.Response.Cookies.Add(_cookie); } }
/// <summary> /// 图层控制 /// </summary> /// <returns></returns> public ActionResult Tckz() { CookieModel cookieInfo = SystemCls.getCookieInfo(); ViewBag.LAYERNAME = T_SYS_LAYERCls.getLayerNameStr(new T_SYS_LAYER_SW { USERID = cookieInfo.UID }); ViewBag.DEFAULTCH = T_SYS_LAYERCls.getLayerDEFAULTCHStr(new T_SYS_LAYER_SW { USERID = cookieInfo.UID }); ViewBag.LAYERCODE = T_SYS_LAYERCls.getLayerLAYERCODEStr(new T_SYS_LAYER_SW { USERID = cookieInfo.UID }); ViewBag.YEAR = T_SYS_LAYERCls.getLayerYEAR();//从空间库获取火情档案的年份 var model = new List <EHCurFireMode>(); //string result = T_SYS_LAYERCls.getTree(new T_SYS_LAYER_SW { USERID = cookieInfo.UID });//普通方法取图层 string result = T_SYS_LAYERCls.getTckzTree(new T_SYS_LAYER_SW { USERID = cookieInfo.UID }); //递归方法取图层 ViewBag.TreeData = result; string resultChecked = T_SYS_LAYERCls.getTckzTreeChecked(new T_SYS_LAYER_SW { USERID = cookieInfo.UID }); ViewBag.TreeDataChe = resultChecked; return(View(model)); }
public JsonResult GetTeacherLocationList(string TeacherName) { CookieModel modelssss = new CookieModel(); if (string.IsNullOrEmpty(modelssss.UserCookieID) && string.IsNullOrEmpty(modelssss.UserCookieName) && string.IsNullOrEmpty(modelssss.UserCookiePwd)) { return(new JsonResult() { Data = new { code = 10002, result = 0, message = "权限已过期" } }); } ViewLocation_bll viewLocationBll = new ViewLocation_bll(); JsonResult jr = new JsonResult(); List <V_L_T> locationlist = viewLocationBll.GetTeaLocList(TeacherName).ToList(); if (locationlist.Count != 0) { jr.Data = new { code = 10000, result = true, message = "查询成功!", data = locationlist.ToList() }; } else { jr.Data = new { code = 10001, result = false, message = "查询失败!" }; } return(jr); }
private void MoocWebBrowser_DocumentCompleted(object sender, Gecko.Events.GeckoDocumentCompletedEventArgs e) { var cookies = CookieManager.GetCookiesFromHost(MoocWebBrowser.Url.Host); while (cookies.MoveNext()) { var cookie = new CookieModel { CreationTime = cookies.Current?.CreationTime, Expiry = cookies.Current?.Expiry, Host = cookies.Current?.Host, IsDomain = cookies.Current?.IsDomain, IsHttpOnly = cookies.Current?.IsHttpOnly, IsSecure = cookies.Current?.IsSecure, IsSession = cookies.Current?.IsSession, LastAccessed = cookies.Current?.LastAccessed, Name = cookies.Current?.Name, Path = cookies.Current?.Path, RawHost = cookies.Current?.RawHost, Value = cookies.Current?.Value, }; if (Cookies.All(c => c.Name != cookie.Name)) { Cookies.Add(cookie); } } // Close the current window when the cookies is obtained. if (_cookieKeys.Any(key => Cookies.Exists(c => c.Name == key))) { Close(); DialogResult = DialogResult.OK; } }
public bool IsLogin() { string CookieValue = ReadCookie(); if (!string.IsNullOrEmpty(CookieValue)) { string CookieDEVal = DES.Decrypt(CookieValue); try { CookieModel cm = Newtonsoft.Json.JsonConvert.DeserializeObject <CookieModel>(CookieDEVal); var entity = Trans.Db.Data.NUser_Info.Get("UserName=@UserName AND UserId=@UserId AND Status=1 AND IsDel=0", "", new object[] { cm.USERNAME, cm.USERID }); if (entity != null && entity.UserId > 0) { this.OpUser = entity; int CookieExpireMinutes = 0; if (!int.TryParse(CookieMinutes, out CookieExpireMinutes)) { CookieExpireMinutes = 30; } System.Web.HttpContext.Current.Response.Cookies[CookieName].Domain = CookieDomain; System.Web.HttpContext.Current.Response.Cookies[CookieName].Expires = DateTime.Now.AddMinutes(CookieExpireMinutes); System.Web.HttpContext.Current.Response.Cookies[CookieName].Value = CookieValue; return(true); } } catch (Exception ex) { Console.WriteLine(ex.Message); } } return(false); }
public JsonResult GetCurriculumList() { CookieModel modelssss = new CookieModel(); if (string.IsNullOrEmpty(modelssss.UserCookieID) && string.IsNullOrEmpty(modelssss.UserCookieName) && string.IsNullOrEmpty(modelssss.UserCookiePwd)) { return(new JsonResult() { Data = new { code = 10002, result = 0, message = "权限已过期" } }); } ViewCurriculum_bll viewCurriculumBll = new ViewCurriculum_bll(); JsonResult jr = new JsonResult(); List <V_C_S_C> curriculumList = viewCurriculumBll.GetList().ToList(); if (curriculumList.Count != 0) { jr.Data = new { code = 10000, result = true, message = "查询成功!", data = curriculumList.ToList() }; } else { jr.Data = new { code = 10001, result = false, message = "查询失败!" }; } return(jr); }
public JsonResult ChangeLeave(string state, int num) { try { CookieModel modelssss = new CookieModel(); if (string.IsNullOrEmpty(modelssss.UserCookieID) && string.IsNullOrEmpty(modelssss.UserCookieName) && string.IsNullOrEmpty(modelssss.UserCookiePwd)) { return(new JsonResult() { Data = new { code = 10002, result = 0, message = "权限已过期" } }); } InfoLeave_bll infoLeaveBll = new InfoLeave_bll(); JsonResult jr = new JsonResult(); bool result = infoLeaveBll.Edit(state, num); if (result) { jr.Data = new { code = 10000, result = true, message = "修改成功!" }; } else { jr.Data = new { code = 10001, result = false, message = "修改失败!" }; } return(jr); } catch (Exception ex) { FileHelper.Log("Admin", ex.Message, ""); throw; } }
public string getHeadMenuStr3(string menuCodeList) { string PageCode = Request.Params["PageCode"];//调用方法 var result = T_SYS_MENUCls.getT_SYS_MENUModel(new T_SYS_MENU_SW { UID = SystemCls.getUserID(), SYSFLAG = ConfigCls.getSystemFlag() }); StringBuilder sb = new StringBuilder(); sb.AppendFormat("<ul class='nav ace-nav'>"); sb.AppendFormat("<li class='light-blue'>"); sb.AppendFormat("<a href='{0}' class='dropdown-toggle'>", ConfigCls.getLoginRedirectUrl()); sb.AppendFormat("<i class='{0}' style='width:25px; {1}'></i>", "fa fa-wrench", "color:#ff0000;"); sb.AppendFormat("{0}", "返回首页"); sb.AppendFormat("</a>"); sb.AppendFormat("</li>"); foreach (var v in result) { if (menuCodeList.Contains("," + v.MENUCODE + ",")) { var subResult = v.subMenuModel; foreach (var sv in subResult) { sb.AppendFormat("<li>"); sb.AppendFormat("<a href='{0}'>", sv.MENUURL); sb.AppendFormat("<i class='{0}' style='width:25px; {1}'></i>", sv.MENUICO, sv.LICLASS); sb.AppendFormat("{0}", sv.MENUNAME); if (string.IsNullOrEmpty(sv.showCount) == false) { sb.AppendFormat("<span class='badge badge-important'>{0}</span>", sv.showCount); } sb.AppendFormat("</a>"); sb.AppendFormat("</li>"); } } } sb.AppendFormat("<li class='light-blue'>"); sb.AppendFormat("<a data-toggle='dropdown' href='#' class='dropdown-toggle'>"); sb.AppendFormat(" <img class='nav-user-photo' src='../Content/themes/assets/avatars/user.jpg' alt='Jason's Photo' />"); sb.AppendFormat(" <span class='user-info'>"); sb.AppendFormat(" <small>欢迎光临,</small>"); CookieModel cookieInfo = SystemCls.getCookieInfo(); sb.AppendFormat(" <font color='red'>{0}</font>", cookieInfo.trueName); sb.AppendFormat(" </span>"); sb.AppendFormat("<i class='icon-caret-down'></i>"); sb.AppendFormat(" </a>"); sb.AppendFormat("<ul class='user-menu pull-right dropdown-menu dropdown-yellow dropdown-caret dropdown-close'>"); sb.AppendFormat(" <li class='divider'></li>"); sb.AppendFormat(" <li>"); sb.AppendFormat(" <a href='/System/LoginOut'>"); sb.AppendFormat(" <i class='fa fa-power-off'></i>"); sb.AppendFormat(" 退出"); sb.AppendFormat(" </a>"); sb.AppendFormat(" </li>"); sb.AppendFormat("</ul>"); sb.AppendFormat("</li>"); sb.AppendFormat("</ul>"); return(sb.ToString()); }
static public CookieModel check(HttpCookie cookie) { var result = new CookieModel(); if (cookie == null) { result.Status = cookieStatus.noCookie; return(result); } var ticket = FormsAuthentication.Decrypt(cookie.Value); if (ticket.UserData == "12345") { result.Authority = Character.Customer; result.Status = cookieStatus.Match; result.Username = ticket.Name; } else if (ticket.UserData == "員工") { result.Authority = Character.Employee; result.Status = cookieStatus.Match; result.Username = ticket.Name; } return(result); }
public async Task <IRestResponse> GetIcalAsync(CookieModel cookies, int months) { var request = new RestRequest(Method.POST); string now = DateTimeOffset.Now.ToString("yyyy-MM-dd"); int due = months < options.MaxMonths ? months : options.MaxMonths; string stop = DateTimeOffset.Now.AddMonths(due).ToString("yyyy-MM-dd"); request.AddHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8"); request.AddHeader("Cookie", cookies.Token); request.AddParameter("StartString", now); request.AddParameter("StopString", stop); request.AddParameter("ShowWork", "true"); request.AddParameter("ShowAbs", "true"); request.AddParameter("ShowApp", "true"); request.AddParameter("ShowTCall", "true"); request.AddParameter("ShowTaskWeekComments", "true"); request.AddParameter("ShowTaskWeekStaffComments", "true"); request.AddParameter("ShowWeekStaff", "true"); request.AddParameter("__RequestVerificationToken", cookies.VerificationToken); IRestResponse response = await client.ExecuteAsync(request); return(response); }
/// <summary> /// 获取通信内容 /// </summary> /// <param name="config"></param> /// <returns></returns> public static ProtocolInfo GetProtocolInfo(XsConfig config, bool monitor = false) { ProtocolInfo pinfo = null; CookieModel cmodel = null; if (config.Cookies.Length > 0) { pinfo = new ProtocolInfo(); cmodel = config.Cookies[0]; pinfo.Url = cmodel.Url; string strParam = GetParam(config); if (cmodel.Method.ToUpper() == "POST") { pinfo.Method = ProtocolMethod.Post; pinfo.Url += "/api/game-lottery/static-open-code"; pinfo.Data = "name=qqmin&history=true"; } else { pinfo.Method = ProtocolMethod.Get; pinfo.Url += "/newgame_play.shtml?curmid=2660&flag=getopencodes"; //pinfo.Url += "/newgame_play.shtml?curmid=2660"; } } return(pinfo); }
public JsonResult GetTeacherByList(string _search, Info_Leave model, int currentPage = 1, int PageSize = 10) { CookieModel modelssss = new CookieModel(); if (string.IsNullOrEmpty(modelssss.UserCookieID) && string.IsNullOrEmpty(modelssss.UserCookieName) && string.IsNullOrEmpty(modelssss.UserCookiePwd)) { return(new JsonResult() { Data = new { code = 10002, result = 0, message = "权限已过期" } }); } ViewTeacher_bll viewteacherbll = new ViewTeacher_bll(); JsonResult jr = new JsonResult(); List <V_T_C_N> teacherlist = viewteacherbll.GetList(_search).ToList(); teacherlist.Skip((currentPage - 1) * PageSize).Take(PageSize).ToList(); if (teacherlist.Count != 0) { jr.Data = new { code = 10000, result = true, message = "查询成功!", data = teacherlist.ToList() }; } else { jr.Data = new { code = 10001, result = false, message = "查询失败!" }; } return(jr); }
/// <summary> /// 获取用户登录信息 /// </summary> /// <returns>用户登录信息 参见CookieModel</returns> public static CookieModel getCookieInfo() { CookieModel model = new CookieModel(); string cookieStr = ""; if (System.Web.HttpContext.Current.Session["SpringerSystemSession"] != null) { cookieStr = System.Web.HttpContext.Current.Session["SpringerSystemSession"].ToString(); } HttpCookie cookies = HttpContext.Current.Request.Cookies["SpringerSystem"]; if (string.IsNullOrEmpty(cookieStr) && cookies != null) { cookieStr = cookies["SpringerSystemCookie"]; } //if (HttpContext.Current.Request.Cookies["SpringerSystem"] != null) //{ // cookieStr = HttpContext.Current.Request.Cookies["SpringerSystem"]["SpringerSystemCookie"]; //} if (!string.IsNullOrEmpty(cookieStr)) { string[] arr = ClsStr.DecryptA01(cookieStr, "LOKUDJIE").Split(','); model.UID = ClsStr.DecryptA01(arr[0], "DKIDLEKD"); model.userName = ClsStr.DecryptA01(arr[1], "DKIDLEKD"); model.trueName = ClsStr.DecryptA01(arr[2], "DKIDLEKD"); } else { model.UID = ""; model.userName = ""; model.trueName = ""; } return(model); }
/// <summary> /// 设置Cookie /// </summary> /// <param name="lt_cookie"></param> public static CookieContainer GetCookies(CookieModel cookieMode) { CookieContainer cookieContainer = new CookieContainer(); CookieCollection cookieCollection = new CookieCollection(); if (cookieMode != null) { string strCookies = cookieMode.Cookies.Trim(); var lt_cookies = strCookies.Split(';').ToList(); lt_cookies.ForEach(item => { int index = item.IndexOf('='); string cookieName = item.Substring(0, index).Trim(); string cookieValue = item.Substring(index + 1).Trim(); try { cookieCollection.Add(new Cookie(cookieName, cookieValue, cookieMode.CookiePath, cookieMode.DomainName)); } catch (Exception er) { } }); } cookieContainer.Add(cookieCollection); return(cookieContainer); }
/// <summary> /// 获取OA报件href /// </summary> /// <param name="cookieInfo">用户Cookie信息</param> /// <param name="kqhref">考勤href</param> /// <param name="dbhref">待办href</param> /// <param name="dxhref">短信href</param> /// <param name="target">页面跳转方式</param> private static void GetOAInfohref(CookieModel cookieInfo, out string kqhref, out string dbhref, out string dxhref, out string target) { kqhref = ConfigCls.getOAAddress() + "/Portal/AutoLogin/Login/login.aspx?userid=" + cookieInfo.UID + "&menuid=6685"; dbhref = ConfigCls.getOAAddress() + "/Portal/AutoLogin/Login/login.aspx?userid=" + cookieInfo.UID + "&menuid=66666666"; dxhref = ConfigCls.getOAAddress() + "/Portal/AutoLogin/Login/login.aspx?userid=" + cookieInfo.UID + "&menuid=21148999"; target = "_blank"; }
public void OnActionExecuting(ActionExecutingContext context) { bool skipAuthorization = context.Filters.Any(item => item is IAllowAnonymousFilter); if (skipAuthorization) { return; } string val = context.HttpContext.Session.GetString("CookieData"); CookieModel Cookies = val != null?JsonConvert.DeserializeObject <CookieModel>(val) : new CookieModel(); string actionName = context.RouteData.Values["action"].ToString(); string controllerName = context.RouteData.Values["controller"].ToString(); string access = "/" + controllerName + "/" + actionName; if (access == "/Account/Login" || access == "/Account/Logout") { return; } string AppUrl = MyHttpContext.AppBaseUrl; string data = Cookies.Access; if (data != null) { List <Navigation> Access = JsonConvert.DeserializeObject <List <Navigation> >(data); Navigation check = Access.Find(x => x.URL == access); if (check == null) { context.Result = new RedirectResult("" + AppUrl + "/Account/AccessDenied"); } } }
public ActionResult Home() { CookieModel cookie = new CookieModel(); var context = new SitecoreContext(); cookie = context.GetItem <CookieModel>(RenderingContext.Current.Rendering.DataSource); return(View(cookie)); }
/// <summary> /// 图层控制树图层Json /// </summary> /// <returns></returns> public ActionResult TckzJson() { CookieModel cookieInfo = SystemCls.getCookieInfo(); string result = T_SYS_LAYERCls.getTree(new T_SYS_LAYER_SW { USERID = cookieInfo.UID }); return(Content(result, "application/json")); }
/// <summary> /// 三维定位--预警监测 /// </summary> /// <returns></returns> public ActionResult From2Dto3D() { CookieModel cookieInfo1 = SystemCls.getCookieInfo(); ViewBag.LAYERNAME = T_SYS_LAYERCls.getLayerNameStr(new T_SYS_LAYER_SW { USERID = cookieInfo1.UID }); ViewBag.DEFAULTCH = T_SYS_LAYERCls.getLayerDEFAULTCHStr(new T_SYS_LAYER_SW { USERID = cookieInfo1.UID }); ViewBag.AllNAME = T_SYS_LAYERCls.getLayerAllNAME(); var result = new List <MapShowModel>(); var sw = new JC_FIRE_SW(); string jcfid = Request.Params["jcfid"]; if (!string.IsNullOrEmpty(jcfid)) { ViewBag.strjcfid = jcfid; var ss = jcfid.Split(','); if (ss.Length == 1) { sw.JCFID = jcfid; } else { sw.JCFIDSTR = jcfid; } } var list = JC_FIRECls.GetListModel(sw); if (list.Any()) { foreach (var item in list) { //var info = JC_FIRETICKLINGCls.GetFKFireInfoData(item.JCFID); var fklist = GetFKInfoList(item.JCFID); var recordlist = fklist.Select(p => p.MANSTATE).ToList();//MANSTATE状态集合 var model = new MapShowModel(); model.JCFID = item.JCFID; model.AREA = item.ZQWZ; model.BH = item.WXBH; if (Convert.ToInt32(item.MANSTATE) > 10)//大于10 说明已经入反馈阶段有顺序 { model.FKSTATE = StateSwitch.QSStateNew(SystemCls.getCurUserOrgNo(), item.MANSTATE); } else//签收无顺序性 状态判断是否反馈表包含 签到状态 1 市 2 县 3 乡镇 { model.FKSTATE = StateSwitch.QSStateNewList(SystemCls.getCurUserOrgNo(), recordlist); } //model.FKSTATE = StateSwitch.QSStateNew(SystemCls.getCurUserOrgNo(), info.JC_FireFKData.MANSTATE); result.Add(model); } } return(View(result)); }
public SesionVal(CookieModel cookie) { _sesionCount = 0; foreach (var val in _sesRet.GetAll()) { _sesionCount++; } _cookie = cookie; _sesion = _sesRet.GetById(_cookie.Key); }
public void can_bind_to_request_cookies() { var model = new CookieModel{ Color = "Green", Direction = "South" }; TestApplication.Endpoints.GetByInput(model, configure: SetupCookies).ReadAsText() .ShouldEqual(model.ToString()); }
public ActionResult Index(CookieModel model) { HttpCookie cookie = new HttpCookie("CookieTest"); cookie.Values["Name"] = model.Name; Session["CookieTestName"] = model.Name; cookie.Expires = DateTime.UtcNow.AddDays(300); Response.Cookies.Set(cookie); return(View(model)); }
/// <summary> /// 页面公用ViewBag /// </summary> /// <param name="PageCode">页面编码(菜单编码)</param> /// <param name="RightCode">权限编码 用于页面级权限验证</param> /// <param name="PageTitle">页面标题 标题为空自动获取页面标题及上级页面标题</param> public void pubViewBag(string PageCode, string RightCode, string PageTitle) { CookieModel cookieInfo = SystemCls.getCookieInfo(); ViewBag.getPageMenuStr = getPageMenuStr(PageCode); ViewBag.PageCode = PageCode; string curORGNo = SystemCls.getCurUserOrgNo(); if (PublicCls.OrgIsShi(curORGNo)) { curORGNo = ConfigCls.getConfigValue("ProvincialCapital");//州府所在地行政区划编码 } //获取火险等级 ViewBag.fireLevel = YJ_DANGERCLASSCls.getLevelByOrgNo(new YJ_DANGERCLASS_SW { BYORGNO = curORGNo }); //获取滚动信息 if (T_SYS_PARAMETERCls.getValueByFlag(new T_SYS_PARAMETER_SW { PARAMFLAG = "LoginInfo" }).ToString() == "0") { ViewBag.marqueeSysInfo = T_SYS_PARAMETERCls.getValueByFlag(new T_SYS_PARAMETER_SW { PARAMFLAG = "marqueeIndexInfo" }).ToString(); } else { ViewBag.marqueeSysInfo = YJ_WEATHERCls.getWeather(new YJ_WEATHER_SW { BYORGNO = curORGNo }); } ViewBag.PageLeftMenu = getPageLeftMenu(PageCode); //左侧菜单 ViewBag.isPageRight = SystemCls.isRight(RightCode); //判断页面是否有权限 ViewBag.SystemName = ConfigCls.getSystemName(); //系统名称 ViewBag.noticeRefreshTimeInterval = ConfigCls.noticeRefreshTimeInterval(); //菜单自动刷新间隔 ViewBag.PageTitle = PageTitle; //如果页面标题为空,则自动通过页面编码从系统菜单表中获取菜单名称及上级菜单名称 if (string.IsNullOrEmpty(PageTitle)) { ViewBag.PageTitle = T_SYS_MENUCls.getModel(new T_SYS_MENU_SW { MENUCODE = PageCode, SYSFLAG = ConfigCls.getSystemFlag() }).MENUNAME; } ViewBag.Title = ConfigCls.getSystemName() + "-" + ViewBag.PageTitle; //Title名称 ViewBag.SystemLogo = ConfigCls.getSystemLogo(); //获取系统logo图片 ViewBag.trueName = cookieInfo.trueName; //当前登录用户姓名 ViewBag.TopFireAlarm = ConfigCls.getTopFireAlarm(); //是否火情报警 ViewBag.TopFireLevel = ConfigCls.getTopFireLevel(); //是否显示火险等级 ViewBag.depName = StateSwitch.GetOrgNameByOrgNO(SystemCls.getCurUserOrgNo()); //部门名称 string systemFlag = ConfigCls.getSystemFlag(); //系统标识 如Springer ViewBag.T_UrlReferrer = Request.UrlReferrer; }
protected bool IsAuthorized(CookieModel cookie) { List <CookieModel> cookies = new List <CookieModel>(); SesionVal.CleanSesiones(); foreach (var cook in _cookRet.GetAll()) { cookies.Add(cook); } return(cookies.Any(x => x.Value.Equals(cookie.Value) && x.Key.Equals(cookie.Key))); }
/// <summary> /// 获取用户ID /// </summary> /// <returns>用户ID</returns> public static string getUserID() { CookieModel cm = getCookieInfo(); if (ConfigCls.getIsSaveLastOpTime() != "0" && string.IsNullOrEmpty(cm.UID) == false)//需要判断用户在线状态 { //更改该用户最后操作时间 T_SYSSEC_IPSUSER_Model m = new T_SYSSEC_IPSUSER_Model { USERID = cm.UID, opMethod = "MdyLastOpTime" }; T_SYSSEC_IPSUSERCls.Manager(m); } return(cm.UID); }
public override void OnActionExecuting(ActionExecutingContext filterContext) { string val = filterContext.HttpContext.Session.GetString("CookieData"); CookieModel Cookies = val != null?JsonConvert.DeserializeObject <CookieModel>(val) : new CookieModel(); string AppUrl = MyHttpContext.AppBaseUrl; if (val == null) { filterContext.Result = new RedirectResult(AppUrl); return; } base.OnActionExecuting(filterContext); }
public CookieModel GetSession() { CookieModel Cookies = new CookieModel(); try { string val = HttpContext.Session.GetString("CookieData"); Cookies = JsonConvert.DeserializeObject <CookieModel>(val); } catch (NullReferenceException) { Cookies = new CookieModel(); } return(Cookies); }
/// <summary> /// 生成地图图片 /// </summary> /// <returns></returns> public ActionResult GenerateImages() { CookieModel cookieInfo = SystemCls.getCookieInfo(); var model = T_SYSSEC_IPSUSERCls.getModel(new T_SYSSEC_IPSUSER_SW { USERID = cookieInfo.UID }); var modelOrg = T_SYS_ORGCls.getModel(new T_SYS_ORGSW { ORGNO = model.ORGNO }); ViewBag.DEPT = modelOrg.ORGNAME + modelOrg.COMMANDNAME; ViewBag.NAME = cookieInfo.trueName; ViewBag.TIME = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); return(View()); }
public string get_cookie_data(CookieModel input) { return input.ToString(); }