This commit is contained in:
jackchenyang
2024-05-26 09:07:40 +08:00
parent d2a7ce4d35
commit eedac73a48
4 changed files with 41 additions and 9 deletions
@@ -7,6 +7,8 @@ using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using AspNet = System.Web.UI.WebControls;
using System.Drawing;
namespace FineUIPro.Web.WeldingProcess.PMI
{
@@ -25,9 +27,10 @@ namespace FineUIPro.Web.WeldingProcess.PMI
this.ddlPageSize.SelectedValue = this.Grid1.PageSize.ToString();
BLL.Base_UnitService.InitProjectUnitDropDownList(this.drpUnitId, true, this.CurrUser.LoginProjectId, BLL.Const.UnitType_5, Resources.Lan.PleaseSelect);//单位
BLL.Project_WorkAreaService.InitWorkAreaDropDownList(this.drpWorkAreaId, true, this.CurrUser.LoginProjectId, string.Empty, this.drpUnitId.SelectedValue, string.Empty, Resources.Lan.PleaseSelect);//区域
}
}
/// <summary>
/// 绑定数据
@@ -86,7 +89,7 @@ namespace FineUIPro.Web.WeldingProcess.PMI
}
if (this.drpWorkAreaId.SelectedValue != BLL.Const._Null)
{
sql += " and WorkAreaId=@unitId";
sql += " and WorkAreaId=@workAreaId";
listStr.Add(new SqlParameter("@workAreaId", this.drpWorkAreaId.SelectedValue));
}
if (this.drpIsALl.SelectedValue!="全部")
@@ -95,7 +98,7 @@ namespace FineUIPro.Web.WeldingProcess.PMI
}
if (!string.IsNullOrEmpty(this.txtPipelineCode.Text))
{
sql += " and PipelineCode like '%@PipelineCode%'";
sql += " and PipelineCode like '%'+@PipelineCode+'%'";
listStr.Add(new SqlParameter("@PipelineCode", this.txtPipelineCode.Text.Trim()));
}
SqlParameter[] parameter = listStr.ToArray();
@@ -127,7 +130,31 @@ namespace FineUIPro.Web.WeldingProcess.PMI
BindGrid();
}
protected void Grid1_RowDataBound(object sender, GridRowEventArgs e)
{
DataRowView row = e.DataItem as DataRowView;
decimal rates =Math.Round(Convert.ToDecimal(row["RateBys"]),2);
decimal ratef = Math.Round(Convert.ToDecimal(row["RateByf"]), 2);
AspNet.Label itemLable = e.Row.FindControl("labRateBys") as AspNet.Label;
if (itemLable !=null && !string.IsNullOrEmpty(itemLable.Text))
{
itemLable.Text = rates.ToString() + "%";
if (rates <= 2)
{
itemLable.ForeColor = Color.Red;
}
}
AspNet.Label labRateByf = e.Row.FindControl("labRateByf") as AspNet.Label;
if(labRateByf!=null && !string.IsNullOrEmpty(labRateByf.Text))
{
labRateByf.Text= ratef.ToString() + "%";
if (ratef <= 2)
{
labRateByf.ForeColor = Color.Red;
}
}
}
/// <summary>
/// 排序
/// </summary>
@@ -148,7 +175,10 @@ namespace FineUIPro.Web.WeldingProcess.PMI
protected void BtnAnalyse_Click(object sender, EventArgs e)
{
BindGrid();
}
#endregion
#region