CNCEC_SUBQHSE_WUHUAN/SGGL/FineUIPro.Web/DataShow/HiddenRectificationItem.asp...

191 lines
6.7 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using Aspose.Words;
using BLL;
using Org.BouncyCastle.Asn1.Ocsp;
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.IO;
using System.Linq;
using System.Text;
namespace FineUIPro.Web.DataShow
{
public partial class HiddenRectificationItem : PageBase
{
#region
/// <summary>
/// 加载页面
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
string projectId = Request.Params["projectId"];
this.txtProject.Text=ProjectService.GetProjectNameByProjectId(projectId);
Funs.DropDownPageSize(this.ddlPageSize);
btnClose.OnClientClick = ActiveWindow.GetHideReference();
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";
handleStep1.Name = "待整改";
handleSteps.Add(handleStep1);
Model.HandleStep handleStep2 = new Model.HandleStep();
handleStep2.Id = "2";
handleStep2.Name = "已整改-待复查验收";
handleSteps.Add(handleStep2);
Model.HandleStep handleStep3 = new Model.HandleStep();
handleStep3.Id = "3";
handleStep3.Name = "已闭环";
handleSteps.Add(handleStep3);
//Model.HandleStep handleStep4 = new Model.HandleStep();
//handleStep4.Id = "4";
//handleStep4.Name = "已作废";
//handleSteps.Add(handleStep4);
this.drpStates.DataSource = handleSteps; ;
this.drpStates.DataBind();
Funs.FineUIPleaseSelect(this.drpStates);
// 绑定表格t
BindGrid();
this.Panel1.Title = "隐患排查治理数据(" + BLL.UnitService.GetUnitNameByUnitId(BLL.Const.UnitId_CWCEC) + "";
}
}
/// <summary>
/// 绑定数据
/// </summary>
private void BindGrid()
{
string strSql = "SELECT * FROM View_Hazard_HazardRegister WHERE ProblemTypes in ('1' ,'2') ";
List<SqlParameter> listStr = new List<SqlParameter>();
strSql += " AND ProjectId = @ProjectId";
listStr.Add(new SqlParameter("@ProjectId", Request.Params["projectId"]));
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()))
{
strSql += " AND CheckTime <= @EndTime";
listStr.Add(new SqlParameter("@EndTime", this.txtEndTime.Text.Trim()));
}
if (this.drpStates.SelectedValue != BLL.Const._Null)
{
strSql += " AND States LIKE @States";
listStr.Add(new SqlParameter("@States", "%" + this.drpStates.SelectedValue + "%"));
}
if (this.rbType.SelectedValue == "0")
{
strSql += " AND Risk_Level = '重大'";
}
else
{
strSql += " AND Risk_Level ='一般'";
}
listStr.Add(new SqlParameter("@HazardValue", "3"));
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();
}
#endregion
#region
/// <summary>
/// 查询
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void TextBox_TextChanged(object sender, EventArgs e)
{
this.BindGrid();
}
#endregion
#region
/// <summary>
/// 分页
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e)
{
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();
}
#endregion
/// <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)
{
url = BLL.UploadAttachmentService.ShowImage("../", registration.ImageUrl);
}
}
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)
{
url = BLL.UploadAttachmentService.ShowImage("../", registration.RectificationImageUrl);
}
}
return url;
}
}
}