This commit is contained in:
2024-06-04 14:03:46 +08:00
parent d2af9745a6
commit 3bdc613bac
53 changed files with 2919 additions and 239 deletions
@@ -38,7 +38,11 @@ namespace FineUIPro.Web.SES
string strSql = @"SELECT * from View_FC_SESRelatedData WHERE 1=1 ";
List<SqlParameter> listStr = new List<SqlParameter>();
if (this.drpValidContracts.SelectedValue == "1")
{
strSql += " AND Expire_Date >= @expire_Date";
listStr.Add(new SqlParameter("@expire_Date", DateTime.Now));
}
if (!string.IsNullOrEmpty(hdConstRecords.Text.Trim()))
{
strSql += " AND ConstRecords =@ConstRecords";
@@ -754,6 +758,14 @@ namespace FineUIPro.Web.SES
{
BindGrid();
}
#region DropDownList下拉选择事件
///查询
protected void DropDownList_SelectedIndexChanged(object sender, EventArgs e)
{
BindGrid();
}
#endregion
#endregion
#region
@@ -983,6 +995,36 @@ namespace FineUIPro.Web.SES
}
#endregion
#region
protected void btnMenuCopy_Click(object sender, EventArgs e)
{
if (Grid1.SelectedRowIndexArray.Length == 0)
{
Alert.ShowInParent("Please select at least one record!");
return;
}
string Id = Grid1.SelectedRowID;
PageContext.RegisterStartupScript(WindowCopy.GetShowReference(String.Format("ContractorQueCopy.aspx?id={0}", Id, "资质拷贝 - ")));
}
protected void btnMenuView_Click(object sender, EventArgs e)
{
if (Grid1.SelectedRowIndexArray.Length == 0)
{
Alert.ShowInParent("Please select at least one record!");
return;
}
string Id = Grid1.SelectedRowID;
PageContext.RegisterStartupScript(Window0.GetShowReference(String.Format("SESRelatedDataEdit.aspx?id={0}&view=1", Id, "查看 - ")));
}
protected void Grid1_RowDoubleClick(object sender, GridRowClickEventArgs e)
{
btnMenuView_Click(null, null);
}
#endregion
#region
private void BindGridTab(string foId, string queType, Grid grid)
@@ -1487,66 +1529,99 @@ namespace FineUIPro.Web.SES
backgroundstyle.SetFont(font);
#endregion
Grid1.PageSize = 10000;
BindGrid();
if (Grid1.Rows.Count > 0)
{
var rowIndex = 1;
for (int i=0; i < Grid1.Rows.Count; i++)
{
int rowID = Convert.ToInt32(Grid1.DataKeys[i][0]);
var queList = from x in Funs.DB.EMC_Contractor_Qualification
join y in Funs.DB.FC_SESRelatedData on x.FoId equals y.ID
where x.FoId == rowID orderby x.QueType, x.LimitStartDate
select new { x.FoId, y.FO_NO, x.QueName, x.QueDef, x.QueType, x.LimitStartDate, x.LimitEndDate, x.Remark };
foreach (var item in queList)
{
if (wsMonth.GetRow(rowIndex) == null) wsMonth.CreateRow(rowIndex);
#region
if (wsMonth.GetRow(rowIndex).GetCell(0) == null) wsMonth.GetRow(rowIndex).CreateCell(0);
wsMonth.GetRow(rowIndex).GetCell(0).SetCellValue(item.FO_NO);
wsMonth.GetRow(rowIndex).GetCell(0).CellStyle = fontStyle;
if (wsMonth.GetRow(rowIndex).GetCell(1) == null) wsMonth.GetRow(rowIndex).CreateCell(1);
wsMonth.GetRow(rowIndex).GetCell(1).SetCellValue(item.QueName);
wsMonth.GetRow(rowIndex).GetCell(1).CellStyle = fontStyle;
if (wsMonth.GetRow(rowIndex).GetCell(2) == null) wsMonth.GetRow(rowIndex).CreateCell(2);
string queType = string.Empty;
if (item.QueType == "1")
{
queType = "营业执照";
}
if (item.QueType == "2")
{
queType = "专业资质";
}
if (item.QueType == "3")
{
queType = "安全资质";
}
if (item.QueType == "4")
{
queType = "环保资质";
}
wsMonth.GetRow(rowIndex).GetCell(2).SetCellValue(queType);
wsMonth.GetRow(rowIndex).GetCell(2).CellStyle = fontStyle;
if (wsMonth.GetRow(rowIndex).GetCell(3) == null) wsMonth.GetRow(rowIndex).CreateCell(3);
wsMonth.GetRow(rowIndex).GetCell(3).SetCellValue(item.QueDef);
wsMonth.GetRow(rowIndex).GetCell(3).CellStyle = fontStyle;
if (wsMonth.GetRow(rowIndex).GetCell(4) == null) wsMonth.GetRow(rowIndex).CreateCell(4);
wsMonth.GetRow(rowIndex).GetCell(4).SetCellValue(item.LimitStartDate.HasValue ? item.LimitStartDate.Value.ToString("yyyy-MM-dd") : "");
wsMonth.GetRow(rowIndex).GetCell(4).CellStyle = fontStyle;
if (wsMonth.GetRow(rowIndex).GetCell(5) == null) wsMonth.GetRow(rowIndex).CreateCell(5);
wsMonth.GetRow(rowIndex).GetCell(5).SetCellValue(item.LimitEndDate.HasValue ? item.LimitEndDate.Value.ToString("yyyy-MM-dd") : "");
wsMonth.GetRow(rowIndex).GetCell(5).CellStyle = fontStyle;
if (wsMonth.GetRow(rowIndex).GetCell(6) == null) wsMonth.GetRow(rowIndex).CreateCell(6);
wsMonth.GetRow(rowIndex).GetCell(6).SetCellValue(item.Remark);
rowIndex++;
}
#endregion
}
var queList = from x in Funs.DB.View_EMC_Contractor_Qualification select x;
if (!string.IsNullOrEmpty(txtFO.Text.Trim()))
{
queList = queList.Where(x => x.FO_NO.Contains(txtFO.Text.Trim()));
}
if (this.drpValidContracts.SelectedValue == "1")
{
queList = queList.Where(x => x.Expire_Date >= DateTime.Now);
}
if (drpContractor.SelectedValue != Const._Null)
{
queList = queList.Where(x => x.ContractorId == drpContractor.SelectedValue);
}
queList = queList.OrderBy(x => x.LimitStartDate).OrderBy(x => x.QueType).OrderBy(x => x.FO_NO);
var rowIndex = 1;
foreach (var item in queList.ToList())
{
if (wsMonth.GetRow(rowIndex) == null) wsMonth.CreateRow(rowIndex);
#region
if (wsMonth.GetRow(rowIndex).GetCell(0) == null) wsMonth.GetRow(rowIndex).CreateCell(0);
wsMonth.GetRow(rowIndex).GetCell(0).SetCellValue(item.FO_NO);
wsMonth.GetRow(rowIndex).GetCell(0).CellStyle = fontStyle;
if (wsMonth.GetRow(rowIndex).GetCell(1) == null) wsMonth.GetRow(rowIndex).CreateCell(1);
wsMonth.GetRow(rowIndex).GetCell(1).SetCellValue(item.QueName);
wsMonth.GetRow(rowIndex).GetCell(1).CellStyle = fontStyle;
if (wsMonth.GetRow(rowIndex).GetCell(2) == null) wsMonth.GetRow(rowIndex).CreateCell(2);
string queType = string.Empty;
if (item.QueType == "1")
{
queType = "营业执照";
}
if (item.QueType == "2")
{
queType = "专业资质";
}
if (item.QueType == "3")
{
queType = "安全资质";
}
if (item.QueType == "4")
{
queType = "环保资质";
}
wsMonth.GetRow(rowIndex).GetCell(2).SetCellValue(queType);
wsMonth.GetRow(rowIndex).GetCell(2).CellStyle = fontStyle;
if (wsMonth.GetRow(rowIndex).GetCell(3) == null) wsMonth.GetRow(rowIndex).CreateCell(3);
wsMonth.GetRow(rowIndex).GetCell(3).SetCellValue(item.QueDef);
wsMonth.GetRow(rowIndex).GetCell(3).CellStyle = fontStyle;
if (wsMonth.GetRow(rowIndex).GetCell(4) == null) wsMonth.GetRow(rowIndex).CreateCell(4);
wsMonth.GetRow(rowIndex).GetCell(4).SetCellValue(item.Discipline);
wsMonth.GetRow(rowIndex).GetCell(4).CellStyle = fontStyle;
if (wsMonth.GetRow(rowIndex).GetCell(5) == null) wsMonth.GetRow(rowIndex).CreateCell(5);
wsMonth.GetRow(rowIndex).GetCell(5).SetCellValue(item.Contract_Admin);
wsMonth.GetRow(rowIndex).GetCell(5).CellStyle = fontStyle;
if (wsMonth.GetRow(rowIndex).GetCell(6) == null) wsMonth.GetRow(rowIndex).CreateCell(6);
wsMonth.GetRow(rowIndex).GetCell(6).SetCellValue(item.Main_Coordinator);
wsMonth.GetRow(rowIndex).GetCell(6).CellStyle = fontStyle;
if (wsMonth.GetRow(rowIndex).GetCell(7) == null) wsMonth.GetRow(rowIndex).CreateCell(7);
wsMonth.GetRow(rowIndex).GetCell(7).SetCellValue(item.Contractor);
wsMonth.GetRow(rowIndex).GetCell(7).CellStyle = fontStyle;
if (wsMonth.GetRow(rowIndex).GetCell(8) == null) wsMonth.GetRow(rowIndex).CreateCell(8);
wsMonth.GetRow(rowIndex).GetCell(8).SetCellValue(item.LimitStartDate.HasValue ? item.LimitStartDate.Value.ToString("yyyy-MM-dd") : "");
wsMonth.GetRow(rowIndex).GetCell(8).CellStyle = fontStyle;
if (wsMonth.GetRow(rowIndex).GetCell(9) == null) wsMonth.GetRow(rowIndex).CreateCell(9);
wsMonth.GetRow(rowIndex).GetCell(9).SetCellValue(item.LimitEndDate.HasValue ? item.LimitEndDate.Value.ToString("yyyy-MM-dd") : "");
wsMonth.GetRow(rowIndex).GetCell(9).CellStyle = fontStyle;
if (wsMonth.GetRow(rowIndex).GetCell(10) == null) wsMonth.GetRow(rowIndex).CreateCell(10);
wsMonth.GetRow(rowIndex).GetCell(10).SetCellValue(item.Remark);
rowIndex++;
#endregion
}
//Grid1.PageSize = 10000;
//BindGrid();
//if (Grid1.Rows.Count > 0)
//{
// var rowIndex = 1;
// for (int i=0; i < Grid1.Rows.Count; i++)
// {
// int rowID = Convert.ToInt32(Grid1.DataKeys[i][0]);
// var queList = from x in Funs.DB.EMC_Contractor_Qualification
// join y in Funs.DB.FC_SESRelatedData on x.FoId equals y.ID
// where x.FoId == rowID orderby x.QueType, x.LimitStartDate
// select new { x.FoId, y.FO_NO, x.QueName, x.QueDef, x.QueType, x.LimitStartDate, x.LimitEndDate, x.Remark };
// }
//}
wsMonth.ForceFormulaRecalculation = true;