安全检查,补充公司级树
This commit is contained in:
@@ -42,12 +42,8 @@ namespace FineUIPro.Web.HSSE.Emergency
|
||||
{
|
||||
this.ProjectId = Request.Params["projectId"];
|
||||
}
|
||||
BLL.UnitService.InitUnitDropDownList(this.drpUnitId, this.ProjectId, true);
|
||||
if (BLL.ProjectUnitService.GetProjectUnitTypeByProjectIdUnitId(this.ProjectId, this.CurrUser.UnitId))
|
||||
{
|
||||
this.drpUnitId.SelectedValue = this.CurrUser.UnitId;
|
||||
this.drpUnitId.Enabled = false;
|
||||
}
|
||||
this.InitDropDownList();
|
||||
|
||||
this.btnNew.OnClientClick = Window1.GetShowReference("EmergencyListEdit.aspx") + "return false;";
|
||||
if (this.CurrUser != null && this.CurrUser.PageSize.HasValue)
|
||||
{
|
||||
@@ -55,14 +51,44 @@ namespace FineUIPro.Web.HSSE.Emergency
|
||||
}
|
||||
this.ddlPageSize.SelectedValue = Grid1.PageSize.ToString();
|
||||
// 绑定表格
|
||||
this.BindGrid();
|
||||
this.BindGrid();
|
||||
}
|
||||
}
|
||||
private void InitDropDownList()
|
||||
{
|
||||
BLL.UnitService.InitUnitDropDownList(this.drpUnitId, this.ProjectId, true);
|
||||
if (BLL.ProjectUnitService.GetProjectUnitTypeByProjectIdUnitId(this.ProjectId, this.CurrUser.UnitId))
|
||||
{
|
||||
this.drpUnitId.SelectedValue = this.CurrUser.UnitId;
|
||||
this.drpUnitId.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>
|
||||
private void BindGrid()
|
||||
{
|
||||
if (string.IsNullOrEmpty(this.ProjectId))
|
||||
{
|
||||
return;
|
||||
}
|
||||
string strSql = @"SELECT EmergencyList.EmergencyListId,EmergencyList.ProjectId,CodeRecords.Code AS EmergencyCode,EmergencyList.UnitId,EmergencyList.EmergencyName,EmergencyList.CompileDate,EmergencyList.CompileMan,Users.UserName AS CompileManName,EmergencyType.EmergencyTypeName,EmergencyList.VersionCode,Unit.UnitName,EmergencyList.States,AuditMan.UserName AS AuditMan,ApproveMan.UserName AS ApproveMan "
|
||||
+ @" ,(CASE WHEN EmergencyList.States = " + BLL.Const.State_0 + " OR EmergencyList.States IS NULL THEN '待['+OperateUser.UserName+']提交' WHEN EmergencyList.States = " + BLL.Const.State_2 + " THEN '审核/审批完成' ELSE '待['+OperateUser.UserName+']办理' END) AS FlowOperateName"
|
||||
+ @" FROM Emergency_EmergencyList AS EmergencyList "
|
||||
@@ -80,19 +106,19 @@ namespace FineUIPro.Web.HSSE.Emergency
|
||||
{
|
||||
listStr.Add(new SqlParameter("@ProjectId", Request.Params["projectId"]));
|
||||
strSql += " AND EmergencyList.States = @States"; ///状态为已完成
|
||||
listStr.Add(new SqlParameter("@States", BLL.Const.State_2));
|
||||
listStr.Add(new SqlParameter("@States", BLL.Const.State_2));
|
||||
}
|
||||
else
|
||||
{
|
||||
listStr.Add(new SqlParameter("@ProjectId", this.CurrUser.LoginProjectId));
|
||||
listStr.Add(new SqlParameter("@ProjectId", this.ProjectId));
|
||||
}
|
||||
|
||||
|
||||
if (!string.IsNullOrEmpty(this.txtEmergencyCode.Text.Trim()))
|
||||
{
|
||||
strSql += " AND EmergencyCode LIKE @EmergencyCode";
|
||||
listStr.Add(new SqlParameter("@EmergencyCode", "%" + this.txtEmergencyCode.Text.Trim() + "%"));
|
||||
}
|
||||
if (this.drpUnitId.SelectedValue != BLL.Const._Null)
|
||||
if (this.drpUnitId.SelectedValue != null && this.drpUnitId.SelectedValue != BLL.Const._Null)
|
||||
{
|
||||
strSql += " AND EmergencyList.UnitId = @UnitId";
|
||||
listStr.Add(new SqlParameter("@UnitId", this.drpUnitId.SelectedValue.Trim()));
|
||||
@@ -104,7 +130,7 @@ namespace FineUIPro.Web.HSSE.Emergency
|
||||
}
|
||||
SqlParameter[] parameter = listStr.ToArray();
|
||||
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
|
||||
Grid1.RecordCount = tb.Rows.Count;
|
||||
Grid1.RecordCount = tb.Rows.Count;
|
||||
var table = this.GetPagedDataTable(Grid1, tb);
|
||||
Grid1.DataSource = table;
|
||||
Grid1.DataBind();
|
||||
@@ -193,13 +219,13 @@ namespace FineUIPro.Web.HSSE.Emergency
|
||||
{
|
||||
if (this.btnMenuEdit.Hidden) ////双击事件 编辑权限有:编辑页面,无:查看页面 或者状态是完成时查看页面
|
||||
{
|
||||
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("EmergencyListView.aspx?EmergencyListId={0}", id, "查看 - ")));
|
||||
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("EmergencyListView.aspx?EmergencyListId={0}", id, "查看 - ")));
|
||||
}
|
||||
else
|
||||
{
|
||||
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("EmergencyListEdit.aspx?EmergencyListId={0}", id, "编辑 - ")));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
@@ -212,7 +238,7 @@ namespace FineUIPro.Web.HSSE.Emergency
|
||||
protected void btnMenuDelete_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (Grid1.SelectedRowIndexArray.Length > 0)
|
||||
{
|
||||
{
|
||||
foreach (int rowIndex in Grid1.SelectedRowIndexArray)
|
||||
{
|
||||
string rowID = Grid1.DataKeys[rowIndex][0].ToString();
|
||||
@@ -224,13 +250,13 @@ namespace FineUIPro.Web.HSSE.Emergency
|
||||
BLL.EmergencyListService.DeleteEmergencyListById(rowID);
|
||||
}
|
||||
}
|
||||
//Project_HSSEData_HSSEService.StatisticalData(this.CurrUser.LoginProjectId, Project_HSSEData_HSSEService.HSSEDateType.EmergencyManagement);
|
||||
//Project_HSSEData_HSSEService.StatisticalData(this.ProjectId, Project_HSSEData_HSSEService.HSSEDateType.EmergencyManagement);
|
||||
this.BindGrid();
|
||||
ShowNotify("删除数据成功!", MessageBoxIcon.Success);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
#region 获取按钮权限
|
||||
/// <summary>
|
||||
/// 获取按钮权限
|
||||
@@ -243,7 +269,7 @@ namespace FineUIPro.Web.HSSE.Emergency
|
||||
{
|
||||
return;
|
||||
}
|
||||
var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.ProjectEmergencyListMenuId);
|
||||
var buttonList = BLL.CommonService.GetAllButtonList(this.ProjectId, this.CurrUser.UserId, BLL.Const.ProjectEmergencyListMenuId);
|
||||
if (buttonList.Count() > 0)
|
||||
{
|
||||
if (buttonList.Contains(BLL.Const.BtnAdd))
|
||||
|
||||
Reference in New Issue
Block a user