2023-04-28 天辰质量报验移植
This commit is contained in:
@@ -1,11 +1,10 @@
|
||||
using BLL;
|
||||
using BLL.CQMS.Comprehensive;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace FineUIPro.Web.Comprehensive
|
||||
{
|
||||
public partial class InspectionEquipment : PageBase
|
||||
@@ -31,7 +30,7 @@ namespace FineUIPro.Web.Comprehensive
|
||||
/// </summary>
|
||||
public void BindGrid()
|
||||
{
|
||||
string strSql = @"select InspectionEquipmentId,ProjectId,C.UnitId, U.UnitName,InspectionCode,CN.ProfessionalName,EquipmentOrMatail,InspectionName,Specifications,
|
||||
string strSql = @"select InspectionEquipmentId,ProjectId,C.UnitId,Status, U.UnitName,InspectionCode,CN.ProfessionalName,InspectionName,Specifications,
|
||||
Supplier,Counts,SamplingCount,(CASE WHEN SamplingResult=1 THEN '合格' WHEN SamplingResult=0 THEN '不合格' ELSE '' END) AS SamplingResult,
|
||||
InspectionDate,AttachUrl,Attribute,RemarkCode,UsedPlace,EquipmentNO from Comprehensive_InspectionEquipment C
|
||||
left join Base_Unit U on C.UnitId=U.UnitId
|
||||
@@ -51,13 +50,13 @@ namespace FineUIPro.Web.Comprehensive
|
||||
}
|
||||
if (!string.IsNullOrEmpty(txtStarTime.Text.Trim()))
|
||||
{
|
||||
strSql += " AND InspectionDate >= @InspectionDate";
|
||||
listStr.Add(new SqlParameter("@InspectionDate", Funs.GetNewDateTime(txtStarTime.Text.Trim())));
|
||||
strSql += " AND InspectionDate >= @InspectionDateA";
|
||||
listStr.Add(new SqlParameter("@InspectionDateA", Funs.GetNewDateTime(txtStarTime.Text.Trim())));
|
||||
}
|
||||
if (!string.IsNullOrEmpty(txtEndTime.Text.Trim()))
|
||||
{
|
||||
strSql += " AND InspectionDate <= @InspectionDate";
|
||||
listStr.Add(new SqlParameter("@InspectionDate", Funs.GetNewDateTime(txtEndTime.Text.Trim())));
|
||||
strSql += " AND InspectionDate <= @InspectionDateZ";
|
||||
listStr.Add(new SqlParameter("@InspectionDateZ", Funs.GetNewDateTime(txtEndTime.Text.Trim())));
|
||||
}
|
||||
SqlParameter[] parameter = listStr.ToArray();
|
||||
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
|
||||
@@ -243,23 +242,64 @@ namespace FineUIPro.Web.Comprehensive
|
||||
}
|
||||
#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 = Encoding.UTF8;
|
||||
this.Grid1.PageSize = Grid1.RecordCount;
|
||||
this.BindGrid();
|
||||
Response.Write(GetGridTableHtml2(Grid1));
|
||||
Response.End();
|
||||
|
||||
//public string ConvertState(object value)
|
||||
//{
|
||||
// var status = 0;
|
||||
// int.TryParse(value.ToString(), out status);
|
||||
|
||||
// if (status == 0)
|
||||
// {
|
||||
// return "待审核";
|
||||
// }
|
||||
// else if (status == 1)
|
||||
// {
|
||||
// return "合格";
|
||||
// }
|
||||
// else if (status == 2)
|
||||
// {
|
||||
// return "驳回";
|
||||
// }
|
||||
// else if (status == 3)
|
||||
// {
|
||||
// return "重报";
|
||||
// }
|
||||
// return "待审核";
|
||||
//}
|
||||
|
||||
|
||||
|
||||
public static string ConvertState(object Status)
|
||||
{
|
||||
if (Status != null)
|
||||
{
|
||||
if (Status.ToString().Trim() == BLL.Const.Comprehensive_ReCompile)
|
||||
{
|
||||
return "重报";
|
||||
}
|
||||
else if (Status.ToString().Trim() == BLL.Const.Comprehensive_ReJect)
|
||||
{
|
||||
return "驳回";
|
||||
}
|
||||
else if (Status.ToString().Trim() == BLL.Const.Comprehensive_Compile)
|
||||
{
|
||||
return "编制";
|
||||
}
|
||||
else if (Status.ToString().Trim() == BLL.Const.Comprehensive_Audit)
|
||||
{
|
||||
return "待审批";
|
||||
}
|
||||
else if (Status.ToString().Trim() == BLL.Const.Comprehensive_Complete)
|
||||
{
|
||||
return "审批完成";
|
||||
}
|
||||
}
|
||||
|
||||
return "编制";
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user