2022-03-15 17:36:38 +08:00
|
|
|
|
using BLL;
|
2023-04-28 17:26:38 +08:00
|
|
|
|
using NPOI.SS.Formula.Functions;
|
2022-03-15 17:36:38 +08:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Configuration;
|
|
|
|
|
using System.Data;
|
|
|
|
|
using System.Data.SqlClient;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using AspNet = System.Web.UI.WebControls;
|
|
|
|
|
|
|
|
|
|
namespace FineUIPro.Web.HSSE.HiddenInspection
|
|
|
|
|
{
|
|
|
|
|
public partial class HiddenRectificationList : PageBase
|
|
|
|
|
{
|
|
|
|
|
#region 定义项
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// GV被选择项列表
|
|
|
|
|
/// </summary>
|
|
|
|
|
public List<string> ItemSelectedList
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return (List<string>)ViewState["ItemSelectedList"];
|
|
|
|
|
}
|
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
ViewState["ItemSelectedList"] = value;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 加载页面
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 加载页面
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="sender"></param>
|
|
|
|
|
/// <param name="e"></param>
|
|
|
|
|
protected void Page_Load(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
if (!IsPostBack)
|
|
|
|
|
{
|
|
|
|
|
Funs.DropDownPageSize(this.ddlPageSize);
|
|
|
|
|
GetButtonPower();
|
|
|
|
|
this.ItemSelectedList = new List<string>();
|
|
|
|
|
ddlPageSize.SelectedValue = Grid1.PageSize.ToString();
|
|
|
|
|
this.drpStates.DataValueField = "Id";
|
|
|
|
|
this.drpStates.DataTextField = "Name";
|
|
|
|
|
List<Model.HandleStep> handleSteps = new List<Model.HandleStep>();
|
|
|
|
|
Model.HandleStep handleStep1 = new Model.HandleStep();
|
|
|
|
|
handleStep1.Id = "1";
|
2023-04-28 17:26:38 +08:00
|
|
|
|
handleStep1.Name = "未整改";
|
2022-03-15 17:36:38 +08:00
|
|
|
|
handleSteps.Add(handleStep1);
|
|
|
|
|
Model.HandleStep handleStep2 = new Model.HandleStep();
|
|
|
|
|
handleStep2.Id = "2";
|
2023-04-28 17:26:38 +08:00
|
|
|
|
handleStep2.Name = "按时整改";
|
2022-03-15 17:36:38 +08:00
|
|
|
|
handleSteps.Add(handleStep2);
|
|
|
|
|
Model.HandleStep handleStep3 = new Model.HandleStep();
|
|
|
|
|
handleStep3.Id = "3";
|
2023-04-28 17:26:38 +08:00
|
|
|
|
handleStep3.Name = "超期整改";
|
2022-03-15 17:36:38 +08:00
|
|
|
|
handleSteps.Add(handleStep3);
|
2023-04-28 17:26:38 +08:00
|
|
|
|
Model.HandleStep handleStep4 = new Model.HandleStep();
|
|
|
|
|
handleStep4.Id = "4";
|
|
|
|
|
handleStep4.Name = "超期未整改";
|
|
|
|
|
handleSteps.Add(handleStep4);
|
2023-05-21 17:23:24 +08:00
|
|
|
|
Model.HandleStep handleStep5 = new Model.HandleStep();
|
|
|
|
|
handleStep5.Id = "-1";
|
|
|
|
|
handleStep5.Name = "作废";
|
|
|
|
|
handleSteps.Add(handleStep5);
|
2022-03-15 17:36:38 +08:00
|
|
|
|
this.drpStates.DataSource = handleSteps; ;
|
|
|
|
|
this.drpStates.DataBind();
|
2023-05-21 17:23:24 +08:00
|
|
|
|
this.drpStates.SelectedValue = "1";
|
2022-03-15 17:36:38 +08:00
|
|
|
|
ListItem[] ProblemTypes = new ListItem[2];
|
|
|
|
|
ProblemTypes[0] = new ListItem("日常巡检", "1");
|
|
|
|
|
ProblemTypes[1] = new ListItem("专项巡检", "2");
|
|
|
|
|
this.drpProblemTypes.DataValueField = "Value";
|
|
|
|
|
this.drpProblemTypes.DataTextField = "Text";
|
|
|
|
|
this.drpProblemTypes.DataSource = ProblemTypes;
|
|
|
|
|
this.drpProblemTypes.DataBind();
|
2022-12-20 09:32:32 +08:00
|
|
|
|
Funs.FineUIPleaseSelect(this.drpProblemTypes, "按检查类型");
|
2022-03-15 17:36:38 +08:00
|
|
|
|
// 绑定表格
|
|
|
|
|
BindGrid();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 绑定数据
|
|
|
|
|
/// </summary>
|
|
|
|
|
private void BindGrid()
|
|
|
|
|
{
|
2022-12-20 09:32:32 +08:00
|
|
|
|
string strSql = "SELECT * FROM View_Hazard_HazardRegister WHERE ProblemTypes ='1' "; //ProblemTypes in ('1' ,'2')
|
2022-03-15 17:36:38 +08:00
|
|
|
|
List<SqlParameter> listStr = new List<SqlParameter>();
|
|
|
|
|
if (!string.IsNullOrEmpty(this.CurrUser.LoginProjectId))
|
|
|
|
|
{
|
|
|
|
|
strSql += " AND ProjectId = @ProjectId";
|
|
|
|
|
listStr.Add(new SqlParameter("@ProjectId", this.CurrUser.LoginProjectId));
|
|
|
|
|
}
|
|
|
|
|
if (!string.IsNullOrEmpty(this.txtCheckMan.Text.Trim()))
|
|
|
|
|
{
|
|
|
|
|
strSql += " AND CheckManName LIKE @CheckMan";
|
|
|
|
|
listStr.Add(new SqlParameter("@CheckMan", "%" + this.txtCheckMan.Text.Trim() + "%"));
|
|
|
|
|
}
|
|
|
|
|
if (!string.IsNullOrEmpty(this.txtType.Text.Trim()))
|
|
|
|
|
{
|
|
|
|
|
strSql += " AND RegisterTypesName LIKE @Type";
|
|
|
|
|
listStr.Add(new SqlParameter("@Type", "%" + this.txtType.Text.Trim() + "%"));
|
|
|
|
|
}
|
|
|
|
|
if (!string.IsNullOrEmpty(this.txtWorkAreaName.Text.Trim()))
|
|
|
|
|
{
|
|
|
|
|
strSql += " AND WorkAreaName LIKE @WorkAreaName";
|
|
|
|
|
listStr.Add(new SqlParameter("@WorkAreaName", "%" + this.txtWorkAreaName.Text.Trim() + "%"));
|
|
|
|
|
}
|
|
|
|
|
if (!string.IsNullOrEmpty(this.dpRiskLevel.SelectedValue.Trim()))
|
|
|
|
|
{
|
2023-04-28 14:56:47 +08:00
|
|
|
|
if (this.dpRiskLevel.SelectedText == "重大")
|
|
|
|
|
{
|
|
|
|
|
strSql += " AND Risk_Level in('重大','3','高') ";
|
|
|
|
|
}
|
|
|
|
|
else if (this.dpRiskLevel.SelectedText == "较大")
|
|
|
|
|
{
|
|
|
|
|
strSql += " AND Risk_Level in('较大','2','较高') ";
|
|
|
|
|
}
|
|
|
|
|
else if (this.dpRiskLevel.SelectedText == "一般")
|
|
|
|
|
{
|
|
|
|
|
strSql += " AND Risk_Level in('一般','1','低') ";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2022-03-15 17:36:38 +08:00
|
|
|
|
}
|
2022-12-20 09:32:32 +08:00
|
|
|
|
if (!string.IsNullOrEmpty(this.drpType.SelectedValue.Trim()))
|
|
|
|
|
{
|
|
|
|
|
strSql += " AND CheckCycle=@CheckCycle";
|
|
|
|
|
listStr.Add(new SqlParameter("@CheckCycle", this.drpType.SelectedValue));
|
|
|
|
|
}
|
2022-03-15 17:36:38 +08:00
|
|
|
|
if (!string.IsNullOrEmpty(this.txtResponsibilityUnitName.Text.Trim()))
|
|
|
|
|
{
|
|
|
|
|
strSql += " AND ResponsibilityUnitName LIKE @ResponsibilityUnitName";
|
|
|
|
|
listStr.Add(new SqlParameter("@ResponsibilityUnitName", "%" + this.txtResponsibilityUnitName.Text.Trim() + "%"));
|
|
|
|
|
}
|
|
|
|
|
if (!string.IsNullOrEmpty(txtStartTime.Text.Trim()))
|
|
|
|
|
{
|
|
|
|
|
strSql += " AND CheckTime >= @StartTime";
|
|
|
|
|
listStr.Add(new SqlParameter("@StartTime", this.txtStartTime.Text.Trim()));
|
|
|
|
|
}
|
|
|
|
|
if (!string.IsNullOrEmpty(this.txtEndTime.Text.Trim()))
|
|
|
|
|
{
|
2023-06-12 10:49:20 +08:00
|
|
|
|
strSql += " AND CheckTime < @EndTime";
|
|
|
|
|
DateTime endTime = DateTime.Parse(this.txtEndTime.Text).AddDays(1);
|
|
|
|
|
listStr.Add(new SqlParameter("@EndTime", endTime.ToString("yyyy-MM-dd")));
|
2022-03-15 17:36:38 +08:00
|
|
|
|
}
|
|
|
|
|
if (!string.IsNullOrEmpty(txtStartRectificationTime.Text.Trim()))
|
|
|
|
|
{
|
|
|
|
|
strSql += " AND RectificationTime >= @StartRectificationTime";
|
|
|
|
|
listStr.Add(new SqlParameter("@StartRectificationTime", this.txtStartRectificationTime.Text.Trim()));
|
|
|
|
|
}
|
|
|
|
|
if (!string.IsNullOrEmpty(this.txtEndRectificationTime.Text.Trim()))
|
|
|
|
|
{
|
|
|
|
|
strSql += " AND RectificationTime <= @EndRectificationTime";
|
2023-06-12 10:49:20 +08:00
|
|
|
|
DateTime endTime = DateTime.Parse(this.txtEndRectificationTime.Text).AddDays(1);
|
|
|
|
|
listStr.Add(new SqlParameter("@EndRectificationTime", endTime.ToString("yyyy-MM-dd")));
|
2022-03-15 17:36:38 +08:00
|
|
|
|
}
|
|
|
|
|
if (this.drpProblemTypes.SelectedValue != BLL.Const._Null)
|
|
|
|
|
{
|
|
|
|
|
strSql += " and ProblemTypes ='"+this.drpProblemTypes.SelectedValue+"' " ;
|
|
|
|
|
}
|
2023-05-21 17:23:24 +08:00
|
|
|
|
if (this.drpStates.SelectedValueArray != null && this.drpStates.SelectedValueArray.Length > 0)
|
2022-03-15 17:36:38 +08:00
|
|
|
|
{
|
2023-05-21 17:23:24 +08:00
|
|
|
|
string strSqlTemp = "";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (this.drpStates.SelectedValueArray.Contains("1"))
|
2023-04-28 17:26:38 +08:00
|
|
|
|
{
|
2023-05-21 17:23:24 +08:00
|
|
|
|
strSqlTemp += " ( States = '1' and RectificationPeriod > getdate() ) OR";
|
|
|
|
|
}
|
|
|
|
|
if (this.drpStates.SelectedValueArray.Contains("2"))
|
2023-04-28 17:26:38 +08:00
|
|
|
|
{
|
2023-07-11 16:32:16 +08:00
|
|
|
|
strSqlTemp += " ( States in( '2','3') and datediff(DAY,RectificationPeriod,RectificationTime)>0 ) OR";
|
2023-04-28 17:26:38 +08:00
|
|
|
|
|
|
|
|
|
}
|
2023-05-21 17:23:24 +08:00
|
|
|
|
if (this.drpStates.SelectedValueArray.Contains("3"))
|
2023-04-28 17:26:38 +08:00
|
|
|
|
{
|
2023-07-11 16:32:16 +08:00
|
|
|
|
strSqlTemp += " (States in( '2','3') and datediff(DAY,RectificationPeriod,RectificationTime)<=0 ) OR";
|
2023-04-28 17:26:38 +08:00
|
|
|
|
|
|
|
|
|
}
|
2023-05-21 17:23:24 +08:00
|
|
|
|
if (this.drpStates.SelectedValueArray.Contains("4"))
|
2023-04-28 17:26:38 +08:00
|
|
|
|
{
|
2023-05-21 17:23:24 +08:00
|
|
|
|
strSqlTemp += " ( States ='1' and RectificationPeriod < getdate() ) OR";
|
|
|
|
|
}
|
|
|
|
|
if (this.drpStates.SelectedValueArray.Contains("-1"))
|
|
|
|
|
{
|
|
|
|
|
strSqlTemp += " States ='-1' OR";
|
|
|
|
|
}
|
|
|
|
|
if (!string.IsNullOrEmpty(strSqlTemp))
|
|
|
|
|
{
|
|
|
|
|
strSql += " and (" + strSqlTemp.TrimEnd('R').TrimEnd('O') + ") ";
|
|
|
|
|
}
|
2022-03-15 17:36:38 +08:00
|
|
|
|
}
|
|
|
|
|
if (!CommonService.IsMainUnitOrAdmin(this.CurrUser.UserId))
|
|
|
|
|
{
|
|
|
|
|
strSql += " AND (ResponsibleUnit =@ResponsibleUnit OR SendUnitId=@SendUnitId)";
|
|
|
|
|
listStr.Add(new SqlParameter("@ResponsibleUnit", this.CurrUser.UnitId));
|
|
|
|
|
listStr.Add(new SqlParameter("@SendUnitId", this.CurrUser.UnitId));
|
|
|
|
|
}
|
|
|
|
|
SqlParameter[] parameter = listStr.ToArray();
|
|
|
|
|
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
|
|
|
|
|
|
|
|
|
|
Grid1.RecordCount = tb.Rows.Count;
|
|
|
|
|
var table = this.GetPagedDataTable(Grid1, tb);
|
|
|
|
|
|
|
|
|
|
Grid1.DataSource = table;
|
|
|
|
|
Grid1.DataBind();
|
2023-04-28 14:56:47 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < Grid1.Rows.Count; i++)
|
|
|
|
|
{
|
|
|
|
|
string HazardRegisterId = Grid1.Rows[i].DataKeys[0].ToString();
|
|
|
|
|
Model.View_Hazard_HazardRegister registration = (from x in Funs.DB.View_Hazard_HazardRegister where x.HazardRegisterId == HazardRegisterId select x).FirstOrDefault();
|
|
|
|
|
|
|
|
|
|
if (registration != null)
|
|
|
|
|
{
|
|
|
|
|
if (registration.Risk_Level == "一般" || registration.Risk_Level == "1" || registration.Risk_Level == "低")
|
|
|
|
|
{
|
|
|
|
|
Grid1.Rows[i].RowCssClass = "Blue";
|
|
|
|
|
}else if (registration.Risk_Level == "较大" || registration.Risk_Level == "2" || registration.Risk_Level == "较高")
|
|
|
|
|
{
|
|
|
|
|
Grid1.Rows[i].RowCssClass = "Yellow";
|
|
|
|
|
}
|
|
|
|
|
else if (registration.Risk_Level == "重大" || registration.Risk_Level == "3")
|
|
|
|
|
{
|
|
|
|
|
Grid1.Rows[i].RowCssClass = "Red";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-03-15 17:36:38 +08:00
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 表排序、分页、关闭窗口
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 分页
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="sender"></param>
|
|
|
|
|
/// <param name="e"></param>
|
|
|
|
|
protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
Grid1.PageIndex = e.NewPageIndex;
|
|
|
|
|
BindGrid();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 排序
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="sender"></param>
|
|
|
|
|
/// <param name="e"></param>
|
|
|
|
|
protected void Grid1_Sort(object sender, GridSortEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
BindGrid();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 分页显示条数下拉框
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="sender"></param>
|
|
|
|
|
/// <param name="e"></param>
|
|
|
|
|
protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
Grid1.PageSize = Convert.ToInt32(ddlPageSize.SelectedValue);
|
|
|
|
|
BindGrid();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 关闭弹出窗
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="sender"></param>
|
|
|
|
|
/// <param name="e"></param>
|
|
|
|
|
protected void Window1_Close(object sender, WindowCloseEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
BindGrid();
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region Grid双击事件
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Grid行双击事件
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="sender"></param>
|
|
|
|
|
/// <param name="e"></param>
|
|
|
|
|
protected void Grid1_RowDoubleClick(object sender, GridRowClickEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
btnMenuSee_Click(null, null);
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 查看
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 查看按钮
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="sender"></param>
|
|
|
|
|
/// <param name="e"></param>
|
|
|
|
|
protected void btnMenuSee_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.GetHazardRegisterByHazardRegisterId(RegistrationId);
|
|
|
|
|
if (registration != null)
|
|
|
|
|
{
|
|
|
|
|
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("HiddenRectificationView.aspx?HazardRegisterId={0}", RegistrationId, "查看 - ")));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 编辑
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 编辑按钮
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="sender"></param>
|
|
|
|
|
/// <param name="e"></param>
|
|
|
|
|
protected void btnMenuModify_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.GetHazardRegisterByHazardRegisterId(RegistrationId);
|
|
|
|
|
if (registration != null)
|
|
|
|
|
{
|
|
|
|
|
if (registration.States == Const.State_1) //待整改
|
|
|
|
|
{
|
|
|
|
|
if (registration.CheckManId == this.CurrUser.UserId) //当前人是检查人,可以在整改前继续编辑
|
|
|
|
|
{
|
|
|
|
|
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.GetHazardRegisterByHazardRegisterId(RegistrationId);
|
|
|
|
|
if (registration != null)
|
|
|
|
|
{
|
|
|
|
|
if (registration.States == "1") //待整改
|
|
|
|
|
{
|
|
|
|
|
if (registration.ResponsibleMan == this.CurrUser.UserId) //当前人是责任人,可以进行整改操作
|
|
|
|
|
{
|
|
|
|
|
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("HiddenRectificationRectify.aspx?HazardRegisterId={0}", RegistrationId, "编辑 - ")));
|
|
|
|
|
}
|
|
|
|
|
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 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.GetHazardRegisterByHazardRegisterId(RegistrationId);
|
|
|
|
|
if (registration != null)
|
|
|
|
|
{
|
|
|
|
|
if (registration.States == Const.State_2) //待确认
|
|
|
|
|
{
|
|
|
|
|
if (registration.CheckManId == this.CurrUser.UserId) //当前人是检查人,可以进行确认操作
|
|
|
|
|
{
|
|
|
|
|
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("HiddenRectificationConfirm.aspx?HazardRegisterId={0}", RegistrationId, "编辑 - ")));
|
|
|
|
|
}
|
|
|
|
|
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("HiddenRectificationAdd.aspx", "登记 - ")));
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
Alert.ShowInTop("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region Grid行点击事件
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Grid行点击事件
|
|
|
|
|
/// <param name="sender"></param>
|
|
|
|
|
/// <param name="e"></param>
|
|
|
|
|
protected void Grid1_RowCommand(object sender, GridCommandEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
string RegistrationId = Grid1.DataKeys[e.RowIndex][0].ToString();
|
|
|
|
|
Model.HSSE_Hazard_HazardRegister hazardRegister = BLL.HSSE_Hazard_HazardRegisterService.GetHazardRegisterByHazardRegisterId(RegistrationId);
|
|
|
|
|
if (e.CommandName == "IsSelected")
|
|
|
|
|
{
|
|
|
|
|
CheckBoxField checkField = (CheckBoxField)Grid1.FindColumn("ckbIsSelected");
|
|
|
|
|
if (checkField.GetCheckedState(e.RowIndex))
|
|
|
|
|
{
|
|
|
|
|
if (!ItemSelectedList.Contains(RegistrationId))
|
|
|
|
|
{
|
|
|
|
|
ItemSelectedList.Add(RegistrationId);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (ItemSelectedList.Contains(RegistrationId))
|
|
|
|
|
{
|
|
|
|
|
ItemSelectedList.Remove(RegistrationId);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (e.CommandName == "del")
|
|
|
|
|
{
|
|
|
|
|
if (BLL.CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.HSSE_HiddenRectificationListMenuId, BLL.Const.BtnDelete))
|
|
|
|
|
{
|
|
|
|
|
if (hazardRegister.States != Const.State_3 || this.CurrUser.UserId == BLL.Const.hfnbdId) //待整改
|
|
|
|
|
{
|
|
|
|
|
var getD = BLL.HSSE_Hazard_HazardRegisterService.GetHazardRegisterByHazardRegisterId(RegistrationId);
|
|
|
|
|
if (getD != null)
|
|
|
|
|
{
|
|
|
|
|
BLL.LogService.AddSys_Log(this.CurrUser, getD.HazardCode, getD.HazardRegisterId, BLL.Const.HSSE_HiddenRectificationListMenuId, BLL.Const.BtnDelete);
|
|
|
|
|
BLL.HSSE_Hazard_HazardRegisterService.DeleteHazardRegisterByHazardRegisterId(RegistrationId);
|
|
|
|
|
BindGrid();
|
|
|
|
|
ShowNotify("删除成功!", MessageBoxIcon.Success);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
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 btnMenuDelete_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
if (BLL.CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.HSSE_HiddenRectificationListMenuId, BLL.Const.BtnDelete))
|
|
|
|
|
{
|
|
|
|
|
if (Grid1.SelectedRowIndexArray.Length > 0)
|
|
|
|
|
{
|
|
|
|
|
foreach (int rowIndex in Grid1.SelectedRowIndexArray)
|
|
|
|
|
{
|
|
|
|
|
string rowID = Grid1.DataKeys[rowIndex][0].ToString();
|
2022-12-20 09:32:32 +08:00
|
|
|
|
var hazardRegister = BLL.HSSE_Hazard_HazardRegisterService.GetHazardRegisterByHazardRegisterId(rowID);
|
|
|
|
|
if (hazardRegister != null)
|
2022-03-15 17:36:38 +08:00
|
|
|
|
{
|
|
|
|
|
BLL.LogService.AddSys_Log(this.CurrUser, hazardRegister.HazardCode, hazardRegister.HazardRegisterId, BLL.Const.HSSE_HiddenRectificationListMenuId, BLL.Const.BtnDelete);
|
|
|
|
|
BLL.HSSE_Hazard_HazardRegisterService.DeleteHazardRegisterByHazardRegisterId(rowID);
|
|
|
|
|
}
|
|
|
|
|
}
|
2022-12-20 09:32:32 +08:00
|
|
|
|
|
2022-03-15 17:36:38 +08:00
|
|
|
|
BindGrid();
|
|
|
|
|
ShowNotify("删除成功!", MessageBoxIcon.Success);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
Alert.ShowInTop("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 格式化字符串
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取整改前图片
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="registrationId"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
protected string ConvertImageUrl(object registrationId)
|
|
|
|
|
{
|
|
|
|
|
string url = string.Empty;
|
|
|
|
|
if (registrationId != null)
|
|
|
|
|
{
|
|
|
|
|
var registration = BLL.HSSE_Hazard_HazardRegisterService.GetHazardRegisterByHazardRegisterId(registrationId.ToString());
|
|
|
|
|
if (registration != null)
|
|
|
|
|
{
|
|
|
|
|
url = BLL.UploadAttachmentService.ShowAttachment("../../", registration.ImageUrl);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return url;
|
|
|
|
|
}
|
|
|
|
|
protected string ConvertProblemTypes(object registrationId)
|
|
|
|
|
{
|
|
|
|
|
string url = string.Empty;
|
|
|
|
|
if (registrationId != null)
|
|
|
|
|
{
|
|
|
|
|
if (registrationId.ToString() == "1")
|
|
|
|
|
{
|
|
|
|
|
return "日常巡检";
|
|
|
|
|
}else if (registrationId.ToString() == "2")
|
|
|
|
|
{
|
|
|
|
|
return "专项检查";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
return url;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取整改前图片(放于Img中)
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="registrationId"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
protected string ConvertImageUrlByImage(object registrationId)
|
|
|
|
|
{
|
|
|
|
|
string url = string.Empty;
|
|
|
|
|
if (registrationId != null)
|
|
|
|
|
{
|
|
|
|
|
var registration = BLL.HSSE_Hazard_HazardRegisterService.GetHazardRegisterByHazardRegisterId(registrationId.ToString());
|
|
|
|
|
if (registration != null)
|
|
|
|
|
{
|
2022-12-20 09:32:32 +08:00
|
|
|
|
url = BLL.UploadAttachmentService.ShowImage(ConfigurationManager.AppSettings["SGGLUrl"], registration.ImageUrl);
|
2022-03-15 17:36:38 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return url;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取整改后图片
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="registrationId"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
protected string ConvertImgUrl(object registrationId)
|
|
|
|
|
{
|
|
|
|
|
string url = string.Empty;
|
|
|
|
|
if (registrationId != null)
|
|
|
|
|
{
|
|
|
|
|
var registration = BLL.HSSE_Hazard_HazardRegisterService.GetHazardRegisterByHazardRegisterId(registrationId.ToString());
|
|
|
|
|
if (registration != null)
|
|
|
|
|
{
|
2022-12-20 09:32:32 +08:00
|
|
|
|
url = BLL.UploadAttachmentService.ShowAttachment(ConfigurationManager.AppSettings["SGGLUrl"], registration.RectificationImageUrl);
|
2022-03-15 17:36:38 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return url;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取整改后图片(放于Img中)
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="registrationId"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
protected string ConvertImgUrlByImage(object registrationId)
|
|
|
|
|
{
|
|
|
|
|
string url = string.Empty;
|
|
|
|
|
if (registrationId != null)
|
|
|
|
|
{
|
|
|
|
|
var registration = BLL.HSSE_Hazard_HazardRegisterService.GetHazardRegisterByHazardRegisterId(registrationId.ToString());
|
|
|
|
|
if (registration != null)
|
|
|
|
|
{
|
2023-05-21 17:23:24 +08:00
|
|
|
|
url = BLL.UploadAttachmentService.ShowImage(ConfigurationManager.AppSettings["SGGLUrl"], registration.RectificationImageUrl);
|
2022-03-15 17:36:38 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return url;
|
|
|
|
|
}
|
2023-04-28 17:26:38 +08:00
|
|
|
|
protected string ConverState(object registrationId)
|
|
|
|
|
{
|
|
|
|
|
string state = string.Empty;
|
|
|
|
|
if (registrationId != null)
|
|
|
|
|
{
|
|
|
|
|
Model.View_Hazard_HazardRegister registration = (from x in Funs.DB.View_Hazard_HazardRegister where x.HazardRegisterId == registrationId.ToString() select x).FirstOrDefault();
|
|
|
|
|
if (registration != null)
|
|
|
|
|
{
|
2023-07-11 16:32:16 +08:00
|
|
|
|
DateTime RectificationPeriod = DateTime.Parse(registration.RectificationPeriod.Value.ToString("yyyy-MM-dd")).AddDays(1);
|
|
|
|
|
|
|
|
|
|
if (registration.States == "1" && RectificationPeriod > DateTime.Now)
|
2023-04-28 17:26:38 +08:00
|
|
|
|
{
|
|
|
|
|
state += "未整改";
|
|
|
|
|
}
|
2023-07-11 16:32:16 +08:00
|
|
|
|
else if ((registration.States == "2" || registration.States == "3")&& RectificationPeriod > registration.RectificationTime.Value)
|
2023-04-28 17:26:38 +08:00
|
|
|
|
{
|
|
|
|
|
state += "按时整改";
|
|
|
|
|
}
|
2023-07-11 16:32:16 +08:00
|
|
|
|
else if ((registration.States == "2" || registration.States == "3") && RectificationPeriod <= registration.RectificationTime.Value)
|
2023-04-28 17:26:38 +08:00
|
|
|
|
{
|
|
|
|
|
state += "超期整改";
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
else if (registration.States =="1" && registration. RectificationPeriod.Value <DateTime.Now)
|
|
|
|
|
{
|
|
|
|
|
state += "超期未整改";
|
2023-05-21 17:23:24 +08:00
|
|
|
|
}else if (registration.States == "-1")
|
|
|
|
|
{
|
|
|
|
|
state += "作废";
|
2023-04-28 17:26:38 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return state;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-03-15 17:36:38 +08:00
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 导出按钮
|
|
|
|
|
/// 导出按钮
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="sender"></param>
|
|
|
|
|
/// <param name="e"></param>
|
|
|
|
|
protected void btnOut_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
Response.ClearContent();
|
|
|
|
|
string filename = Funs.GetNewFileName();
|
|
|
|
|
Response.AddHeader("content-disposition", "attachment; filename=" + System.Web.HttpUtility.UrlEncode("日常巡检" + filename, System.Text.Encoding.UTF8) + ".xls");
|
|
|
|
|
Response.ContentType = "application/excel";
|
|
|
|
|
Response.ContentEncoding = System.Text.Encoding.UTF8;
|
|
|
|
|
this.Grid1.PageSize = 100000;
|
|
|
|
|
this.BindGrid();
|
|
|
|
|
Response.Write(GetGridTableHtml(Grid1));
|
|
|
|
|
Response.End();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#pragma warning disable CS0108 // “HiddenRectificationList.GetGridTableHtml(Grid)”隐藏继承的成员“PageBase.GetGridTableHtml(Grid)”。如果是有意隐藏,请使用关键字 new。
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 导出方法
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="grid"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
private string GetGridTableHtml(Grid grid)
|
|
|
|
|
#pragma warning restore CS0108 // “HiddenRectificationList.GetGridTableHtml(Grid)”隐藏继承的成员“PageBase.GetGridTableHtml(Grid)”。如果是有意隐藏,请使用关键字 new。
|
|
|
|
|
{
|
|
|
|
|
StringBuilder sb = new StringBuilder();
|
|
|
|
|
sb.Append("<meta http-equiv=\"content-type\" content=\"application/excel; charset=UTF-8\"/>");
|
|
|
|
|
sb.Append("<table cellspacing=\"0\" rules=\"all\" border=\"1\" style=\"border-collapse:collapse;\">");
|
|
|
|
|
sb.Append("<tr>");
|
|
|
|
|
foreach (GridColumn column in grid.Columns)
|
|
|
|
|
{
|
2023-05-21 17:23:24 +08:00
|
|
|
|
if (column.ColumnID != "ckbIsSelected" && column.ColumnID != "tfImageUrl1" && column.ColumnID != "lbImageUrl2" && column.ColumnID != "Punish" && column.ColumnID != "Del")
|
2022-03-15 17:36:38 +08:00
|
|
|
|
{
|
|
|
|
|
sb.AppendFormat("<td>{0}</td>", column.HeaderText);
|
2023-05-21 17:23:24 +08:00
|
|
|
|
}else if (column.ColumnID == "tfImageUrl1" || column.ColumnID == "lbImageUrl2")
|
|
|
|
|
{
|
|
|
|
|
sb.AppendFormat("<td ><div style=\"width: 120px;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;\">{0}</div></td>", column.HeaderText);
|
|
|
|
|
|
2022-03-15 17:36:38 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
sb.Append("</tr>");
|
|
|
|
|
foreach (GridRow row in grid.Rows)
|
|
|
|
|
{
|
|
|
|
|
sb.Append("<tr>");
|
|
|
|
|
foreach (GridColumn column in grid.Columns)
|
|
|
|
|
{
|
2023-05-21 17:23:24 +08:00
|
|
|
|
if (column.ColumnID != "ckbIsSelected" && column.ColumnID != "Punish" && column.ColumnID != "Del")
|
2022-03-15 17:36:38 +08:00
|
|
|
|
{
|
|
|
|
|
string html = row.Values[column.ColumnIndex].ToString();
|
|
|
|
|
if (column.ColumnID == "tfPageIndex")
|
|
|
|
|
{
|
|
|
|
|
html = (row.FindControl("lblPageIndex") as AspNet.Label).Text;
|
|
|
|
|
}
|
2023-05-21 17:23:24 +08:00
|
|
|
|
if (column.ColumnID == "tfImageUrl1")
|
2022-03-15 17:36:38 +08:00
|
|
|
|
{
|
2023-05-21 17:23:24 +08:00
|
|
|
|
html = (row.FindControl("lbImageUrl1") as AspNet.Label).Text;
|
2022-03-15 17:36:38 +08:00
|
|
|
|
}
|
2023-05-21 17:23:24 +08:00
|
|
|
|
if (column.ColumnID == "tfImageUrl2")
|
2022-03-15 17:36:38 +08:00
|
|
|
|
{
|
2023-05-21 17:23:24 +08:00
|
|
|
|
html = (row.FindControl("lbImageUrl2") as AspNet.Label).Text;
|
2022-03-15 17:36:38 +08:00
|
|
|
|
}
|
|
|
|
|
if (column.ColumnID == "ProblemTypes")
|
|
|
|
|
{
|
|
|
|
|
html = (row.FindControl("lbProblemTypes") as AspNet.Label).Text;
|
|
|
|
|
}
|
2023-05-21 17:23:24 +08:00
|
|
|
|
if (column.ColumnID == "State")
|
|
|
|
|
{
|
|
|
|
|
html = (row.FindControl("Label1") as AspNet.Label).Text;
|
|
|
|
|
}
|
2022-03-15 17:36:38 +08:00
|
|
|
|
sb.AppendFormat("<td>{0}</td>", html);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
sb.Append("</tr>");
|
|
|
|
|
}
|
|
|
|
|
sb.Append("</table>");
|
|
|
|
|
|
|
|
|
|
return sb.ToString();
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 查询
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 查询
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="sender"></param>
|
|
|
|
|
/// <param name="e"></param>
|
|
|
|
|
protected void TextBox_TextChanged(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
if (!string.IsNullOrEmpty(this.txtStartRectificationTime.Text.Trim()) && !string.IsNullOrEmpty(this.txtEndRectificationTime.Text.Trim()))
|
|
|
|
|
{
|
|
|
|
|
if (Funs.GetNewDateTime(this.txtStartRectificationTime.Text.Trim()) > Funs.GetNewDateTime(this.txtEndRectificationTime.Text.Trim()))
|
|
|
|
|
{
|
|
|
|
|
Alert.ShowInTop("开始时间不能大于结束时间!", MessageBoxIcon.Warning);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
this.BindGrid();
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
///
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="sender"></param>
|
|
|
|
|
/// <param name="e"></param>
|
|
|
|
|
protected void Window3_Close(object sender, WindowCloseEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
//if (!string.IsNullOrEmpty(this.hdRemark.Text))
|
|
|
|
|
//{
|
|
|
|
|
string hazardRegisterIds = string.Empty;
|
|
|
|
|
foreach (var item in ItemSelectedList)
|
|
|
|
|
{
|
|
|
|
|
hazardRegisterIds += item + ",";
|
|
|
|
|
}
|
|
|
|
|
if (!string.IsNullOrEmpty(hazardRegisterIds))
|
|
|
|
|
{
|
|
|
|
|
hazardRegisterIds = hazardRegisterIds.Substring(0, hazardRegisterIds.LastIndexOf(","));
|
|
|
|
|
}
|
|
|
|
|
// PageContext.RegisterStartupScript(Window4.GetShowReference(String.Format("HiddenRectificationPrint.aspx?HazardRegisterIds={0}&CheckType={1}", hazardRegisterIds,"0", "查看 - ")));
|
|
|
|
|
this.hdRemark.Text = string.Empty;
|
|
|
|
|
//}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#region 获取按钮权限
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取按钮权限
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="button"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
private void GetButtonPower()
|
|
|
|
|
{
|
|
|
|
|
if (Request.Params["value"] == "0")
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
var buttonList = CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, Const.HSSE_HiddenRectificationListMenuId);
|
|
|
|
|
if (buttonList.Count() > 0)
|
|
|
|
|
{
|
|
|
|
|
if (buttonList.Contains(Const.BtnAdd))
|
|
|
|
|
{
|
|
|
|
|
this.btnNew.Hidden = false;
|
|
|
|
|
this.btnRectify.Hidden = false;
|
|
|
|
|
this.btnConfirm.Hidden = false;
|
|
|
|
|
}
|
|
|
|
|
if (buttonList.Contains(Const.BtnModify))
|
|
|
|
|
{
|
|
|
|
|
this.btnModify.Hidden = false;
|
|
|
|
|
}
|
|
|
|
|
if (buttonList.Contains(Const.BtnDelete))
|
|
|
|
|
{
|
|
|
|
|
this.btnMenuDelete.Hidden = false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
}
|
|
|
|
|
}
|