焊接管理,补充公司级树
This commit is contained in:
@@ -14,6 +14,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 HotProessTrustId
|
||||
@@ -39,12 +53,42 @@ namespace FineUIPro.Web.HJGL.HotProcessHard
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
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.HotProessTrustId = 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 加载树
|
||||
@@ -53,6 +97,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 = "装置-单位-工作区";
|
||||
@@ -60,14 +108,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();
|
||||
@@ -229,7 +277,7 @@ namespace FineUIPro.Web.HJGL.HotProcessHard
|
||||
+ @" FROM dbo.View_HJGL_HotProess_TrustItem AS Trust"
|
||||
+ @" WHERE Trust.ProjectId= @ProjectId AND Trust.HotProessTrustId=@HotProessTrustId ";
|
||||
|
||||
listStr.Add(new SqlParameter("@ProjectId", hotProessTrust != null ? hotProessTrust.ProjectId : this.CurrUser.LoginProjectId));
|
||||
listStr.Add(new SqlParameter("@ProjectId", hotProessTrust != null ? hotProessTrust.ProjectId : this.ProjectId));
|
||||
listStr.Add(new SqlParameter("@HotProessTrustId", this.HotProessTrustId));
|
||||
|
||||
if (!string.IsNullOrEmpty(this.txtIsoNo.Text.Trim()))
|
||||
@@ -381,7 +429,7 @@ namespace FineUIPro.Web.HJGL.HotProcessHard
|
||||
/// <param name="e"></param>
|
||||
protected void btnMenuHotProessReport_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, Const.HJGL_HotProessReportMenuId, Const.BtnSave))
|
||||
if (CommonService.GetAllButtonPowerList(this.ProjectId, this.CurrUser.UserId, Const.HJGL_HotProessReportMenuId, Const.BtnSave))
|
||||
{
|
||||
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("HotProessReport.aspx?HotProessTrustItemId={0}", this.Grid1.SelectedRowID, "编辑热处理报告 - ")));
|
||||
}
|
||||
@@ -394,7 +442,7 @@ namespace FineUIPro.Web.HJGL.HotProcessHard
|
||||
|
||||
protected void btnMenuModify_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, Const.HJGL_HotProessReportMenuId, Const.BtnSave))
|
||||
if (CommonService.GetAllButtonPowerList(this.ProjectId, this.CurrUser.UserId, Const.HJGL_HotProessReportMenuId, Const.BtnSave))
|
||||
{
|
||||
var trustManage = BLL.HotProess_TrustService.GetHotProessTrustById(this.tvControlItem.SelectedNodeID);
|
||||
if (trustManage != null)
|
||||
@@ -424,7 +472,7 @@ namespace FineUIPro.Web.HJGL.HotProcessHard
|
||||
return;
|
||||
}
|
||||
string varValue = string.Empty;
|
||||
var project = BLL.ProjectService.GetProjectByProjectId(this.CurrUser.LoginProjectId);
|
||||
var project = BLL.ProjectService.GetProjectByProjectId(this.ProjectId);
|
||||
if (project != null)
|
||||
{
|
||||
varValue = project.ProjectName;
|
||||
|
||||
Reference in New Issue
Block a user