158 lines
6.6 KiB
C#
158 lines
6.6 KiB
C#
using SuperMap.RealEstate.CoreFrameWork.Dictionary.Business;
|
||
using SuperMap.RealEstate.Finance.Storage.Business;
|
||
using System;
|
||
using System.Collections.Generic;
|
||
using System.Data;
|
||
using System.Linq;
|
||
using System.Web;
|
||
using System.Web.UI;
|
||
using System.Web.UI.WebControls;
|
||
using Business = SuperMap.RealEstate.CoreFrameWork.Dictionary.Business;
|
||
using HWSB = SuperMap.RealEstate.HighWay.Storage.Business;
|
||
namespace Personnel.WebSite.Compents.SalaryPayrollOffice
|
||
{
|
||
public partial class ObjectTree : SuperMap.RealEstate.UI.BasePage
|
||
{
|
||
#region 方法 -> 页面加载
|
||
protected void Page_Load(object sender, EventArgs e)
|
||
{
|
||
if (IsPostBack) return;
|
||
try
|
||
{
|
||
//设置树双击事件
|
||
// this.FixTreeViewDoubleClick(MyTreeView, true);
|
||
//绑定部门树
|
||
TreeViewBinding(true);
|
||
//设置回车焦点按钮
|
||
//SetControlClientAction(ButtonSearch);
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
throw ex;
|
||
}
|
||
finally
|
||
{
|
||
}
|
||
}
|
||
#endregion
|
||
|
||
#region 方法 -> 部门树绑定事件
|
||
private void TreeViewBinding(bool withChildNodes)
|
||
{
|
||
MyTreeView.Nodes.Clear();
|
||
string SELECT_FIELDENUM_ID = Request["SELECT_FIELDENUM_ID"].ToDecrypt();
|
||
string sqlWhere = "WHERE FIELDENUM_ID=" + ProvinceID;
|
||
DataTable dt = new Business.FieldEnum(Transaction).ExecuteDataTable(GetSql(sqlWhere));
|
||
if (dt.Rows.Count > 0)
|
||
{
|
||
TreeNode treeNode = new TreeNode();
|
||
treeNode.Value = dt.Rows[0]["FIELDENUM_ID"].ToString();
|
||
treeNode.Text = dt.Rows[0]["FIELDENUM_NAME"].ToString();
|
||
treeNode.SelectAction = TreeNodeSelectAction.None;
|
||
treeNode.ImageUrl = "/Portal/Icons/16/Department.png";
|
||
treeNode.Expanded = true;
|
||
sqlWhere = "WHERE FIELDENUM_PID=" + ProvinceID;
|
||
DataTable dtChild = new Business.FieldEnum(Transaction).ExecuteDataTable(GetSql(sqlWhere));
|
||
if (dtChild.Rows.Count > 0)
|
||
{
|
||
foreach (DataRow item in dtChild.Rows)
|
||
{
|
||
TreeNode treeChildNode = new TreeNode();
|
||
treeChildNode.Value = item["FIELDENUM_ID"].ToString();
|
||
treeChildNode.Text = item["FIELDENUM_NAME"].ToString();
|
||
treeChildNode.SelectAction = TreeNodeSelectAction.None;
|
||
treeChildNode.ImageToolTip = "FIELDENUM_NAME";
|
||
treeChildNode.ImageUrl = "/Portal/Icons/16/Department.png";
|
||
treeChildNode.Expanded = true;
|
||
if (SELECT_FIELDENUM_ID.Split(',').Contains(item["FIELDENUM_ID"].ToString()))
|
||
{
|
||
treeChildNode.Checked = true;
|
||
}
|
||
treeNode.ChildNodes.Add(treeChildNode);
|
||
}
|
||
}
|
||
this.MyTreeView.Nodes.Add(treeNode);
|
||
}
|
||
MyTreeView.ExpandAll();
|
||
}
|
||
#endregion
|
||
|
||
#region 方法 -> 获取树查询语句
|
||
public string GetSql(string sqlWhere)
|
||
{
|
||
string sql = string.Format(@"
|
||
SELECT
|
||
FIELDENUM_ID,FIELDENUM_VALUE,FIELDENUM_NAME,FIELDENUM_STATUS,FIELDENUM_PID
|
||
FROM
|
||
PLATFORM_DICTIONARY.T_FIELDENUM {0}
|
||
ORDER BY FIELDENUM_PID,FIELDENUM_INDEX", sqlWhere);
|
||
return sql;
|
||
}
|
||
#endregion
|
||
|
||
#region 方法 -> 树节点点击事件
|
||
protected void MyTreeView_TreeNodePopulate(object sender, TreeNodeEventArgs e)
|
||
{
|
||
//string sqlWhere = @" EXISTS (
|
||
// SELECT 1 FROM PERSONNEL_STORAGE.T_RANK B WHERE A.CURRENT_POSITION = B.RANK_ID
|
||
// START WITH B.RANK_ID = 2
|
||
// CONNECT BY PRIOR B.RANK_ID = B.RANK_PID)";
|
||
//CommonHelper.BindingServerpartTreeView_Enum(this.Transaction, FieldExplain_ID, e.Node.Value, e.Node.ChildNodes, this.TextBoxSearch.Text,
|
||
// true, "1234", " NVL(STATISTIC_TYPE,1000) IN (1000,3000) ", null, null, false, "STAFFSALARYList.aspx", "", "", true, sqlWhere);
|
||
}
|
||
#endregion
|
||
|
||
#region 方法 -> 查询按钮事件
|
||
//protected void ButtonSearch_Click(object sender, EventArgs e)
|
||
//{
|
||
// TreeViewBinding(true);
|
||
//}
|
||
#endregion
|
||
|
||
#region 方法 -> 收起/展开
|
||
protected void Expand_Click(object sender, EventArgs e)
|
||
{
|
||
if (Expand.Text == "收起↑")
|
||
{
|
||
foreach (TreeNode _TreeNode in MyTreeView.Nodes)
|
||
{
|
||
_TreeNode.Expanded = false;
|
||
}
|
||
Expand.Text = "展开↓";
|
||
}
|
||
else if (Expand.Text == "展开↓")
|
||
{
|
||
MyTreeView.ExpandAll();
|
||
Expand.Text = "收起↑";
|
||
}
|
||
}
|
||
#endregion
|
||
|
||
#region 方法 -> 保存事件
|
||
protected void ButtonSave_Click(object sender, EventArgs e)
|
||
{
|
||
//循环获取所选值
|
||
string FIELDENUM_ID = "";
|
||
foreach (TreeNode _TreeNode in MyTreeView.CheckedNodes)
|
||
{
|
||
if (_TreeNode.ImageToolTip == "FIELDENUM_NAME")
|
||
{
|
||
FIELDENUM_ID += FIELDENUM_ID == "" ? _TreeNode.Value : "," + _TreeNode.Value;
|
||
}
|
||
}
|
||
//跳转至机关工资汇总页面
|
||
//PERSONNELPROINST_ID:流程内码
|
||
//FIELDENUM_ID:用户所属部门内码,多个以英文逗号隔开
|
||
//SELECT_FIELDENUM_ID:选择的部门内码,多个以英文逗号隔开
|
||
//SALARY_DATE:选择的日期
|
||
string RequestUrl = "/WorkFlow/Transact/Common/ProcessPage.aspx?NowActInst_ID=" + Request["NowActInst_ID"] +
|
||
"&ProInst_ID=" + Request["ProInst_ID"] + "&SELECT_FIELDENUM_ID=" + FIELDENUM_ID.ToEncrypt() +
|
||
"&SALARY_DATE=" + Request["SALARY_DATE"] +
|
||
"&PopDialogPageName=F_R_GridPageEx1&PopDialogName=WorkFlowWorkPlatform&r=0.8500934960320592";
|
||
ExecClientScript("$('#pop-dialog-frame-WorkFlowWorkPlatform',parent.parent.document).attr('src', '" + RequestUrl + "')");
|
||
ClosePopDialog();
|
||
}
|
||
#endregion
|
||
|
||
}
|
||
} |