2025-07-17 14:22:38 +08:00
|
|
|
|
using BLL;
|
|
|
|
|
using FineUIPro.Web.DataShow;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Data;
|
|
|
|
|
using System.Data.SqlClient;
|
|
|
|
|
using System.IO;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using NPOI.SS.UserModel;
|
|
|
|
|
|
|
|
|
|
namespace FineUIPro.Web.CQMS.DesignDrawing
|
|
|
|
|
{
|
|
|
|
|
public partial class ArchivesLib : PageBase
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 项目id
|
|
|
|
|
/// </summary>
|
|
|
|
|
public string ProjectId
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return (string)ViewState["ProjectId"];
|
|
|
|
|
}
|
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
ViewState["ProjectId"] = value;
|
|
|
|
|
}
|
|
|
|
|
}
|
2025-07-17 18:17:56 +08:00
|
|
|
|
|
2025-07-17 14:22:38 +08:00
|
|
|
|
#region 加载页面
|
2025-07-17 18:17:56 +08:00
|
|
|
|
|
2025-07-17 14:22:38 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// 加载页面
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="sender"></param>
|
|
|
|
|
/// <param name="e"></param>
|
|
|
|
|
protected void Page_Load(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
if (!IsPostBack)
|
|
|
|
|
{
|
|
|
|
|
this.ProjectId = this.CurrUser.LoginProjectId;
|
2025-07-17 18:17:56 +08:00
|
|
|
|
this.InitDropDownList();
|
|
|
|
|
|
2025-07-17 14:22:38 +08:00
|
|
|
|
////权限按钮方法
|
|
|
|
|
//UnitService.InitUnitByProjectIdUnitTypeDropDownList(drpSponsorUnit, this.CurrUser.LoginProjectId, BLL.Const.ProjectUnitType_2, true);
|
|
|
|
|
//UnitWorkService.InitUnitWorkDownList(drpUnitWork, this.CurrUser.LoginProjectId, true);
|
|
|
|
|
//CNProfessionalService.InitCNProfessionalDownList(drpCNProfessional, true);
|
|
|
|
|
//QualityQuestionTypeService.InitQualityQuestionTypeDownList(drpQuestionType, true);
|
|
|
|
|
//Funs.FineUIPleaseSelect(this.dpHandelStatus);
|
|
|
|
|
//btnNew.OnClientClick = Window1.GetShowReference("ChecklistEdit.aspx") + "return false;";
|
|
|
|
|
ddlPageSize.SelectedValue = Grid1.PageSize.ToString();
|
|
|
|
|
//if (ProjectUnitService.GetProjectUnitTypeByProjectIdUnitId(this.CurrUser.LoginProjectId, CurrUser.UnitId))
|
|
|
|
|
//{
|
|
|
|
|
// drpSponsorUnit.SelectedValue = CurrUser.UnitId;
|
|
|
|
|
// drpSponsorUnit.Readonly = true;
|
|
|
|
|
//}
|
|
|
|
|
// 绑定表格
|
|
|
|
|
BindGrid();
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
2025-07-17 18:17:56 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// 下拉加载
|
|
|
|
|
/// </summary>
|
|
|
|
|
private void InitDropDownList()
|
|
|
|
|
{
|
|
|
|
|
BLL.DesignDrawingService.InitWbsFullPathDropDownList(this.ddlWbsFullPath, this.CurrUser.LoginProjectId, false);
|
|
|
|
|
BLL.DesignDrawingService.InitFileVersionDropDownList(this.ddlFileVersion, this.CurrUser.LoginProjectId, false);
|
|
|
|
|
BLL.DesignDrawingService.InitMajorNameDropDownList(this.ddlMajorName, this.CurrUser.LoginProjectId, false);
|
|
|
|
|
//BLL.DesignDrawingService.InitMajorNoDropDownList(this.ddlMajorNo, this.CurrUser.LoginProjectId, false);
|
|
|
|
|
BLL.DesignDrawingService.InitStatusNameDropDownList(this.ddlStatus, this.CurrUser.LoginProjectId, false);
|
|
|
|
|
}
|
2025-07-17 14:22:38 +08:00
|
|
|
|
|
2025-07-17 18:17:56 +08:00
|
|
|
|
#endregion
|
2025-07-17 14:22:38 +08:00
|
|
|
|
|
|
|
|
|
|
2025-07-17 18:17:56 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取数据
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
protected DataTable BindData()
|
2025-07-17 14:22:38 +08:00
|
|
|
|
{
|
2025-07-17 18:17:56 +08:00
|
|
|
|
string strSql = $@"SELECT * FROM IDP_DesignDrawing as lib WHERE lib.ProjectId=@ProjectId ";
|
2025-07-17 14:22:38 +08:00
|
|
|
|
//ORDER BY lib.updatetime DESC
|
|
|
|
|
List<SqlParameter> listStr = new List<SqlParameter>();
|
|
|
|
|
listStr.Add(new SqlParameter("@ProjectId", this.CurrUser.LoginProjectId));
|
|
|
|
|
//strSql += " AND (chec.CheckDate>=@startTime or @startTime='') and (chec.CheckDate<=@endTime or @endTime='') ";
|
|
|
|
|
//listStr.Add(new SqlParameter("@startTime", !string.IsNullOrEmpty(txtStartTime.Text.Trim()) ? txtStartTime.Text.Trim() + " 00:00:00" : ""));
|
|
|
|
|
//listStr.Add(new SqlParameter("@endTime", !string.IsNullOrEmpty(txtEndTime.Text.Trim()) ? txtEndTime.Text.Trim() + " 23:59:59" : ""));
|
|
|
|
|
|
2025-07-17 18:17:56 +08:00
|
|
|
|
if (this.ddlWbsFullPath.SelectedItemArray.Count() > 1 || (this.ddlWbsFullPath.SelectedValue != BLL.Const._Null && this.ddlWbsFullPath.SelectedItemArray.Count() == 1))
|
|
|
|
|
{
|
|
|
|
|
strSql += " AND (1=2 ";
|
|
|
|
|
int i = 0;
|
|
|
|
|
foreach (var item in this.ddlWbsFullPath.SelectedValueArray)
|
|
|
|
|
{
|
|
|
|
|
if (!string.IsNullOrEmpty(item) && item != BLL.Const._Null)
|
|
|
|
|
{
|
|
|
|
|
strSql += " OR WbsFullPath = @WbsFullPath" + i.ToString();
|
|
|
|
|
listStr.Add(new SqlParameter("@WbsFullPath" + i.ToString(), item));
|
|
|
|
|
}
|
|
|
|
|
i++;
|
|
|
|
|
}
|
|
|
|
|
strSql += ")";
|
|
|
|
|
}
|
|
|
|
|
if (this.ddlFileVersion.SelectedItemArray.Count() > 1 || (this.ddlFileVersion.SelectedValue != BLL.Const._Null && this.ddlFileVersion.SelectedItemArray.Count() == 1))
|
|
|
|
|
{
|
|
|
|
|
strSql += " AND (1=2 ";
|
|
|
|
|
int i = 0;
|
|
|
|
|
foreach (var item in this.ddlFileVersion.SelectedValueArray)
|
|
|
|
|
{
|
|
|
|
|
if (!string.IsNullOrEmpty(item) && item != BLL.Const._Null)
|
|
|
|
|
{
|
|
|
|
|
strSql += " OR FileVersion = @FileVersion" + i.ToString();
|
|
|
|
|
listStr.Add(new SqlParameter("@FileVersion" + i.ToString(), item));
|
|
|
|
|
}
|
|
|
|
|
i++;
|
|
|
|
|
}
|
|
|
|
|
strSql += ")";
|
|
|
|
|
}
|
|
|
|
|
if (this.ddlMajorName.SelectedItemArray.Count() > 1 || (this.ddlMajorName.SelectedValue != BLL.Const._Null && this.ddlMajorName.SelectedItemArray.Count() == 1))
|
|
|
|
|
{
|
|
|
|
|
strSql += " AND (1=2 ";
|
|
|
|
|
int i = 0;
|
|
|
|
|
foreach (var item in this.ddlMajorName.SelectedValueArray)
|
|
|
|
|
{
|
|
|
|
|
if (!string.IsNullOrEmpty(item) && item != BLL.Const._Null)
|
|
|
|
|
{
|
|
|
|
|
strSql += " OR MajorName = @MajorName" + i.ToString();
|
|
|
|
|
listStr.Add(new SqlParameter("@MajorName" + i.ToString(), item));
|
|
|
|
|
}
|
|
|
|
|
i++;
|
|
|
|
|
}
|
|
|
|
|
strSql += ")";
|
|
|
|
|
}
|
|
|
|
|
if (this.ddlStatus.SelectedItemArray.Count() > 1 || (this.ddlStatus.SelectedValue != BLL.Const._Null && this.ddlStatus.SelectedItemArray.Count() == 1))
|
|
|
|
|
{
|
|
|
|
|
strSql += " AND (1=2 ";
|
|
|
|
|
int i = 0;
|
|
|
|
|
foreach (var item in this.ddlStatus.SelectedValueArray)
|
|
|
|
|
{
|
|
|
|
|
if (!string.IsNullOrEmpty(item) && item != BLL.Const._Null)
|
|
|
|
|
{
|
|
|
|
|
strSql += " OR Status = @Status" + i.ToString();
|
|
|
|
|
listStr.Add(new SqlParameter("@Status" + i.ToString(), item));
|
|
|
|
|
}
|
|
|
|
|
i++;
|
|
|
|
|
}
|
|
|
|
|
strSql += ")";
|
|
|
|
|
}
|
|
|
|
|
|
2025-07-17 14:22:38 +08:00
|
|
|
|
SqlParameter[] parameter = listStr.ToArray();
|
|
|
|
|
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
|
|
|
|
|
return tb;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 绑定数据
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
|
|
|
public void BindGrid()
|
|
|
|
|
{
|
2025-07-17 18:17:56 +08:00
|
|
|
|
DataTable tb = BindData();
|
2025-07-17 14:22:38 +08:00
|
|
|
|
|
|
|
|
|
// 2.获取当前分页数据
|
|
|
|
|
//var table = this.GetPagedDataTable(Grid1, tb1);
|
|
|
|
|
|
|
|
|
|
Grid1.RecordCount = tb.Rows.Count;
|
|
|
|
|
tb = GetFilteredTable(Grid1.FilteredData, tb);
|
|
|
|
|
var table = this.GetPagedDataTable(Grid1, tb);
|
|
|
|
|
|
|
|
|
|
Grid1.DataSource = table;
|
|
|
|
|
Grid1.DataBind();
|
|
|
|
|
|
|
|
|
|
//for (int i = 0; i < Grid1.Rows.Count; i++)
|
|
|
|
|
//{
|
|
|
|
|
// string rowID = Grid1.Rows[i].DataKeys[0].ToString();
|
|
|
|
|
// if (rowID.Count() > 0)
|
|
|
|
|
// {
|
|
|
|
|
// Model.Check_CheckControl checkControl = BLL.CheckControlService.GetCheckControl(rowID);
|
|
|
|
|
// if (checkControl.State.Equals("5") || checkControl.State.Equals("6"))
|
|
|
|
|
// {
|
|
|
|
|
// Grid1.Rows[i].CellCssClasses[11] = "LightGreen";//未确认
|
|
|
|
|
// }
|
|
|
|
|
// else if (checkControl.State == Const.CheckControl_Complete)
|
|
|
|
|
// { //闭环
|
|
|
|
|
// Grid1.Rows[i].CellCssClasses[11] = "Green";
|
|
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
// else if (Convert.ToDateTime(checkControl.LimitDate).AddDays(1) < DateTime.Now) //延期未整改
|
|
|
|
|
// {
|
|
|
|
|
// Grid1.Rows[i].CellCssClasses[11] = "Red";
|
|
|
|
|
// }
|
|
|
|
|
// else //期内未整改
|
|
|
|
|
// {
|
|
|
|
|
// Grid1.Rows[i].CellCssClasses[11] = " Yellow ";
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
//}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#region 获取按钮权限
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取按钮权限
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="button"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
private void GetButtonPower()
|
|
|
|
|
{
|
|
|
|
|
if (Request.Params["value"] == "0")
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
var buttonList = BLL.CommonService.GetAllButtonList(this.ProjectId, this.CurrUser.UserId, BLL.Const.ArchivesLibMenuId);
|
|
|
|
|
if (buttonList.Count() > 0)
|
|
|
|
|
{
|
2025-07-17 18:17:56 +08:00
|
|
|
|
if (buttonList.Contains(BLL.Const.BtnAdd))
|
|
|
|
|
{
|
|
|
|
|
//this.btnNew.Hidden = false;
|
|
|
|
|
}
|
2025-07-17 14:22:38 +08:00
|
|
|
|
//if (buttonList.Contains(BLL.Const.BtnModify))
|
|
|
|
|
//{
|
|
|
|
|
// this.btnMenuModify.Hidden = false;
|
|
|
|
|
//}
|
|
|
|
|
//if (buttonList.Contains(BLL.Const.BtnDelete))
|
|
|
|
|
//{
|
|
|
|
|
// this.btnMenuDel.Hidden = false;
|
|
|
|
|
//}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 查询
|
|
|
|
|
|
|
|
|
|
protected void btnQuery_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
BindGrid();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <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_FilterChange(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
BindGrid();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <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)
|
|
|
|
|
{
|
|
|
|
|
//Grid1.SortDirection = e.SortDirection;
|
|
|
|
|
//Grid1.SortField = e.SortField;
|
|
|
|
|
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)
|
|
|
|
|
{
|
|
|
|
|
//btnMenuModify_Click(null, null);
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#region 编辑
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|