| | |
| | | using System.ComponentModel; |
| | | using Kingdee.BOS.Core.DynamicForm.PlugIn.ControlModel; |
| | | using Kingdee.BOS.Util; |
| | | using System.Data; |
| | | using Kingdee.BOS.ServiceHelper; |
| | | |
| | | namespace Demo.BillView.PRD |
| | | { |
| | |
| | | public override void OnFormatRowConditions(Kingdee.BOS.Core.List.PlugIn.Args.ListFormatConditionArgs args) |
| | | { |
| | | base.OnFormatRowConditions(args); |
| | | //1.人员产能不足 红色 |
| | | //2.模具设备影响 |
| | | //3.原料备货延期 橙色 |
| | | //4.产品质量问题 |
| | | //5.设计变更因素影响 黄色 |
| | | //6.快递物流原因 |
| | | //7.不可抗力因素 蓝色 |
| | | try |
| | | { |
| | | FormatCondition fc = new FormatCondition(); |
| | | fc.ApplayRow = true; |
| | | |
| | | if (args.DataRow["FLateReason"].ToString() == "人员产能不足" || args.DataRow["FLateReason"].ToString() == "模具设备影响") |
| | | DataTable dt = new DataTable(); |
| | | dt = DBServiceHelper.ExecuteDataSet(Context, "/*dialect*/select * from Jit_TlPlanConfigureDetail").Tables[0]; |
| | | foreach (DataRow dr in dt.Rows) |
| | | { |
| | | |
| | | fc.BackColor = ColorTranslator.ToHtml(System.Drawing.Color.Red);// 红色; |
| | | if (args.DataRow["FLateReason2"].ToString() == dr["FLateReason"].ToString()) |
| | | { |
| | | fc.BackColor = ColorTranslator.ToHtml(Color.FromName(dr["FSYSTEMCOLOR"].ToString())); |
| | | } |
| | | else if (args.DataRow["FLateReason"].ToString() == "原料备货延期" || args.DataRow["FLateReason"].ToString() == "产品质量问题") |
| | | { |
| | | |
| | | fc.BackColor = ColorTranslator.ToHtml(System.Drawing.Color.Orange);// 橙色; |
| | | } |
| | | else if (args.DataRow["FLateReason"].ToString() == "设计变更因素影响" || args.DataRow["FLateReason"].ToString() == "快递物流原因") |
| | | { |
| | | |
| | | fc.BackColor = ColorTranslator.ToHtml(System.Drawing.Color.Yellow);// 黄色; |
| | | } |
| | | else if (args.DataRow["FLateReason"].ToString() == "不可抗力因素") |
| | | { |
| | | fc.BackColor = ColorTranslator.ToHtml(System.Drawing.Color.LightBlue);// 蓝色; |
| | | } |
| | | args.FormatConditions.Add(fc); |
| | | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | LogService.WriteAsync("测试"); |
| | | } |
| | | } |
| | | |
| | | #region [颜色:16进制转成RGB] |
| | | /// <summary> |
| | | /// [颜色:16进制转成RGB] |
| | | /// </summary> |
| | | /// <param name="strColor">设置16进制颜色 [返回RGB]</param> |
| | | /// <returns></returns> |
| | | public static System.Drawing.Color colorHx16toRGB(string strHxColor) |
| | | { |
| | | try |
| | | { |
| | | if (strHxColor.Length == 0) |
| | | {//如果为空 |
| | | return System.Drawing.Color.FromArgb(0, 0, 0);//设为黑色 |
| | | } |
| | | else |
| | | {//转换颜色 |
| | | return System.Drawing.Color.FromArgb(System.Int32.Parse(strHxColor.Substring(1, 2), System.Globalization.NumberStyles.AllowHexSpecifier), System.Int32.Parse(strHxColor.Substring(3, 2), System.Globalization.NumberStyles.AllowHexSpecifier), System.Int32.Parse(strHxColor.Substring(5, 2), System.Globalization.NumberStyles.AllowHexSpecifier)); |
| | | } |
| | | } |
| | | catch |
| | | {//设为黑色 |
| | | return System.Drawing.Color.FromArgb(0, 0, 0); |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | } |
| | | } |