日期:2014-05-17 浏览次数:20809 次
private static T GetParametersValue<T>(string paraname, object defaultvalue)
{
if (HttpContext.Current.Session == null)
{
DataTable dt_para = new SDERP.BLL.SysManage.Sys_Parameters().GetList("PID='" + paraname + "'");
if (dt_para.Rows.Count != 0)
HttpContext.Current.Session = dt_para.Rows;
else
HttpContext.Current.Session = defaultvalue;
}
if (typeof(T) == typeof(bool))
{
return (T)((object)(Convert.ToInt32(HttpContext.Current.Session.ToString()) == 1));
}
else
return (T)HttpContext.Current.Session[paraname];
}