diff --git a/HJGL/.vs/HJGL/v17/.suo b/HJGL/.vs/HJGL/v17/.suo index 454cc7e..7487555 100644 Binary files a/HJGL/.vs/HJGL/v17/.suo and b/HJGL/.vs/HJGL/v17/.suo differ diff --git a/HJGL/FineUIPro.Web/WeldingProcess/PMI/PMIDelegationReport.aspx b/HJGL/FineUIPro.Web/WeldingProcess/PMI/PMIDelegationReport.aspx index ec96cd2..7c0a664 100644 --- a/HJGL/FineUIPro.Web/WeldingProcess/PMI/PMIDelegationReport.aspx +++ b/HJGL/FineUIPro.Web/WeldingProcess/PMI/PMIDelegationReport.aspx @@ -17,7 +17,9 @@ EnableCollapse="true" runat="server" BoxFlex="1" EnableColumnLines="true" DataKeyNames="PipelineCode" AllowCellEditing="true" ClicksToEdit="2" AllowSorting="true" SortField="WorkAreaCode,PipelineCode" SortDirection="DESC" OnSort="Grid1_Sort" - AllowPaging="true" IsDatabasePaging="true" PageSize="15" OnPageIndexChange="Grid1_PageIndexChange" + AllowPaging="true" IsDatabasePaging="true" + PageSize="15" OnPageIndexChange="Grid1_PageIndexChange" + OnRowDataBound="Grid1_RowDataBound" EnableTextSelection="True"> @@ -65,13 +67,13 @@ - + - + diff --git a/HJGL/FineUIPro.Web/WeldingProcess/PMI/PMIDelegationReport.aspx.cs b/HJGL/FineUIPro.Web/WeldingProcess/PMI/PMIDelegationReport.aspx.cs index 261daee..4f4842a 100644 --- a/HJGL/FineUIPro.Web/WeldingProcess/PMI/PMIDelegationReport.aspx.cs +++ b/HJGL/FineUIPro.Web/WeldingProcess/PMI/PMIDelegationReport.aspx.cs @@ -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);//区域 - + } } + /// /// 绑定数据 @@ -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; + } + } + } + /// /// 排序 /// @@ -148,7 +175,10 @@ namespace FineUIPro.Web.WeldingProcess.PMI protected void BtnAnalyse_Click(object sender, EventArgs e) { BindGrid(); + } + + #endregion #region 下拉选择事件 diff --git a/HJGL/FineUIPro.Web/WeldingProcess/PMI/PMIDelegationReport.aspx.designer.cs b/HJGL/FineUIPro.Web/WeldingProcess/PMI/PMIDelegationReport.aspx.designer.cs index 37f5fa9..9fb2bda 100644 --- a/HJGL/FineUIPro.Web/WeldingProcess/PMI/PMIDelegationReport.aspx.designer.cs +++ b/HJGL/FineUIPro.Web/WeldingProcess/PMI/PMIDelegationReport.aspx.designer.cs @@ -150,13 +150,13 @@ namespace FineUIPro.Web.WeldingProcess.PMI protected global::System.Web.UI.WebControls.Label labRateBys; /// - /// Label1 控件。 + /// labRateByf 控件。 /// /// /// 自动生成的字段。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// - protected global::System.Web.UI.WebControls.Label Label1; + protected global::System.Web.UI.WebControls.Label labRateByf; /// /// ToolbarSeparator1 控件。