安全检查补充公司级树
This commit is contained in:
+53
-27
@@ -7,7 +7,6 @@ using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using BLL;
|
||||
using Microsoft.Office.Interop.Excel;
|
||||
|
||||
namespace FineUIPro.Web.Customization.ZJ.HSSE.HiddenInspection
|
||||
{
|
||||
@@ -33,14 +32,21 @@ namespace FineUIPro.Web.Customization.ZJ.HSSE.HiddenInspection
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
////权限按钮方法
|
||||
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.ProjectId))
|
||||
{
|
||||
this.panelLeftRegion.Hidden = true;
|
||||
////权限按钮方法
|
||||
this.GetButtonPower();
|
||||
}
|
||||
this.btnNew.OnClientClick = Window1.GetShowReference("SuperviseCheckEdit.aspx?Type=0") + "return false;";
|
||||
if (this.CurrUser != null && this.CurrUser.PageSize.HasValue)
|
||||
{
|
||||
@@ -50,7 +56,23 @@ namespace FineUIPro.Web.Customization.ZJ.HSSE.HiddenInspection
|
||||
// 绑定表格
|
||||
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();
|
||||
}
|
||||
#region 获取按钮权限
|
||||
/// <summary>
|
||||
@@ -64,12 +86,12 @@ namespace FineUIPro.Web.Customization.ZJ.HSSE.HiddenInspection
|
||||
{
|
||||
return;
|
||||
}
|
||||
var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.SuperviseCheckMenuId);
|
||||
var buttonList = BLL.CommonService.GetAllButtonList(this.ProjectId, this.CurrUser.UserId, BLL.Const.SuperviseCheckMenuId);
|
||||
if (buttonList.Count() > 0)
|
||||
{
|
||||
if (buttonList.Contains(BLL.Const.BtnAdd))
|
||||
{
|
||||
this.btnNew.Hidden = false;
|
||||
this.btnNew.Hidden = false;
|
||||
}
|
||||
if (buttonList.Contains(BLL.Const.BtnModify))
|
||||
{
|
||||
@@ -80,7 +102,7 @@ namespace FineUIPro.Web.Customization.ZJ.HSSE.HiddenInspection
|
||||
this.btnMenuDelete.Hidden = false;
|
||||
}
|
||||
}
|
||||
if (!string.IsNullOrEmpty(this.CurrUser.LoginProjectId))
|
||||
if (!string.IsNullOrEmpty(this.ProjectId))
|
||||
{
|
||||
this.btnNew.Hidden = true;
|
||||
}
|
||||
@@ -122,31 +144,35 @@ namespace FineUIPro.Web.Customization.ZJ.HSSE.HiddenInspection
|
||||
protected void Window1_Close(object sender, WindowCloseEventArgs e)
|
||||
{
|
||||
BindGrid();
|
||||
}
|
||||
}
|
||||
|
||||
#region 加载数据
|
||||
protected void BindGrid()
|
||||
{
|
||||
var result=(from supervise in Funs.DB.ZJ_SuperviseCheck
|
||||
join project in Funs.DB.Base_Project on supervise.ProjectId equals project.ProjectId
|
||||
join user in Funs.DB.Sys_User on supervise.RecUserId equals user.UserId
|
||||
select new
|
||||
{
|
||||
supervise.SuperviseCheckId,
|
||||
project.ProjectName,
|
||||
project.ProjectId,
|
||||
supervise.SuperviseCheckReportCode,
|
||||
user.UserName,
|
||||
supervise.CheckDate,
|
||||
State=supervise.State==0?"未提交": supervise.State == 1 ? "未整改" : supervise.State == 2 ? "部分整改" : supervise.State == 3 ? "已整改" : "",
|
||||
supervise.CheckTeam,
|
||||
|
||||
}).ToList();
|
||||
if (!string .IsNullOrEmpty(this.CurrUser.LoginProjectId))
|
||||
if (string.IsNullOrEmpty(this.ProjectId))
|
||||
{
|
||||
result=result.Where(p=>p.ProjectId==this.CurrUser.LoginProjectId).ToList();
|
||||
return;
|
||||
}
|
||||
Grid1.RecordCount = result.Count;
|
||||
var result = (from supervise in Funs.DB.ZJ_SuperviseCheck
|
||||
join project in Funs.DB.Base_Project on supervise.ProjectId equals project.ProjectId
|
||||
join user in Funs.DB.Sys_User on supervise.RecUserId equals user.UserId
|
||||
select new
|
||||
{
|
||||
supervise.SuperviseCheckId,
|
||||
project.ProjectName,
|
||||
project.ProjectId,
|
||||
supervise.SuperviseCheckReportCode,
|
||||
user.UserName,
|
||||
supervise.CheckDate,
|
||||
State = supervise.State == 0 ? "未提交" : supervise.State == 1 ? "未整改" : supervise.State == 2 ? "部分整改" : supervise.State == 3 ? "已整改" : "",
|
||||
supervise.CheckTeam,
|
||||
|
||||
}).ToList();
|
||||
if (!string.IsNullOrEmpty(this.ProjectId))
|
||||
{
|
||||
result = result.Where(p => p.ProjectId == this.ProjectId).ToList();
|
||||
}
|
||||
Grid1.RecordCount = result.Count;
|
||||
Grid1.DataSource = this.GetPagedDataTable(Grid1, Funs.LINQToDataTable(result));
|
||||
Grid1.DataBind();
|
||||
|
||||
@@ -220,7 +246,7 @@ namespace FineUIPro.Web.Customization.ZJ.HSSE.HiddenInspection
|
||||
{
|
||||
string rowID = Grid1.DataKeys[rowIndex][0].ToString();
|
||||
var getV = SupervisecheckService.GetZJ_SuperviseCheckById(rowID);
|
||||
if (getV.State !=0)
|
||||
if (getV.State != 0)
|
||||
{
|
||||
ShowNotify("只能删除待提交的数据!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user