📄 hradminglobals.cs
字号:
using System;
using System.Configuration;
using System.Collections.Specialized ;
using System.Web;
using System.Collections;
using System.Web.SessionState;
using System.Data;
using System.IO;
using System.Threading;
using HRAdmin.BLL ;
namespace HRAdmin.COMMON
{
/// <summary>
///
/// PMAdminGlobals类包含该解决方案通用的公共变量
///
/// </summary>
public class HRAdminGlobals
{
//***********************************************************************
//
//属性 数据库连接字串,只读
//
//从web.config文件获取数据库连接字串
//
//***********************************************************************
public static string ConnectionString
{
get
{
NameValueCollection nvc = (NameValueCollection)
ConfigurationSettings.GetConfig("HRAdmin/database");
return nvc[ "connectionString" ];
}
}
//***********************************************************************
//
//属性 日志文件路径,只读
//
//从web.config读取日志文件路径
//
//***********************************************************************
public static string TraceFilePath
{
get
{
NameValueCollection nvc = (NameValueCollection)
ConfigurationSettings.GetConfig("HRAdmin/tracefile");
return nvc[ "traceFilePath" ];
}
}
//***********************************************************************
//
//属性 系统配置文件路径,只读
//
//该路径固定
//
//***********************************************************************
/// <summary>
/// 系统配置文件路径,只读
/// </summary>
public static string ConfigFilePath
{
get
{
string configpath = "COMMON\\Configs\\" ;
string path = HttpRuntime.AppDomainAppPath ;
return path + configpath ;
}
}
#region Session中的内容
/// <summary>
/// 当前登录用户
/// </summary>
static public PersonnelInfo LoginUsr
{
get
{
HttpSessionState sess=HttpContext.Current.Session;
return (PersonnelInfo)sess["LoginUsr"];
}
set
{
HttpSessionState sess=HttpContext.Current.Session;
if (value ==null)
sess.Remove("LoginUsr");
else
sess["LoginUsr"]=value;
}
}
#endregion
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -