优化材料和焊接数据页面显示及筛选功能
This commit is contained in:
@@ -70,9 +70,65 @@ namespace FineUIPro.Web.CLGL
|
||||
{
|
||||
string strSql = @"select *
|
||||
from dbo.CLGL_MTODetail c
|
||||
where c.ProjectId=@ProjectId order by c.MaterialCode desc";
|
||||
where c.ProjectId=@ProjectId ";
|
||||
List<SqlParameter> listStr = new List<SqlParameter>();
|
||||
listStr.Add(new SqlParameter("@ProjectId", BLL.ProjectService.GetCLProjectCodeByProjectId(this.CurrUser.LoginProjectId)));
|
||||
if (!string.IsNullOrEmpty(txtDeviceNo.Text.Trim()))
|
||||
{
|
||||
strSql += " AND c.DeviceNo like @DeviceNo";
|
||||
listStr.Add(new SqlParameter("@DeviceNo", "%" + txtDeviceNo.Text.Trim() + "%"));
|
||||
}
|
||||
if (!string.IsNullOrEmpty(txtIsoNo.Text.Trim()))
|
||||
{
|
||||
strSql += " AND c.IsoNo like @IsoNo";
|
||||
listStr.Add(new SqlParameter("@IsoNo", "%" + txtIsoNo.Text.Trim() + "%"));
|
||||
}
|
||||
if (!string.IsNullOrEmpty(txtMaterialCode.Text.Trim()))
|
||||
{
|
||||
strSql += " AND c.MaterialCode like @MaterialCode";
|
||||
listStr.Add(new SqlParameter("@MaterialCode", "%" + txtMaterialCode.Text.Trim() + "%"));
|
||||
}
|
||||
if (!string.IsNullOrEmpty(txtSIZE1.Text.Trim()))
|
||||
{
|
||||
strSql += " AND c.SIZE1 like @SIZE1";
|
||||
listStr.Add(new SqlParameter("@SIZE1", "%" + txtSIZE1.Text.Trim() + "%"));
|
||||
}
|
||||
if (!string.IsNullOrEmpty(txtSIZE2.Text.Trim()))
|
||||
{
|
||||
strSql += " AND c.SIZE2 like @SIZE2";
|
||||
listStr.Add(new SqlParameter("@SIZE2", "%" + txtSIZE2.Text.Trim() + "%"));
|
||||
}
|
||||
if (!string.IsNullOrEmpty(txtSCH1.Text.Trim()))
|
||||
{
|
||||
strSql += " AND c.SCH1 like @SCH1";
|
||||
listStr.Add(new SqlParameter("@SCH1", "%" + txtSCH1.Text.Trim() + "%"));
|
||||
}
|
||||
if (!string.IsNullOrEmpty(txtSCH2.Text.Trim()))
|
||||
{
|
||||
strSql += " AND c.SCH2 like @SCH2";
|
||||
listStr.Add(new SqlParameter("@SCH2", "%" + txtSCH2.Text.Trim() + "%"));
|
||||
}
|
||||
if (!string.IsNullOrEmpty(txtPressClass.Text.Trim()))
|
||||
{
|
||||
strSql += " AND c.PressClass like @PressClass";
|
||||
listStr.Add(new SqlParameter("@PressClass", "%" + txtPressClass.Text.Trim() + "%"));
|
||||
}
|
||||
if (!string.IsNullOrEmpty(txtEndFace.Text.Trim()))
|
||||
{
|
||||
strSql += " AND c.EndFace like @EndFace";
|
||||
listStr.Add(new SqlParameter("@EndFace", "%" + txtEndFace.Text.Trim() + "%"));
|
||||
}
|
||||
if (!string.IsNullOrEmpty(txtStandard.Text.Trim()))
|
||||
{
|
||||
strSql += " AND c.Standard like @Standard";
|
||||
listStr.Add(new SqlParameter("@Standard", "%" + txtStandard.Text.Trim() + "%"));
|
||||
}
|
||||
if (!string.IsNullOrEmpty(txtMaterial.Text.Trim()))
|
||||
{
|
||||
strSql += " AND c.Material like @Material";
|
||||
listStr.Add(new SqlParameter("@Material", "%" + txtMaterial.Text.Trim() + "%"));
|
||||
}
|
||||
strSql += " order by c.MaterialCode desc";
|
||||
SqlParameter[] parameter = listStr.ToArray();
|
||||
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
|
||||
Grid1.RecordCount = tb.Rows.Count;
|
||||
@@ -82,6 +138,26 @@ namespace FineUIPro.Web.CLGL
|
||||
Grid1.DataBind();
|
||||
}
|
||||
|
||||
protected void btnQuery_Click(object sender, EventArgs e)
|
||||
{
|
||||
BindGrid();
|
||||
}
|
||||
protected void btnRset_Click(object sender, EventArgs e)
|
||||
{
|
||||
txtDeviceNo.Text = "";
|
||||
txtIsoNo.Text = "";
|
||||
txtMaterialCode.Text = "";
|
||||
txtSIZE1.Text = "";
|
||||
txtSIZE2.Text = "";
|
||||
txtSCH1.Text = "";
|
||||
txtSCH2.Text = "";
|
||||
txtPressClass.Text = "";
|
||||
txtEndFace.Text = "";
|
||||
txtStandard.Text = "";
|
||||
txtMaterial.Text = "";
|
||||
BindGrid();
|
||||
}
|
||||
|
||||
#region 分页
|
||||
/// <summary>
|
||||
/// 分页
|
||||
|
||||
Reference in New Issue
Block a user