补充公司级别树

This commit is contained in:
2025-04-11 18:02:46 +08:00
parent fc7601612a
commit 96899ce306
28 changed files with 1777 additions and 939 deletions
@@ -9,6 +9,22 @@ namespace FineUIPro.Web.Comprehensive
{
public partial class FinalFile : PageBase
{
#region
/// <summary>
/// 项目主键
/// </summary>
public string ProjectId
{
get
{
return (string)ViewState["ProjectId"];
}
set
{
ViewState["ProjectId"] = value;
}
}
#endregion
#region
/// <summary>
/// 加载页面
@@ -19,28 +35,66 @@ namespace FineUIPro.Web.Comprehensive
{
if (!IsPostBack)
{
GetButtonPower();
BLL.UnitService.InitUnitDownList(this.sdrpUnitId, this.CurrUser.LoginProjectId, true);
var punit = ProjectUnitService.GetProjectUnitByUnitIdProjectId(this.CurrUser.LoginProjectId, this.CurrUser.UnitId);
if (CurrUser.UserId == Const.sysglyId || CommonService.GetProjectUnitType(this.CurrUser.LoginProjectId, this.CurrUser.UnitId) == BLL.Const.ProjectUnitType_1 || (punit != null && punit.UnitType == Const.ProjectUnitType_3))
this.ProjectId = this.CurrUser.LoginProjectId;
if (!string.IsNullOrEmpty(Request.Params["projectId"]) && Request.Params["projectId"] != this.CurrUser.LoginProjectId)
{
BLL.UnitService.InitUnitDownList(this.sdrpUnitId, this.CurrUser.LoginProjectId, true);
this.ProjectId = Request.Params["projectId"];
}
else
this.InitDropDownList();
this.ucTree.UnitId = this.CurrUser.UnitId;
this.ucTree.ProjectId = this.ProjectId;
if (!string.IsNullOrEmpty(this.ProjectId))
{
sdrpUnitId.SelectedValue = this.CurrUser.UnitId;
sdrpUnitId.Enabled = false;
this.panelLeftRegion.Hidden = true;
////权限按钮方法
this.GetButtonPower();
}
BindGrid();
}
}
private void InitDropDownList()
{
BLL.UnitService.InitUnitDownList(this.sdrpUnitId, this.ProjectId, true);
var punit = ProjectUnitService.GetProjectUnitByUnitIdProjectId(this.ProjectId, this.CurrUser.UnitId);
if (CurrUser.UserId == Const.sysglyId || CommonService.GetProjectUnitType(this.ProjectId, this.CurrUser.UnitId) == BLL.Const.ProjectUnitType_1 || (punit != null && punit.UnitType == Const.ProjectUnitType_3))
{
BLL.UnitService.InitUnitDownList(this.sdrpUnitId, this.ProjectId, true);
}
else
{
sdrpUnitId.SelectedValue = this.CurrUser.UnitId;
sdrpUnitId.Enabled = false;
}
}
/// <summary>
/// 公司级树加载
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void changeTree(object sender, EventArgs e)
{
this.ProjectId = this.ucTree.ProjectId;
this.InitDropDownList();
if (string.IsNullOrEmpty(this.CurrUser.LoginProjectId))
{
btnNew.Hidden = true;
}
this.GetButtonPower();
this.BindGrid();
}
/// <summary>
/// 数据绑定
/// </summary>
public void BindGrid()
{
if (string.IsNullOrEmpty(this.ProjectId))
{
return;
}
string strSql = @"SELECT FinalFileId
, a.ProjectId
, a.UnitId
@@ -54,8 +108,8 @@ namespace FineUIPro.Web.Comprehensive
FROM dbo.Comprehensive_FinalFile a left join Base_Unit b on a.unitId=b.UnitId
where a.ProjectId= @ProjectId";
List<SqlParameter> listStr = new List<SqlParameter>();
listStr.Add(new SqlParameter("@ProjectId", this.CurrUser.LoginProjectId));
if (sdrpUnitId.SelectedValue != BLL.Const._Null)
listStr.Add(new SqlParameter("@ProjectId", this.ProjectId));
if (this.sdrpUnitId.SelectedValue != null && this.sdrpUnitId.SelectedValue != BLL.Const._Null)
{
strSql += " AND a.UnitId=@UnitId";
listStr.Add(new SqlParameter("@UnitId", sdrpUnitId.SelectedValue));
@@ -215,7 +269,7 @@ namespace FineUIPro.Web.Comprehensive
{
return;
}
var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.FinalFileMenuId);
var buttonList = BLL.CommonService.GetAllButtonList(this.ProjectId, this.CurrUser.UserId, BLL.Const.FinalFileMenuId);
if (buttonList.Count() > 0)
{
if (buttonList.Contains(BLL.Const.BtnAdd))