169 lines
7.4 KiB
C#
169 lines
7.4 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Data;
|
|
using System.IO;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Web;
|
|
using System.Web.UI;
|
|
using System.Web.UI.WebControls;
|
|
using System.Xml;
|
|
using System.Xml.Xsl;
|
|
using System.Reflection;
|
|
using SuperMap.RealEstate.Web.UI;
|
|
using SuperMap.RealEstate.ServiceModel;
|
|
using SuperMap.RealEstate.Configuration;
|
|
using SuperMap.RealEstate.CoreFrameWork;
|
|
using SuperMap.RealEstate.Web.UI.WebControls;
|
|
using SuperMap.RealEstate.Utility;
|
|
using SuperMap.RealEstate.WorkFlow;
|
|
|
|
namespace SuperMap.RealEstate.Seller.Common
|
|
{
|
|
public class PageHelper
|
|
{
|
|
public static void CreateHeaderStyle(SuperMap.RealEstate.Web.UI.Page _Page)
|
|
{
|
|
RegisterResource(_Page, "/Seller/Styles/StyleSheet.css", "PropertyManageStyleSheet", PageHeaderRegType.Css);
|
|
RegisterResource(_Page, "/Seller/Styles/ReportStyleSheet.css", "ReportStyleSheet", PageHeaderRegType.Css);
|
|
RegisterResource(_Page, "/Seller/Scripts/kissy/kissy-min.js", "KissyMin", PageHeaderRegType.Js);
|
|
RegisterResource(_Page, "/Seller/Scripts/kissy-global.js", "KissyGlobalJavaScript", PageHeaderRegType.Js);
|
|
//上传东西的样式
|
|
//RegisterResource(_Page, "/Seller/Resources/webuploader-0.1.5/upload/webuploader.css", "webuploader", PageHeaderRegType.Css);
|
|
//RegisterResource(_Page, "/Seller/Resources/webuploader-0.1.5/upload/style.css", "webuploaderCss", PageHeaderRegType.Css);
|
|
//RegisterResource(_Page, "/Seller/Resources/webuploader-0.1.5/dist/webuploader.js", "webuploader", PageHeaderRegType.Js);
|
|
//RegisterResource(_Page, "/Seller/Resources/webuploader-0.1.5/upload/upload.js", "loaderJs", PageHeaderRegType.Js);
|
|
RegisterResource(_Page, "/Seller/Resources/uploadify/uploadify.css", "webuploader", PageHeaderRegType.Css);
|
|
//RegisterResource(_Page, "/Seller/Resources/lib/ligerUI/skins/Aqua/css/ligerui-all.css", "ligerui-all", PageHeaderRegType.Css);
|
|
//RegisterResource(_Page, "/Seller/Resources/lib/json2.js", "json2", PageHeaderRegType.Js);
|
|
//RegisterResource(_Page, "/Seller/Resources/lib/ligerUI/js/core/base.js", "base", PageHeaderRegType.Js);
|
|
//RegisterResource(_Page, "/Seller/Resources/lib/ligerUI/js/plugins/ligerGrid.js", "ligerGrid", PageHeaderRegType.Js);
|
|
RegisterResource(_Page, "/Seller/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.SELLERPROINST 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.GoodsApprove:
|
|
//case SuperMap.RealEstate.Enums.Operation_Type.SpriceApprove:
|
|
//case SuperMap.RealEstate.Enums.Operation_Type.PpriceApprove:
|
|
//case SuperMap.RealEstate.Enums.Operation_Type.GoodsChange:
|
|
// //审批表
|
|
// RefreshCompact(e, WorkFlowPage, WorkFlow_Table);
|
|
// 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);
|
|
}
|
|
}
|
|
} |