公司级树补充
This commit is contained in:
@@ -10,6 +10,22 @@ namespace FineUIPro.Web.CQMS.WBS
|
||||
{
|
||||
public partial class ProjectControlPointFile : PageBase
|
||||
{
|
||||
#region 项目主键
|
||||
/// <summary>
|
||||
/// 项目主键
|
||||
/// </summary>
|
||||
public string ProjectId
|
||||
{
|
||||
get
|
||||
{
|
||||
return (string)ViewState["ProjectId"];
|
||||
}
|
||||
set
|
||||
{
|
||||
ViewState["ProjectId"] = value;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
/// <summary>
|
||||
/// 被选择项列表
|
||||
/// </summary>
|
||||
@@ -50,9 +66,22 @@ namespace FineUIPro.Web.CQMS.WBS
|
||||
{
|
||||
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.SelectedList = new List<string>();
|
||||
this.NoSelectedList = new List<string>();
|
||||
GetButtonPower();
|
||||
//GetButtonPower();
|
||||
InitTreeMenu();
|
||||
this.Grid1.Columns[2].Hidden = false;
|
||||
this.Grid1.Columns[3].Hidden = true;
|
||||
@@ -68,18 +97,34 @@ namespace FineUIPro.Web.CQMS.WBS
|
||||
#endregion
|
||||
|
||||
#region 加载树
|
||||
|
||||
/// <summary>
|
||||
/// 公司级树加载
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void changeTree(object sender, EventArgs e)
|
||||
{
|
||||
this.ProjectId = this.ucTree.ProjectId;
|
||||
this.GetButtonPower();
|
||||
this.InitTreeMenu();
|
||||
}
|
||||
/// <summary>
|
||||
/// 加载树
|
||||
/// </summary>
|
||||
private void InitTreeMenu()
|
||||
{
|
||||
if (string.IsNullOrEmpty(this.ProjectId))
|
||||
{
|
||||
return;
|
||||
}
|
||||
this.trWBS.Nodes.Clear();
|
||||
this.trWBS.ShowBorder = false;
|
||||
this.trWBS.ShowHeader = false;
|
||||
this.trWBS.EnableIcons = true;
|
||||
this.trWBS.AutoScroll = true;
|
||||
this.trWBS.EnableSingleClickExpand = true;
|
||||
var unitWorks = from x in Funs.DB.WBS_UnitWork where x.ProjectId == this.CurrUser.LoginProjectId orderby x.UnitWorkCode select x;
|
||||
var unitWorks = from x in Funs.DB.WBS_UnitWork where x.ProjectId == this.ProjectId orderby x.UnitWorkCode select x;
|
||||
foreach (var q in unitWorks)
|
||||
{
|
||||
TreeNode newNode = new TreeNode();
|
||||
@@ -196,7 +241,7 @@ namespace FineUIPro.Web.CQMS.WBS
|
||||
cNProfessionalId = e.NodeID.Split('|')[1];
|
||||
}
|
||||
var divisions = (from x in BLL.Funs.DB.WBS_DivisionProject
|
||||
where x.CNProfessionalId == cNProfessionalId && x.ProjectId == this.CurrUser.LoginProjectId && x.SuperDivisionId == null && x.UnitWorkId == unitWorkId
|
||||
where x.CNProfessionalId == cNProfessionalId && x.ProjectId == this.ProjectId && x.SuperDivisionId == null && x.UnitWorkId == unitWorkId
|
||||
orderby x.SortIndex
|
||||
select x).ToList();
|
||||
foreach (var q in divisions)
|
||||
@@ -216,7 +261,7 @@ namespace FineUIPro.Web.CQMS.WBS
|
||||
//newNode.Checked = true;
|
||||
|
||||
var list = (from x in Funs.DB.WBS_DivisionProject
|
||||
where x.SuperDivisionId == q.DivisionProjectId && x.ProjectId == this.CurrUser.LoginProjectId
|
||||
where x.SuperDivisionId == q.DivisionProjectId && x.ProjectId == this.ProjectId
|
||||
orderby x.SortIndex
|
||||
select x).ToList();
|
||||
if (list.Count > 0)
|
||||
@@ -232,7 +277,7 @@ namespace FineUIPro.Web.CQMS.WBS
|
||||
else if (e.Node.CommandName == "DivisionProject") //展开分部节点
|
||||
{
|
||||
var childDivisions = (from x in BLL.Funs.DB.WBS_DivisionProject
|
||||
where x.SuperDivisionId == e.Node.NodeID && x.ProjectId == this.CurrUser.LoginProjectId
|
||||
where x.SuperDivisionId == e.Node.NodeID && x.ProjectId == this.ProjectId
|
||||
orderby x.SortIndex
|
||||
select x).ToList();
|
||||
foreach (var q in childDivisions)
|
||||
@@ -251,7 +296,7 @@ namespace FineUIPro.Web.CQMS.WBS
|
||||
//newNode.Checked = true;
|
||||
|
||||
var list = (from x in Funs.DB.WBS_DivisionProject
|
||||
where x.SuperDivisionId == q.DivisionProjectId && x.ProjectId == this.CurrUser.LoginProjectId
|
||||
where x.SuperDivisionId == q.DivisionProjectId && x.ProjectId == this.ProjectId
|
||||
orderby x.SortIndex
|
||||
select x).ToList();
|
||||
if (list.Count > 0)
|
||||
@@ -275,7 +320,7 @@ namespace FineUIPro.Web.CQMS.WBS
|
||||
/// <param name="e"></param>
|
||||
protected void trWBS_NodeCheck(object sender, FineUIPro.TreeCheckEventArgs e)
|
||||
{
|
||||
if (BLL.CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.ProjectControlPointMenuId, BLL.Const.BtnSave))
|
||||
if (BLL.CommonService.GetAllButtonPowerList(this.ProjectId, this.CurrUser.UserId, BLL.Const.ProjectControlPointMenuId, BLL.Const.BtnSave))
|
||||
{
|
||||
Model.WBS_DivisionProject divisionProject = BLL.DivisionProjectService.GetDivisionProjectById(e.NodeID);
|
||||
divisionProject.IsSelected = e.Checked;
|
||||
@@ -450,7 +495,7 @@ namespace FineUIPro.Web.CQMS.WBS
|
||||
Alert.ShowInTop("请至少选择一条记录!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
//var controlItemAndCycle = Funs.DB.WBS_ControlItemAndCycle.FirstOrDefault(x => x.ProjectId == this.CurrUser.LoginProjectId && x.InitControlItemCode == Grid1.SelectedRowID);
|
||||
//var controlItemAndCycle = Funs.DB.WBS_ControlItemAndCycle.FirstOrDefault(x => x.ProjectId == this.ProjectId && x.InitControlItemCode == Grid1.SelectedRowID);
|
||||
//if (controlItemAndCycle != null)
|
||||
//{
|
||||
// ShowNotify("WBS定制中已使用该数据,无法删除!", MessageBoxIcon.Warning);
|
||||
@@ -511,12 +556,17 @@ namespace FineUIPro.Web.CQMS.WBS
|
||||
/// </summary>
|
||||
private void BindGrid()
|
||||
{
|
||||
if (string.IsNullOrEmpty(this.ProjectId))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
string strSql = @"SELECT BreakdownProjectId,BreakdownCode,BreakdownName,Basis,CheckPoints,RecordAndCode,Class,FenBao,WuHuan,JianLi,YeZhu,Remark,ModelURL
|
||||
FROM WBS_BreakdownProject ";
|
||||
List<SqlParameter> listStr = new List<SqlParameter>();
|
||||
strSql += " where IsSelected = 1 and DivisionProjectId = @DivisionProjectId and ProjectId=@ProjectId";
|
||||
listStr.Add(new SqlParameter("@DivisionProjectId", this.trWBS.SelectedNodeID));
|
||||
listStr.Add(new SqlParameter("@ProjectId", this.CurrUser.LoginProjectId));
|
||||
listStr.Add(new SqlParameter("@ProjectId", this.ProjectId));
|
||||
SqlParameter[] parameter = listStr.ToArray();
|
||||
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
|
||||
|
||||
@@ -602,7 +652,7 @@ namespace FineUIPro.Web.CQMS.WBS
|
||||
if (trWBS.Nodes[i].Nodes[j].NodeID == BLL.Const.CNProfessionalConstructId) //建筑工程
|
||||
{
|
||||
var divisionsCV = (from x in BLL.Funs.DB.WBS_DivisionProject
|
||||
where x.CNProfessionalId == BLL.Const.CNProfessionalCVId && x.ProjectId == this.CurrUser.LoginProjectId && x.SuperDivisionId == null && x.UnitWorkId == unitWorkId && x.IsSelected == true
|
||||
where x.CNProfessionalId == BLL.Const.CNProfessionalCVId && x.ProjectId == this.ProjectId && x.SuperDivisionId == null && x.UnitWorkId == unitWorkId && x.IsSelected == true
|
||||
orderby x.SortIndex
|
||||
select x).ToList();
|
||||
if (divisionsCV.Count > 0) //建筑工程下存在土建内容
|
||||
@@ -616,7 +666,7 @@ namespace FineUIPro.Web.CQMS.WBS
|
||||
trWBS.Nodes[i].Nodes[j].Nodes.Add(newNode3);
|
||||
newNode3.Expanded = true;
|
||||
var divisions = (from x in BLL.Funs.DB.WBS_DivisionProject
|
||||
where x.CNProfessionalId == BLL.Const.CNProfessionalCVId && x.ProjectId == this.CurrUser.LoginProjectId && x.SuperDivisionId == null && x.UnitWorkId == unitWorkId
|
||||
where x.CNProfessionalId == BLL.Const.CNProfessionalCVId && x.ProjectId == this.ProjectId && x.SuperDivisionId == null && x.UnitWorkId == unitWorkId
|
||||
orderby x.SortIndex
|
||||
select x).ToList();
|
||||
foreach (var q in divisions)
|
||||
@@ -633,7 +683,7 @@ namespace FineUIPro.Web.CQMS.WBS
|
||||
}
|
||||
newNode3.Nodes.Add(newNode4);
|
||||
var division1s = (from x in BLL.Funs.DB.WBS_DivisionProject
|
||||
where x.ProjectId == this.CurrUser.LoginProjectId && x.SuperDivisionId == q.DivisionProjectId
|
||||
where x.ProjectId == this.ProjectId && x.SuperDivisionId == q.DivisionProjectId
|
||||
orderby x.SortIndex
|
||||
select x).ToList();
|
||||
if (list.Contains(q.DivisionProjectId))
|
||||
@@ -649,7 +699,7 @@ namespace FineUIPro.Web.CQMS.WBS
|
||||
newNode5.EnableClickEvent = true;
|
||||
newNode4.Nodes.Add(newNode5);
|
||||
var division2s = (from x in BLL.Funs.DB.WBS_DivisionProject
|
||||
where x.ProjectId == this.CurrUser.LoginProjectId && x.SuperDivisionId == division1.DivisionProjectId
|
||||
where x.ProjectId == this.ProjectId && x.SuperDivisionId == division1.DivisionProjectId
|
||||
orderby x.SortIndex
|
||||
select x).ToList();
|
||||
if (list.Contains(division1.DivisionProjectId))
|
||||
@@ -665,7 +715,7 @@ namespace FineUIPro.Web.CQMS.WBS
|
||||
newNode6.EnableClickEvent = true;
|
||||
newNode5.Nodes.Add(newNode6);
|
||||
var division3s = (from x in BLL.Funs.DB.WBS_DivisionProject
|
||||
where x.ProjectId == this.CurrUser.LoginProjectId && x.SuperDivisionId == division2.DivisionProjectId
|
||||
where x.ProjectId == this.ProjectId && x.SuperDivisionId == division2.DivisionProjectId
|
||||
orderby x.SortIndex
|
||||
select x).ToList();
|
||||
if (list.Contains(division2.DivisionProjectId))
|
||||
@@ -711,7 +761,7 @@ namespace FineUIPro.Web.CQMS.WBS
|
||||
else
|
||||
{
|
||||
var divisions = (from x in BLL.Funs.DB.WBS_DivisionProject
|
||||
where x.CNProfessionalId == BLL.Const.CNProfessionalConstructId && x.ProjectId == this.CurrUser.LoginProjectId && x.SuperDivisionId == null && x.UnitWorkId == unitWorkId
|
||||
where x.CNProfessionalId == BLL.Const.CNProfessionalConstructId && x.ProjectId == this.ProjectId && x.SuperDivisionId == null && x.UnitWorkId == unitWorkId
|
||||
orderby x.SortIndex
|
||||
select x).ToList();
|
||||
foreach (var q in divisions)
|
||||
@@ -728,7 +778,7 @@ namespace FineUIPro.Web.CQMS.WBS
|
||||
newNode4.Checked = true;
|
||||
}
|
||||
var division1s = (from x in BLL.Funs.DB.WBS_DivisionProject
|
||||
where x.ProjectId == this.CurrUser.LoginProjectId && x.SuperDivisionId == q.DivisionProjectId
|
||||
where x.ProjectId == this.ProjectId && x.SuperDivisionId == q.DivisionProjectId
|
||||
orderby x.SortIndex
|
||||
select x).ToList();
|
||||
if (list.Contains(q.DivisionProjectId))
|
||||
@@ -744,7 +794,7 @@ namespace FineUIPro.Web.CQMS.WBS
|
||||
newNode5.EnableClickEvent = true;
|
||||
newNode4.Nodes.Add(newNode5);
|
||||
var division2s = (from x in BLL.Funs.DB.WBS_DivisionProject
|
||||
where x.ProjectId == this.CurrUser.LoginProjectId && x.SuperDivisionId == division1.DivisionProjectId
|
||||
where x.ProjectId == this.ProjectId && x.SuperDivisionId == division1.DivisionProjectId
|
||||
orderby x.SortIndex
|
||||
select x).ToList();
|
||||
if (list.Contains(division1.DivisionProjectId))
|
||||
@@ -760,7 +810,7 @@ namespace FineUIPro.Web.CQMS.WBS
|
||||
newNode6.EnableClickEvent = true;
|
||||
newNode5.Nodes.Add(newNode6);
|
||||
var division3s = (from x in BLL.Funs.DB.WBS_DivisionProject
|
||||
where x.ProjectId == this.CurrUser.LoginProjectId && x.SuperDivisionId == division2.DivisionProjectId
|
||||
where x.ProjectId == this.ProjectId && x.SuperDivisionId == division2.DivisionProjectId
|
||||
orderby x.SortIndex
|
||||
select x).ToList();
|
||||
if (list.Contains(division2.DivisionProjectId))
|
||||
@@ -820,7 +870,7 @@ namespace FineUIPro.Web.CQMS.WBS
|
||||
{
|
||||
newCNProfessionalNode.Expanded = true;
|
||||
var divisions = (from x in BLL.Funs.DB.WBS_DivisionProject
|
||||
where x.CNProfessionalId == c.CNProfessionalId && x.ProjectId == this.CurrUser.LoginProjectId && x.SuperDivisionId == null && x.UnitWorkId == unitWorkId
|
||||
where x.CNProfessionalId == c.CNProfessionalId && x.ProjectId == this.ProjectId && x.SuperDivisionId == null && x.UnitWorkId == unitWorkId
|
||||
orderby x.SortIndex
|
||||
select x).ToList();
|
||||
foreach (var q in divisions)
|
||||
@@ -837,7 +887,7 @@ namespace FineUIPro.Web.CQMS.WBS
|
||||
newNode4.Checked = true;
|
||||
}
|
||||
var division1s = (from x in BLL.Funs.DB.WBS_DivisionProject
|
||||
where x.ProjectId == this.CurrUser.LoginProjectId && x.SuperDivisionId == q.DivisionProjectId
|
||||
where x.ProjectId == this.ProjectId && x.SuperDivisionId == q.DivisionProjectId
|
||||
orderby x.SortIndex
|
||||
select x).ToList();
|
||||
if (list.Contains(q.DivisionProjectId))
|
||||
@@ -853,7 +903,7 @@ namespace FineUIPro.Web.CQMS.WBS
|
||||
newNode5.EnableClickEvent = true;
|
||||
newNode4.Nodes.Add(newNode5);
|
||||
var division2s = (from x in BLL.Funs.DB.WBS_DivisionProject
|
||||
where x.ProjectId == this.CurrUser.LoginProjectId && x.SuperDivisionId == division1.DivisionProjectId
|
||||
where x.ProjectId == this.ProjectId && x.SuperDivisionId == division1.DivisionProjectId
|
||||
orderby x.SortIndex
|
||||
select x).ToList();
|
||||
if (list.Contains(division1.DivisionProjectId))
|
||||
@@ -869,7 +919,7 @@ namespace FineUIPro.Web.CQMS.WBS
|
||||
newNode6.EnableClickEvent = true;
|
||||
newNode5.Nodes.Add(newNode6);
|
||||
var division3s = (from x in BLL.Funs.DB.WBS_DivisionProject
|
||||
where x.ProjectId == this.CurrUser.LoginProjectId && x.SuperDivisionId == division2.DivisionProjectId
|
||||
where x.ProjectId == this.ProjectId && x.SuperDivisionId == division2.DivisionProjectId
|
||||
orderby x.SortIndex
|
||||
select x).ToList();
|
||||
if (list.Contains(division2.DivisionProjectId))
|
||||
@@ -999,7 +1049,7 @@ namespace FineUIPro.Web.CQMS.WBS
|
||||
{
|
||||
return;
|
||||
}
|
||||
var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.ProjectControlPointMenuId);
|
||||
var buttonList = BLL.CommonService.GetAllButtonList(this.ProjectId, this.CurrUser.UserId, BLL.Const.ProjectControlPointMenuId);
|
||||
if (buttonList.Count() > 0)
|
||||
{
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user