154 lines
7.2 KiB
C#
154 lines
7.2 KiB
C#
using System;
|
|
using System.Web.UI;
|
|
using SuperMap.RealEstate.Web.UI;
|
|
using SuperMap.RealEstate.Web.UI.WebControls;
|
|
|
|
namespace SuperMap.RealEstate.HighWay.Common
|
|
{
|
|
public class PageHelper
|
|
{
|
|
public static void CreateHeaderStyle(SuperMap.RealEstate.Web.UI.Page _Page)
|
|
{
|
|
RegisterResource(_Page, "/HighWay/Styles/StyleSheet.css", "PropertyManageStyleSheet", PageHeaderRegType.Css);
|
|
RegisterResource(_Page, "/HighWay/Styles/ReportStyleSheet.css", "ReportStyleSheet", PageHeaderRegType.Css);
|
|
RegisterResource(_Page, "/HighWay/Scripts/kissy/kissy-min.js", "KissyMin", PageHeaderRegType.Js);
|
|
RegisterResource(_Page, "/HighWay/Scripts/kissy-global.js", "KissyGlobalJavaScript", PageHeaderRegType.Js);
|
|
RegisterResource(_Page, "/HighWay/Scripts/JavaScript.js", "JavaScript", PageHeaderRegType.Js);
|
|
//上传东西的样式
|
|
//RegisterResource(_Page, "/HighWay/Resources/v1_0/webuploader-0.1.5/upload/webuploader.css", "webuploader", PageHeaderRegType.Css);
|
|
//RegisterResource(_Page, "/HighWay/Resources/v1_0/webuploader-0.1.5/upload/style.css", "webuploaderCss", PageHeaderRegType.Css);
|
|
//RegisterResource(_Page, "/HighWay/Resources/v1_0/webuploader-0.1.5/dist/webuploader.js", "webuploader", PageHeaderRegType.Js);
|
|
//RegisterResource(_Page, "/HighWay/Resources/v1_0/webuploader-0.1.5/upload/upload.js", "loaderJs", PageHeaderRegType.Js);
|
|
RegisterResource(_Page, "/HighWay/Resources/v1_0/uploadify/uploadify.css", "webuploader", PageHeaderRegType.Css);
|
|
//RegisterResource(_Page, "/HighWay/Resources/v1_0/lib/ligerUI/skins/Aqua/css/ligerui-all.css", "ligerui-all", PageHeaderRegType.Css);
|
|
//RegisterResource(_Page, "/HighWay/Resources/v1_0/lib/json2.js", "json2", PageHeaderRegType.Js);
|
|
//RegisterResource(_Page, "/HighWay/Resources/v1_0/lib/ligerUI/js/core/base.js", "base", PageHeaderRegType.Js);
|
|
//RegisterResource(_Page, "/HighWay/Resources/v1_0/lib/ligerUI/js/plugins/ligerGrid.js", "ligerGrid", PageHeaderRegType.Js);
|
|
//RegisterResource(_Page, "/HighWay/Compents/ExpenseBill/DataGridView.js", "DataGridView", PageHeaderRegType.Js);
|
|
RegisterResource(_Page, "/HighWay/Styles/TableBill.css", "TableBill", PageHeaderRegType.Css);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 注册资源文件
|
|
/// </summary>
|
|
/// <param name="_Page">面页</param>
|
|
/// <param name="path">路径</param>
|
|
/// <param name="key">搜索的客户端资源的键</param>
|
|
/// <param name="_PageHeaderRegType">资源文件类型</param>
|
|
public static void RegisterResource(SuperMap.RealEstate.Web.UI.Page _Page, string path, string key, PageHeaderRegType _PageHeaderRegType)
|
|
{
|
|
string resStr = string.Empty;
|
|
switch (_PageHeaderRegType)
|
|
{
|
|
//脚本
|
|
case PageHeaderRegType.Js:
|
|
resStr = string.Format("<script type=\"text/javascript\" language=\"javascript\" src=\"{0}\"></script>", path);
|
|
break;
|
|
//样式
|
|
case PageHeaderRegType.Css:
|
|
resStr = string.Format("<link href=\"{0}\" rel=\"stylesheet\" type=\"text/css\" />", path);
|
|
break;
|
|
}
|
|
//是否已输出
|
|
if (!_Page.ClientScript.IsClientScriptBlockRegistered(_Page.GetType(), key))
|
|
{
|
|
if (_Page.Header != null)
|
|
{
|
|
LiteralControl link = new LiteralControl();
|
|
link.Text = "\r\n" + resStr;
|
|
_Page.Header.Controls.Add(link);
|
|
}
|
|
//注册资源key
|
|
_Page.ClientScript.RegisterClientScriptBlock(_Page.GetType(), key, "", false);
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 注册脚本块(或者样式块)
|
|
/// </summary>
|
|
/// <param name="_Page">页面</param>
|
|
/// <param name="script">脚本块</param>
|
|
/// <param name="key">键值</param>
|
|
public void RegisterScript(SuperMap.RealEstate.Web.UI.Page _Page, string script, string key)
|
|
{
|
|
//是否已输出
|
|
if (!_Page.ClientScript.IsClientScriptBlockRegistered(this.GetType(), key))
|
|
{
|
|
if (_Page.Header != null)
|
|
{
|
|
LiteralControl link = new LiteralControl();
|
|
link.Text = "\r\n" + script;
|
|
_Page.Header.Controls.Add(link);
|
|
}
|
|
_Page.ClientScript.RegisterClientScriptBlock(this.GetType(), key, "", false);//注册资源key
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 样式类型
|
|
/// </summary>
|
|
public enum PageHeaderRegType
|
|
{
|
|
/// <summary>
|
|
/// 脚本
|
|
/// </summary>
|
|
Js,
|
|
/// <summary>
|
|
/// 样式
|
|
/// </summary>
|
|
Css,
|
|
}
|
|
|
|
#region 组件刷新
|
|
/// <summary>
|
|
/// 重新加载组件
|
|
/// </summary>
|
|
/// <param name="ProInst"></param>
|
|
/// <param name="e"></param>
|
|
/// <param name="WorkFlowPage"></param>
|
|
public static void ReLoadExCompacts(Running.Business.HIGHWAYPROINST ProInst, ClientSetEventArgs e, IWorkFlowPage WorkFlowPage)
|
|
{
|
|
if (ProInst == null)
|
|
throw new Exception("流程实例不能为空!");
|
|
//审批表
|
|
string WorkFlow_Table = "83d87e86-ece7-4e97-9fe0-70caba974fd2";
|
|
|
|
switch (ProInst.ProInst.Operation_Type.Value)
|
|
{
|
|
case SuperMap.RealEstate.Enums.Operation_Type.CommodityApprove:
|
|
//审批表
|
|
RefreshCompact(e, WorkFlowPage, WorkFlow_Table);
|
|
////商品列表
|
|
//RefreshCompact(e, WorkFlowPage, "f8cab300-74b5-4c03-bfa9-d709f8864f6c");
|
|
break;
|
|
case SuperMap.RealEstate.Enums.Operation_Type.CommodityChange:
|
|
//审批表
|
|
RefreshCompact(e, WorkFlowPage, WorkFlow_Table);
|
|
////预售备案缴款单
|
|
//RefreshCompact(e, WorkFlowPage, "1362e8d6-aed2-4ab0-adf1-aea05a36026b");
|
|
break;
|
|
default:
|
|
throw new Exception("尚未配置要刷新的流程!");
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
/// <summary>
|
|
/// 重置前端数据
|
|
/// </summary>
|
|
/// <param name="e">支持脚本对象</param>
|
|
/// <param name="WorkFlowPage">工作流接口</param>
|
|
/// <param name="Compact_Guid">组件Guid</param>
|
|
/// <returns></returns>
|
|
public static void RefreshCompact(ClientSetEventArgs e, IWorkFlowPage WorkFlowPage, string Compact_Guid)
|
|
{
|
|
if (WorkFlowPage == null)
|
|
throw new Exception("WorkFlowPage is Null !");
|
|
WorkFlowPage.ReloadWorkFlowCompoment(Compact_Guid, e);
|
|
//SuperMap.RealEstate.Web.UI.UserControl _UserControl = WorkFlowPage.GetWorkFlowComponent(Compact_Guid);
|
|
//if (_UserControl == null)
|
|
// return false;
|
|
//return _UserControl.LoadDataEx(e);
|
|
}
|
|
}
|
|
} |