专项检查
This commit is contained in:
@@ -254,148 +254,31 @@ namespace FineUIPro.Web.HSSE.Check
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 编辑
|
||||
/// <summary>
|
||||
/// 编辑按钮
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnMenuModify_Click(object sender, EventArgs e)
|
||||
#region 删除
|
||||
protected void btnMenuDel_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (Grid1.SelectedRowIndexArray.Length == 0)
|
||||
if (Grid1.SelectedRowIndexArray.Length > 0)
|
||||
{
|
||||
Alert.ShowInTop("请至少选择一条记录!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
string RegistrationId = Grid1.SelectedRowID;
|
||||
var registration = BLL.HSSE_Hazard_HazardRegisterService.GetHazardRegisterByHazardRegisterId(RegistrationId);
|
||||
if (registration != null)
|
||||
{
|
||||
if (registration.States == Const.State_1) //待整改
|
||||
foreach (int rowIndex in Grid1.SelectedRowIndexArray)
|
||||
{
|
||||
if (registration.CheckManId == this.CurrUser.UserId) //当前人是检查人,可以在整改前继续编辑
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
string rowID = Grid1.DataKeys[rowIndex][0].ToString();
|
||||
Model.Inspect_InspectionItem item = db.Inspect_InspectionItem.FirstOrDefault(x => x.InspectionItemId == rowID);
|
||||
if (item != null)
|
||||
{
|
||||
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("HiddenRectificationAdd.aspx?HazardRegisterId={0}", RegistrationId, "编辑 - ")));
|
||||
}
|
||||
else
|
||||
{
|
||||
Alert.ShowInTop("您不是记录检查人,无法编辑!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
}
|
||||
else if (registration.States == Const.State_2) //已整改待确认
|
||||
{
|
||||
if (registration.ResponsibleMan == this.CurrUser.UserId) //当前人是责任人,可以在确认前继续编辑
|
||||
{
|
||||
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("HiddenRectificationRectify.aspx?HazardRegisterId={0}", RegistrationId, "编辑 - ")));
|
||||
}
|
||||
else
|
||||
{
|
||||
Alert.ShowInTop("您不是记录责任人,无法编辑!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
}
|
||||
else if (registration.States == Const.State_3) //已闭环
|
||||
{
|
||||
Alert.ShowInTop("该记录已闭环,无法编辑!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 整改
|
||||
/// <summary>
|
||||
/// 整改按钮
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnMenuRectify_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (Grid1.SelectedRowIndexArray.Length == 0)
|
||||
{
|
||||
Alert.ShowInTop("请至少选择一条记录!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
string RegistrationId = Grid1.SelectedRowID;
|
||||
var registration = BLL.HSSE_Hazard_HazardRegisterService.GetHazardRegisterByCheckItemDetailId(RegistrationId);
|
||||
if (registration != null)
|
||||
{
|
||||
if (registration.States == "1") //待整改
|
||||
{
|
||||
if (registration.ResponsibleMan == this.CurrUser.UserId) //当前人是责任人,可以进行整改操作
|
||||
{
|
||||
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("../HiddenInspection/HiddenRectificationRectify.aspx?HazardRegisterId={0}", registration.HazardRegisterId, "编辑 - ")));
|
||||
}
|
||||
else
|
||||
{
|
||||
Alert.ShowInTop("您不是记录责任人,无法整改!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
db.Inspect_InspectionItem.DeleteOnSubmit(item);
|
||||
db.SubmitChanges();
|
||||
int count = db.Inspect_Inspection.Count(x => x.InspectionId == item.InspectionId);
|
||||
if (count == 0)
|
||||
{
|
||||
db.Inspect_Inspection.DeleteOnSubmit(db.Inspect_Inspection.FirstOrDefault(x => x.InspectionId == item.InspectionId));
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Alert.ShowInTop("该记录不是待整改状态,无法进行整改操作!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 确认
|
||||
/// <summary>
|
||||
/// 确认按钮
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnMenuConfirm_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (Grid1.SelectedRowIndexArray.Length == 0)
|
||||
{
|
||||
Alert.ShowInTop("请至少选择一条记录!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
string RegistrationId = Grid1.SelectedRowID;
|
||||
var registration = BLL.HSSE_Hazard_HazardRegisterService.GetHazardRegisterByCheckItemDetailId(RegistrationId);
|
||||
if (registration != null)
|
||||
{
|
||||
if (registration.States == Const.State_2) //待确认
|
||||
{
|
||||
if (registration.CheckManId == this.CurrUser.UserId) //当前人是检查人,可以进行确认操作
|
||||
{
|
||||
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("../HiddenInspection/HiddenRectificationConfirm.aspx?HazardRegisterId={0}", registration.HazardRegisterId, "编辑 - ")));
|
||||
}
|
||||
else
|
||||
{
|
||||
Alert.ShowInTop("您不是记录检查人,无法确认!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Alert.ShowInTop("该记录不是待确认状态,无法进行确认操作!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 编制
|
||||
/// <summary>
|
||||
/// 编制
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnNew_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (BLL.CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.HSSE_HiddenRectificationListMenuId, BLL.Const.BtnAdd))
|
||||
{
|
||||
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("../HiddenInspection/HiddenRectificationAdd.aspx", "登记 - ")));
|
||||
}
|
||||
else
|
||||
{
|
||||
Alert.ShowInTop("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
BindGrid();
|
||||
ShowNotify("删除数据成功!");
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
@@ -612,8 +495,18 @@ namespace FineUIPro.Web.HSSE.Check
|
||||
{
|
||||
return;
|
||||
}
|
||||
var buttonList = CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, Const.HSSE_HiddenRectificationListMenuId);
|
||||
|
||||
var buttonList = CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, "C7481FEE-EA92-44B8-99F6-C5CA6BBDCFF5");
|
||||
if (buttonList.Count() > 0)
|
||||
{
|
||||
if (buttonList.Contains(BLL.Const.BtnSee))
|
||||
{
|
||||
this.btnMenuSee.Hidden = false;
|
||||
}
|
||||
if (buttonList.Contains(BLL.Const.BtnDelete))
|
||||
{
|
||||
this.btnMenuDel.Hidden = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
Reference in New Issue
Block a user