补充公司级别树
This commit is contained in:
@@ -11,6 +11,23 @@ namespace FineUIPro.Web.HSSE.QualityAudit
|
||||
{
|
||||
public partial class InUnit : PageBase
|
||||
{
|
||||
#region 项目主键
|
||||
/// <summary>
|
||||
/// 项目主键
|
||||
/// </summary>
|
||||
public string ProjectId
|
||||
{
|
||||
get
|
||||
{
|
||||
return (string)ViewState["ProjectId"];
|
||||
}
|
||||
set
|
||||
{
|
||||
ViewState["ProjectId"] = value;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 加载
|
||||
/// <summary>
|
||||
/// 加载页面
|
||||
@@ -21,8 +38,20 @@ namespace FineUIPro.Web.HSSE.QualityAudit
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
////权限按钮方法
|
||||
this.GetButtonPower();
|
||||
Funs.DropDownPageSize(this.ddlPageSize);
|
||||
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.CurrUser.LoginProjectId))
|
||||
{
|
||||
this.panelLeftRegion.Hidden = true;
|
||||
////权限按钮方法
|
||||
this.GetButtonPower();
|
||||
}
|
||||
this.btnNew.OnClientClick = Window1.GetShowReference("InUnitEdit.aspx") + "return false;";
|
||||
if (this.CurrUser != null && this.CurrUser.PageSize.HasValue)
|
||||
{
|
||||
@@ -33,11 +62,33 @@ namespace FineUIPro.Web.HSSE.QualityAudit
|
||||
this.BindGrid();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 公司级树加载
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void changeTree(object sender, EventArgs e)
|
||||
{
|
||||
this.ProjectId = this.ucTree.ProjectId;
|
||||
this.BindGrid();
|
||||
|
||||
this.GetButtonPower();
|
||||
if (string.IsNullOrEmpty(this.CurrUser.LoginProjectId))
|
||||
{
|
||||
btnNew.Hidden = true;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 绑定数据
|
||||
/// </summary>
|
||||
private void BindGrid()
|
||||
{
|
||||
if (string.IsNullOrEmpty(this.ProjectId))
|
||||
{
|
||||
return;
|
||||
}
|
||||
string strSql = @"SELECT InUnit.InUnitId,"
|
||||
+ @"InUnit.ProjectId,"
|
||||
+ @"CodeRecords.Code AS InUnitCode,"
|
||||
@@ -63,10 +114,10 @@ namespace FineUIPro.Web.HSSE.QualityAudit
|
||||
+ @" LEFT JOIN Sys_CodeRecords AS CodeRecords ON InUnit.InUnitId = CodeRecords.DataId "
|
||||
+ @" LEFT JOIN Sys_User AS Users ON InUnit.CompileMan = Users.UserId WHERE 1=1 ";
|
||||
List<SqlParameter> listStr = new List<SqlParameter>();
|
||||
if (!string.IsNullOrEmpty(this.CurrUser.LoginProjectId)) ///是否文件柜查看页面传项目值
|
||||
if (!string.IsNullOrEmpty(this.ProjectId)) ///是否文件柜查看页面传项目值
|
||||
{
|
||||
strSql += " AND InUnit.ProjectId = @ProjectId";
|
||||
listStr.Add(new SqlParameter("@ProjectId", this.CurrUser.LoginProjectId));
|
||||
listStr.Add(new SqlParameter("@ProjectId", this.ProjectId));
|
||||
}
|
||||
if (!string.IsNullOrEmpty(this.txtInUnitCode.Text.Trim()))
|
||||
{
|
||||
@@ -234,7 +285,7 @@ namespace FineUIPro.Web.HSSE.QualityAudit
|
||||
/// <returns></returns>
|
||||
private void GetButtonPower()
|
||||
{
|
||||
var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.InUnitMenuId);
|
||||
var buttonList = BLL.CommonService.GetAllButtonList(this.ProjectId, this.CurrUser.UserId, BLL.Const.InUnitMenuId);
|
||||
if (buttonList.Count() > 0)
|
||||
{
|
||||
if (buttonList.Contains(BLL.Const.BtnAdd))
|
||||
|
||||
Reference in New Issue
Block a user