公司级树补充

This commit is contained in:
2025-04-11 11:33:48 +08:00
parent ae90319ee4
commit 2a876b4c2f
21 changed files with 1332 additions and 662 deletions
@@ -1,34 +1,27 @@
using BLL;
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using static System.Runtime.CompilerServices.RuntimeHelpers;
using System.Xml.Linq;
namespace FineUIPro.Web.ThreeYearAction.ConstructionStandardization
{
public partial class BenchmarkWorkSite : PageBase
{
#region
///// <summary>
///// 项目主键
///// </summary>
//public string ProjectId
//{
// get
// {
// return (string)ViewState["ProjectId"];
// }
// set
// {
// ViewState["ProjectId"] = value;
// }
//}
/// <summary>
/// 项目主键
/// </summary>
public string ProjectId
{
get
{
return (string)ViewState["ProjectId"];
}
set
{
ViewState["ProjectId"] = value;
}
}
#endregion
#region
@@ -42,24 +35,56 @@ namespace FineUIPro.Web.ThreeYearAction.ConstructionStandardization
if (!IsPostBack)
{
Funs.DropDownPageSize(this.ddlPageSize);
this.ProjectId = this.ProjectId;
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.btnNew.OnClientClick = Window1.GetShowReference("BenchmarkWorkSiteEdit.aspx") + "return false;";
if (this.CurrUser != null && this.CurrUser.PageSize.HasValue)
{
Grid1.PageSize = this.CurrUser.PageSize.Value;
}
this.ddlPageSize.SelectedValue = Grid1.PageSize.ToString();
////权限按钮方法
this.GetButtonPower();
// 绑定表格
this.BindGrid();
}
}
/// <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.BindGrid();
}
/// <summary>
/// 绑定数据
/// </summary>
private void BindGrid()
{
if (string.IsNullOrEmpty(this.ProjectId))
{
return;
}
var db = Funs.DB;
var queryData = from x in db.ConstructionStandardization_BenchmarkWorkSite
join pro in db.Base_Project on x.ProjectId equals pro.ProjectId
@@ -67,10 +92,8 @@ namespace FineUIPro.Web.ThreeYearAction.ConstructionStandardization
join un2 in db.Base_Unit on x.Supervisor equals un2.UnitId
join un3 in db.Base_Unit on x.Owner equals un3.UnitId
join y in db.Sys_User on x.CompileMan equals y.UserId
where
//x.ProjectId == this.ProjectId
//&&
(string.IsNullOrEmpty(txtCode.Text.Trim()) || x.Code.Contains(txtCode.Text.Trim()))
where x.ProjectId == this.ProjectId
&& (string.IsNullOrEmpty(txtCode.Text.Trim()) || x.Code.Contains(txtCode.Text.Trim()))
&& (string.IsNullOrEmpty(txtName.Text.Trim()) || x.Name.Contains(txtName.Text.Trim()))
&& (string.IsNullOrEmpty(txtProjectName.Text.Trim()) || pro.ProjectName.Contains(txtProjectName.Text.Trim()))
select new
@@ -222,7 +245,7 @@ namespace FineUIPro.Web.ThreeYearAction.ConstructionStandardization
return;
}
var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.BenchmarkWorkSiteMenuId);
var buttonList = BLL.CommonService.GetAllButtonList(this.ProjectId, this.CurrUser.UserId, BLL.Const.BenchmarkWorkSiteMenuId);
if (buttonList.Count() > 0)
{
if (buttonList.Contains(BLL.Const.BtnAdd))