河北专项检查和移动端

This commit is contained in:
2025-04-06 23:26:22 +08:00
parent 64c7be5db4
commit 8aba5b01bc
204 changed files with 41904 additions and 3226 deletions
+255 -255
View File
@@ -59,289 +59,289 @@ namespace FineUIPro.Web
}
}
#region OnInit
//#region OnInit
protected override void OnInit(EventArgs e)
{
if (Session["CurrUser"] == null && !Request.Path.Contains("/Login.aspx") && !Request.Path.Contains("DataShow"))
{
string ticket = Request.Params["ticket"];
if (!string.IsNullOrEmpty(ticket))
{
string jsonCameras = APIGetHttpService.Http("https://cas.china-tcc.com/cas/serviceValidate?service=https://tccsg.cntcc.cn:17001/sggl/indexProject.aspx&ticket=" + ticket);
// protected override void OnInit(EventArgs e)
//{
// if (Session["CurrUser"] == null && !Request.Path.Contains("/Login.aspx") && !Request.Path.Contains("DataShow"))
// {
// string ticket = Request.Params["ticket"];
// if (!string.IsNullOrEmpty(ticket))
// {
// string jsonCameras = APIGetHttpService.Http("https://cas.china-tcc.com/cas/serviceValidate?service=https://tccsg.cntcc.cn:17001/sggl/indexProject.aspx&ticket=" + ticket);
XmlDocument xml = new XmlDocument();
xml.LoadXml(jsonCameras);
XmlElement root = xml.DocumentElement;
XmlNode node = root.ChildNodes[0];//遍历输出.
if (node.LocalName == "authenticationSuccess")
{
string user = node.ChildNodes[0].InnerText;//InnerText节点包合的所有文本内容
//if ("zyk" == user)
//{
// user = "hfnbd";
//}
Model.Sys_User sysUser = (from y in Funs.DB.Sys_User
where (y.DomainAccount == user || y.Account ==user) && y.IsPost == true
select y).FirstOrDefault();
if (user != null)
{
string accValue = HttpUtility.UrlEncode(user);
FormsAuthentication.SetAuthCookie(accValue, false);
Page.Session[SessionName.CurrUser] = sysUser;
string url = "";
this.CurrUser.RoleType = RoleService.GetRoleTypeByRoleId(this.CurrUser.RoleId);
if (!this.CurrUser.LastIsOffice.HasValue)
{
this.CurrUser.LastIsOffice = this.CurrUser.IsOffice;
}
if (this.CurrUser.LastIsOffice == true)
{
this.CurrUser.LoginProjectId = null;
////本部菜单
url = "index.aspx";
}
else
{
this.CurrUser.LoginProjectId = this.CurrUser.LastProjectId;
//// 项目菜单
url = "indexProject.aspx?projectId=" + this.CurrUser.LastProjectId;
}
this.SysType = "GONGCHENG";
Response.Redirect(url);
}
else
{
Response.Redirect("Login.aspx");
}
}
}
else
{
Response.Redirect("https://cas.china-tcc.com/cas/login?service=https://tccsg.cntcc.cn:17001/sggl/indexProject.aspx");
// XmlDocument xml = new XmlDocument();
// xml.LoadXml(jsonCameras);
// XmlElement root = xml.DocumentElement;
// XmlNode node = root.ChildNodes[0];//遍历输出.
// if (node.LocalName == "authenticationSuccess")
// {
// string user = node.ChildNodes[0].InnerText;//InnerText节点包合的所有文本内容
// //if ("zyk" == user)
// //{
// // user = "hfnbd";
// //}
// Model.Sys_User sysUser = (from y in Funs.DB.Sys_User
// where (y.DomainAccount == user || y.Account ==user) && y.IsPost == true
// select y).FirstOrDefault();
// if (user != null)
// {
// string accValue = HttpUtility.UrlEncode(user);
// FormsAuthentication.SetAuthCookie(accValue, false);
// Page.Session[SessionName.CurrUser] = sysUser;
// string url = "";
// this.CurrUser.RoleType = RoleService.GetRoleTypeByRoleId(this.CurrUser.RoleId);
// if (!this.CurrUser.LastIsOffice.HasValue)
// {
// this.CurrUser.LastIsOffice = this.CurrUser.IsOffice;
// }
// if (this.CurrUser.LastIsOffice == true)
// {
// this.CurrUser.LoginProjectId = null;
// ////本部菜单
// url = "index.aspx";
// }
// else
// {
// this.CurrUser.LoginProjectId = this.CurrUser.LastProjectId;
// //// 项目菜单
// url = "indexProject.aspx?projectId=" + this.CurrUser.LastProjectId;
// }
// this.SysType = "GONGCHENG";
// Response.Redirect(url);
// }
// else
// {
// Response.Redirect("Login.aspx");
// }
// }
// }
// else
// {
// Response.Redirect("https://cas.china-tcc.com/cas/login?service=https://tccsg.cntcc.cn:17001/sggl/indexProject.aspx");
}
}
var pm = PageManager.Instance;
if (pm != null)
{
HttpCookie themeCookie = Request.Cookies["Theme"];
if (themeCookie != null)
{
string themeValue = themeCookie.Value;
if (themeValue != "Cupertino")
{
themeValue = "Cupertino";
Response.Cookies.Remove("Theme");
HttpCookie cookie = new HttpCookie("Theme", themeValue)
{
Expires = DateTime.Now.AddYears(1)
};
// }
// }
// var pm = PageManager.Instance;
// if (pm != null)
// {
// HttpCookie themeCookie = Request.Cookies["Theme"];
// if (themeCookie != null)
// {
// string themeValue = themeCookie.Value;
// if (themeValue != "Cupertino")
// {
// themeValue = "Cupertino";
// Response.Cookies.Remove("Theme");
// HttpCookie cookie = new HttpCookie("Theme", themeValue)
// {
// Expires = DateTime.Now.AddYears(1)
// };
Response.Cookies.Add(cookie);
}
// 是否为内置主题
if (IsSystemTheme(themeValue))
{
pm.CustomTheme = String.Empty;
pm.Theme = (Theme)Enum.Parse(typeof(Theme), themeValue, true);
}
else
{
pm.CustomTheme = themeValue;
}
}
// Response.Cookies.Add(cookie);
// }
// // 是否为内置主题
// if (IsSystemTheme(themeValue))
// {
// pm.CustomTheme = String.Empty;
// pm.Theme = (Theme)Enum.Parse(typeof(Theme), themeValue, true);
// }
// else
// {
// pm.CustomTheme = themeValue;
// }
// }
HttpCookie langCookie = Request.Cookies["Language"];
if (langCookie != null)
{
string langValue = langCookie.Value;
try
{
// 是否为内置语言
pm.Language = (Language)Enum.Parse(typeof(Language), langValue, true);
}
catch (Exception)
{
pm.CustomLanguage = langValue;
}
}
// HttpCookie langCookie = Request.Cookies["Language"];
// if (langCookie != null)
// {
// string langValue = langCookie.Value;
// try
// {
// // 是否为内置语言
// pm.Language = (Language)Enum.Parse(typeof(Language), langValue, true);
// }
// catch (Exception)
// {
// pm.CustomLanguage = langValue;
// }
// }
// 1. 仅显示基础版示例, 2. 基础版
// 上述两种情况都要禁用EnableAnimation、DisplayMode、MobileAdaption
bool showOnlyBase = false;
HttpCookie menuShowOnlyBase = Request.Cookies["ShowOnlyBase"];
if (menuShowOnlyBase != null)
{
showOnlyBase = Convert.ToBoolean(menuShowOnlyBase.Value);
}
// // 1. 仅显示基础版示例, 2. 基础版
// // 上述两种情况都要禁用EnableAnimation、DisplayMode、MobileAdaption
// bool showOnlyBase = false;
// HttpCookie menuShowOnlyBase = Request.Cookies["ShowOnlyBase"];
// if (menuShowOnlyBase != null)
// {
// showOnlyBase = Convert.ToBoolean(menuShowOnlyBase.Value);
// }
if (showOnlyBase || Constants.IS_BASE)
{
pm.EnableAnimation = false;
pm.DisplayMode = DisplayMode.Normal;
pm.MobileAdaption = false;
}
else
{
HttpCookie modeCookie = Request.Cookies["DisplayMode"];
if (modeCookie != null)
{
string modeValue = modeCookie.Value;
try
{
pm.DisplayMode = (DisplayMode)Enum.Parse(typeof(DisplayMode), modeValue, true);
}
catch (Exception)
{
pm.DisplayMode = DisplayMode.Normal;
}
}
}
// if (showOnlyBase || Constants.IS_BASE)
// {
// pm.EnableAnimation = false;
// pm.DisplayMode = DisplayMode.Normal;
// pm.MobileAdaption = false;
// }
// else
// {
// HttpCookie modeCookie = Request.Cookies["DisplayMode"];
// if (modeCookie != null)
// {
// string modeValue = modeCookie.Value;
// try
// {
// pm.DisplayMode = (DisplayMode)Enum.Parse(typeof(DisplayMode), modeValue, true);
// }
// catch (Exception)
// {
// pm.DisplayMode = DisplayMode.Normal;
// }
// }
// }
HttpCookie loadingCookie = Request.Cookies["Loading"];
if (loadingCookie != null)
{
int loadingNumber = Convert.ToInt32(loadingCookie.Value);
pm.LoadingImageNumber = loadingNumber;
}
// HttpCookie loadingCookie = Request.Cookies["Loading"];
// if (loadingCookie != null)
// {
// int loadingNumber = Convert.ToInt32(loadingCookie.Value);
// pm.LoadingImageNumber = loadingNumber;
// }
// SaveFStateToServer是页面上自定义的一个属性
if (SaveFStateToServer)
{
//// FState保存到服务器文件
//pm.EnableFStatePersistence = true;
//pm.LoadFStateFromPersistenceMedium = LoadFStateFromPersistenceMedium;
//pm.SaveFStateToPersistenceMedium = SaveFStateToPersistenceMedium;
// // SaveFStateToServer是页面上自定义的一个属性
// if (SaveFStateToServer)
// {
// //// FState保存到服务器文件
// //pm.EnableFStatePersistence = true;
// //pm.LoadFStateFromPersistenceMedium = LoadFStateFromPersistenceMedium;
// //pm.SaveFStateToPersistenceMedium = SaveFStateToPersistenceMedium;
//FState保存到服务器缓存
pm.EnableFStatePersistence = true;
pm.LoadFStateFromPersistenceMedium = LoadFStateFromPersistenceMedium_Cache;
pm.SaveFStateToPersistenceMedium = SaveFStateToPersistenceMedium_Cache;
}
// //FState保存到服务器缓存
// pm.EnableFStatePersistence = true;
// pm.LoadFStateFromPersistenceMedium = LoadFStateFromPersistenceMedium_Cache;
// pm.SaveFStateToPersistenceMedium = SaveFStateToPersistenceMedium_Cache;
// }
// 为所有页面添加公共CSS<link rel="stylesheet" type="text/css" href="res/css/common.css" />
System.Web.UI.HtmlControls.HtmlGenericControl linkCtrl = new System.Web.UI.HtmlControls.HtmlGenericControl("link");
linkCtrl.Attributes["rel"] = "stylesheet";
linkCtrl.Attributes["type"] = "text/css";
linkCtrl.Attributes["href"] = ResolveClientUrl("~/res/css/common.css?v" + GlobalConfig.ProductVersion);
Header.Controls.AddAt(GetHeadStyleCSSIndex(), linkCtrl);
// // 为所有页面添加公共CSS<link rel="stylesheet" type="text/css" href="res/css/common.css" />
// System.Web.UI.HtmlControls.HtmlGenericControl linkCtrl = new System.Web.UI.HtmlControls.HtmlGenericControl("link");
// linkCtrl.Attributes["rel"] = "stylesheet";
// linkCtrl.Attributes["type"] = "text/css";
// linkCtrl.Attributes["href"] = ResolveClientUrl("~/res/css/common.css?v" + GlobalConfig.ProductVersion);
// Header.Controls.AddAt(GetHeadStyleCSSIndex(), linkCtrl);
// 为所有页面添加公共JS<script type="text/css" href="res/js/common.js"></script>
var commonJSPath = String.Format("<script type=\"text/javascript\" src=\"{0}\"></script>", ResolveClientUrl("~/res/js/common.js?v" + GlobalConfig.ProductVersion));
PageContext.RegisterStartupScript("FineUIPro_Examples_common_js", commonJSPath, false);
// // 为所有页面添加公共JS<script type="text/css" href="res/js/common.js"></script>
// var commonJSPath = String.Format("<script type=\"text/javascript\" src=\"{0}\"></script>", ResolveClientUrl("~/res/js/common.js?v" + GlobalConfig.ProductVersion));
// PageContext.RegisterStartupScript("FineUIPro_Examples_common_js", commonJSPath, false);
//var jqueryMigrateJSPath = String.Format("<script type=\"text/javascript\" src=\"{0}\"></script>", ResolveClientUrl("~/res/js/jquery-migrate-3.0.1.js?v" + GlobalConfig.ProductVersion));
//PageContext.RegisterPreStartupScript("FineUIPro_Examples_jquery-migrate_js", jqueryMigrateJSPath, false);
// //var jqueryMigrateJSPath = String.Format("<script type=\"text/javascript\" src=\"{0}\"></script>", ResolveClientUrl("~/res/js/jquery-migrate-3.0.1.js?v" + GlobalConfig.ProductVersion));
// //PageContext.RegisterPreStartupScript("FineUIPro_Examples_jquery-migrate_js", jqueryMigrateJSPath, false);
// 禁用表单的自动完成功能
// v5.4.0 - 无需手工设置,每个表单字段的autoComplete默认为false
//Form.Attributes["autocomplete"] = "off";
}
// // 禁用表单的自动完成功能
// // v5.4.0 - 无需手工设置,每个表单字段的autoComplete默认为false
// //Form.Attributes["autocomplete"] = "off";
// }
this.Load += new EventHandler(this.PageBase_Load);
this.Unload += new EventHandler(this.PageBase_UNLoad);
base.OnInit(e);
}
// this.Load += new EventHandler(this.PageBase_Load);
// this.Unload += new EventHandler(this.PageBase_UNLoad);
// //base.OnInit(e);
// }
/// <summary>
/// 页面登录成功
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void PageBase_Load(object sender, EventArgs e)
{
//这是后置式的权限管理策略.
//页面装载完成以后才检查是否有权限打开此页....
//anyway,its ok.
// /// <summary>
// /// 页面登录成功
// /// </summary>
// /// <param name="sender"></param>
// /// <param name="e"></param>
// protected void PageBase_Load(object sender, EventArgs e)
// {
// //这是后置式的权限管理策略.
// //页面装载完成以后才检查是否有权限打开此页....
// //anyway,its ok.
this.Title = BLL.Funs.SystemName;
//if (CurrUser == null)
//{
// if (this.Page.Request.AppRelativeCurrentExecutionFilePath != "~/Login.aspx")
// Response.Redirect("~/Login.aspx");
//}
}
// this.Title = BLL.Funs.SystemName;
// //if (CurrUser == null)
// //{
// // if (this.Page.Request.AppRelativeCurrentExecutionFilePath != "~/Login.aspx")
// // Response.Redirect("~/Login.aspx");
// //}
// }
/// <summary>
/// UNLOAD事件,发生在页面装载顺序的最后。
/// 在这里处理的是DBLIST,数据库连接字典。
/// </summary>
/// <param name="sender">S</param>
/// <param name="e">E</param>
protected void PageBase_UNLoad(object sender, EventArgs e)
{
if (BLL.Funs.DBList.ContainsKey(System.Threading.Thread.CurrentThread.ManagedThreadId))
{
BLL.Funs.DBList.Remove(System.Threading.Thread.CurrentThread.ManagedThreadId);
}
}
// /// <summary>
// /// UNLOAD事件,发生在页面装载顺序的最后。
// /// 在这里处理的是DBLIST,数据库连接字典。
// /// </summary>
// /// <param name="sender">S</param>
// /// <param name="e">E</param>
// protected void PageBase_UNLoad(object sender, EventArgs e)
// {
// if (BLL.Funs.DBList.ContainsKey(System.Threading.Thread.CurrentThread.ManagedThreadId))
// {
// BLL.Funs.DBList.Remove(System.Threading.Thread.CurrentThread.ManagedThreadId);
// }
// }
private bool IsSystemTheme(string themeName)
{
themeName = themeName.ToLower();
string[] themes = Enum.GetNames(typeof(Theme));
foreach (string theme in themes)
{
if (theme.ToLower() == themeName)
{
return true;
}
}
return false;
}
// private bool IsSystemTheme(string themeName)
// {
// themeName = themeName.ToLower();
// string[] themes = Enum.GetNames(typeof(Theme));
// foreach (string theme in themes)
// {
// if (theme.ToLower() == themeName)
// {
// return true;
// }
// }
// return false;
// }
private int GetHeadStyleCSSIndex()
{
var theIndex = 0;
for (var i = 0; i < Header.Controls.Count; i++)
{
var ctrl = Header.Controls[i];
if (ctrl is LiteralControl)
{
if ((ctrl as LiteralControl).Text.Trim().ToLower().StartsWith("<style"))
{
theIndex = i;
break;
}
}
else if (ctrl is System.Web.UI.HtmlControls.HtmlLink)
{
var theCtrl = ctrl as System.Web.UI.HtmlControls.HtmlLink;
if (theCtrl.TagName == "link")
{
var typeAttr = theCtrl.Attributes["type"];
var relAttr = theCtrl.Attributes["rel"];
if ((typeAttr != null && typeAttr.ToLower() == "text/css")
|| (relAttr != null && relAttr.ToLower() == "stylesheet"))
{
theIndex = i;
break;
}
}
}
}
return theIndex;
}
// private int GetHeadStyleCSSIndex()
// {
// var theIndex = 0;
// for (var i = 0; i < Header.Controls.Count; i++)
// {
// var ctrl = Header.Controls[i];
// if (ctrl is LiteralControl)
// {
// if ((ctrl as LiteralControl).Text.Trim().ToLower().StartsWith("<style"))
// {
// theIndex = i;
// break;
// }
// }
// else if (ctrl is System.Web.UI.HtmlControls.HtmlLink)
// {
// var theCtrl = ctrl as System.Web.UI.HtmlControls.HtmlLink;
// if (theCtrl.TagName == "link")
// {
// var typeAttr = theCtrl.Attributes["type"];
// var relAttr = theCtrl.Attributes["rel"];
// if ((typeAttr != null && typeAttr.ToLower() == "text/css")
// || (relAttr != null && relAttr.ToLower() == "stylesheet"))
// {
// theIndex = i;
// break;
// }
// }
// }
// }
// return theIndex;
// }
/// <summary>
/// 是否将FState保存到服务器
/// </summary>
protected virtual bool SaveFStateToServer
{
get
{
return false;
}
}
// /// <summary>
// /// 是否将FState保存到服务器
// /// </summary>
// protected virtual bool SaveFStateToServer
// {
// get
// {
// return false;
// }
// }
#endregion
// #endregion
#region FState保存到服务端文件