优化材料和焊接数据页面显示及筛选功能
This commit is contained in:
@@ -68,11 +68,28 @@ namespace FineUIPro.Web.CLGL
|
||||
/// </summary>
|
||||
private void BindGrid()
|
||||
{
|
||||
string strSql = @"select *
|
||||
string strSql = @"select *,
|
||||
cast((case when c.C5='0' or c.C5='' then 0 when c.C6='0' or c.C6='' then 0 else 100.0 * cast(c.C6 as DECIMAL(9,2))/(1.0 * cast(c.C5 as DECIMAL(9,2))) end) AS DECIMAL(9,2)) as Rate
|
||||
from dbo.CLGL_PipelineSupplierList c
|
||||
where c.ProjectId=@ProjectId order by c.C4 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(txtC1.Text.Trim()))
|
||||
{
|
||||
strSql += " AND c.C1 like @C1";
|
||||
listStr.Add(new SqlParameter("@C1", "%" + txtC1.Text.Trim() + "%"));
|
||||
}
|
||||
if (!string.IsNullOrEmpty(txtC2.Text.Trim()))
|
||||
{
|
||||
strSql += " AND c.C2 like @C2";
|
||||
listStr.Add(new SqlParameter("@C2", "%" + txtC2.Text.Trim() + "%"));
|
||||
}
|
||||
if (!string.IsNullOrEmpty(txtC3.Text.Trim()))
|
||||
{
|
||||
strSql += " AND c.C3 like @C3";
|
||||
listStr.Add(new SqlParameter("@C3", "%" + txtC3.Text.Trim() + "%"));
|
||||
}
|
||||
strSql += " order by c.C4 desc";
|
||||
SqlParameter[] parameter = listStr.ToArray();
|
||||
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
|
||||
Grid1.RecordCount = tb.Rows.Count;
|
||||
@@ -82,6 +99,18 @@ namespace FineUIPro.Web.CLGL
|
||||
Grid1.DataBind();
|
||||
}
|
||||
|
||||
protected void btnQuery_Click(object sender, EventArgs e)
|
||||
{
|
||||
BindGrid();
|
||||
}
|
||||
protected void btnRset_Click(object sender, EventArgs e)
|
||||
{
|
||||
txtC1.Text = "";
|
||||
txtC2.Text = "";
|
||||
txtC3.Text = "";
|
||||
BindGrid();
|
||||
}
|
||||
|
||||
#region 分页
|
||||
/// <summary>
|
||||
/// 分页
|
||||
|
||||
Reference in New Issue
Block a user