焊接管理,补充公司级树
This commit is contained in:
@@ -11,6 +11,20 @@ namespace FineUIPro.Web.HJGL.HotProcessHard
|
||||
{
|
||||
#region 定义项
|
||||
/// <summary>
|
||||
/// 项目主键
|
||||
/// </summary>
|
||||
public string ProjectId
|
||||
{
|
||||
get
|
||||
{
|
||||
return (string)ViewState["ProjectId"];
|
||||
}
|
||||
set
|
||||
{
|
||||
ViewState["ProjectId"] = value;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 硬度委托主键
|
||||
/// </summary>
|
||||
public string HardTrustID
|
||||
@@ -36,12 +50,42 @@ namespace FineUIPro.Web.HJGL.HotProcessHard
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
GetButtonPower();
|
||||
this.ProjectId = this.CurrUser.LoginProjectId;
|
||||
if (!string.IsNullOrEmpty(Request.Params["projectId"]) && Request.Params["projectId"] != this.CurrUser.LoginProjectId)
|
||||
{
|
||||
this.ProjectId = Request.Params["projectId"];
|
||||
}
|
||||
|
||||
this.ucTree.UnitId = this.CurrUser.UnitId;
|
||||
this.ucTree.ProjectId = this.ProjectId;
|
||||
if (!string.IsNullOrEmpty(this.ProjectId))
|
||||
{
|
||||
this.panelLeftRegion.Hidden = true;
|
||||
////权限按钮方法
|
||||
this.GetButtonPower();
|
||||
}
|
||||
this.ddlPageSize.SelectedValue = this.Grid1.PageSize.ToString();
|
||||
this.HardTrustID = string.Empty;
|
||||
this.InitTreeMenu();//加载树
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 公司级树加载
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void changeTree(object sender, EventArgs e)
|
||||
{
|
||||
this.ProjectId = this.ucTree.ProjectId;
|
||||
|
||||
if (string.IsNullOrEmpty(this.CurrUser.LoginProjectId))
|
||||
{
|
||||
btnNew.Hidden = true;
|
||||
}
|
||||
this.GetButtonPower();
|
||||
this.InitTreeMenu();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 获取按钮权限
|
||||
@@ -56,7 +100,7 @@ namespace FineUIPro.Web.HJGL.HotProcessHard
|
||||
{
|
||||
return;
|
||||
}
|
||||
var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.HJGL_HotHardManageEditMenuId);
|
||||
var buttonList = BLL.CommonService.GetAllButtonList(this.ProjectId, this.CurrUser.UserId, BLL.Const.HJGL_HotHardManageEditMenuId);
|
||||
if (buttonList.Count() > 0)
|
||||
{
|
||||
if (buttonList.Contains(BLL.Const.BtnAdd))
|
||||
@@ -81,6 +125,10 @@ namespace FineUIPro.Web.HJGL.HotProcessHard
|
||||
/// </summary>
|
||||
private void InitTreeMenu()
|
||||
{
|
||||
if (string.IsNullOrEmpty(this.ProjectId))
|
||||
{
|
||||
return;
|
||||
}
|
||||
this.tvControlItem.Nodes.Clear();
|
||||
TreeNode rootNode = new TreeNode();
|
||||
rootNode.Text = "装置-单位-工作区";
|
||||
@@ -88,14 +136,14 @@ namespace FineUIPro.Web.HJGL.HotProcessHard
|
||||
rootNode.Expanded = true;
|
||||
this.tvControlItem.Nodes.Add(rootNode);
|
||||
////装置
|
||||
var pInstallation = (from x in Funs.DB.Project_Installation where x.ProjectId == this.CurrUser.LoginProjectId select x).ToList();
|
||||
var pInstallation = (from x in Funs.DB.Project_Installation where x.ProjectId == this.ProjectId select x).ToList();
|
||||
////区域
|
||||
var pWorkArea = (from x in Funs.DB.ProjectData_WorkArea where x.ProjectId == this.CurrUser.LoginProjectId select x).ToList();
|
||||
var pWorkArea = (from x in Funs.DB.ProjectData_WorkArea where x.ProjectId == this.ProjectId select x).ToList();
|
||||
////单位
|
||||
var pUnits = (from x in Funs.DB.Project_ProjectUnit where x.ProjectId == this.CurrUser.LoginProjectId select x).ToList();
|
||||
var pUnits = (from x in Funs.DB.Project_ProjectUnit where x.ProjectId == this.ProjectId select x).ToList();
|
||||
|
||||
var workAreaIdList = (from x in BLL.Funs.DB.PW_IsoInfo
|
||||
where x.ProjectId == this.CurrUser.LoginProjectId
|
||||
where x.ProjectId == this.ProjectId
|
||||
orderby x.ISO_IsoNo
|
||||
select x.WorkAreaId).Distinct().ToList();
|
||||
pWorkArea = pWorkArea.Where(x => workAreaIdList.Contains(x.WorkAreaId)).OrderBy(x => x.WorkAreaCode).ToList();
|
||||
@@ -222,7 +270,7 @@ namespace FineUIPro.Web.HJGL.HotProcessHard
|
||||
/// <param name="e"></param>
|
||||
protected void tvControlItem_NodeCommand(object sender, TreeCommandEventArgs e)
|
||||
{
|
||||
var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.HJGL_HotHardManageEditMenuId);
|
||||
var buttonList = BLL.CommonService.GetAllButtonList(this.ProjectId, this.CurrUser.UserId, BLL.Const.HJGL_HotHardManageEditMenuId);
|
||||
if (this.tvControlItem.SelectedNode.CommandName == "建筑工程" || this.tvControlItem.SelectedNode.CommandName == "安装工程")
|
||||
{
|
||||
this.btnNew.Hidden = true;
|
||||
@@ -393,7 +441,7 @@ namespace FineUIPro.Web.HJGL.HotProcessHard
|
||||
/// <param name="e"></param>
|
||||
protected void btnNew_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, Const.HJGL_HotHardManageEditMenuId, Const.BtnAdd))
|
||||
if (CommonService.GetAllButtonPowerList(this.ProjectId, this.CurrUser.UserId, Const.HJGL_HotHardManageEditMenuId, Const.BtnAdd))
|
||||
{
|
||||
if (this.tvControlItem.SelectedNode != null && this.tvControlItem.SelectedNode.ToolTip == "区域")
|
||||
{
|
||||
@@ -422,7 +470,7 @@ namespace FineUIPro.Web.HJGL.HotProcessHard
|
||||
/// <param name="e"></param>
|
||||
protected void btnEdit_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, Const.HJGL_HotHardManageEditMenuId, Const.BtnSave))
|
||||
if (CommonService.GetAllButtonPowerList(this.ProjectId, this.CurrUser.UserId, Const.HJGL_HotHardManageEditMenuId, Const.BtnSave))
|
||||
{
|
||||
if (this.tvControlItem.SelectedNode != null)
|
||||
{
|
||||
@@ -458,7 +506,7 @@ namespace FineUIPro.Web.HJGL.HotProcessHard
|
||||
/// <param name="e"></param>
|
||||
protected void btnDelete_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, Const.HJGL_HotHardManageEditMenuId, Const.BtnDelete))
|
||||
if (CommonService.GetAllButtonPowerList(this.ProjectId, this.CurrUser.UserId, Const.HJGL_HotHardManageEditMenuId, Const.BtnDelete))
|
||||
{
|
||||
if (this.tvControlItem.SelectedNode != null)
|
||||
{
|
||||
@@ -495,7 +543,7 @@ namespace FineUIPro.Web.HJGL.HotProcessHard
|
||||
}
|
||||
BLL.Hard_TrustItemService.DeleteHardTrustItemById(this.HardTrustID);
|
||||
BLL.Hard_TrustService.DeleteHardTrustById(this.HardTrustID);
|
||||
//BLL.Sys_LogService.AddLog(BLL.Const.System_3, this.CurrUser.LoginProjectId, this.CurrUser.UserId, Resources.Lan.DeleteHardTrust);
|
||||
//BLL.Sys_LogService.AddLog(BLL.Const.System_3, this.ProjectId, this.CurrUser.UserId, Resources.Lan.DeleteHardTrust);
|
||||
Alert.ShowInTop("删除成功!", MessageBoxIcon.Success);
|
||||
this.InitTreeMenu();
|
||||
this.Grid1.DataSource = null;
|
||||
|
||||
Reference in New Issue
Block a user