From b1f700c20e45219c449654f4dd3f3e9eb1083fcf Mon Sep 17 00:00:00 2001
From: 王 垚 <1402714037@qq.com>
Date: 星期五, 01 一月 2021 15:43:28 +0800
Subject: [PATCH] 提料计划配置变色

---
 src/BLL/Demo.BillView/Demo.BillView.csproj        |    1 
 src/BLL/Demo.BillView/PRD/Pro_TlPlanConfigure.cs  |   25 ++++++++++++
 src/BLL/Demo.BillView/PRD/PODemandPlanListLoad.cs |   71 ++++++++++++++++++++++-------------
 3 files changed, 70 insertions(+), 27 deletions(-)

diff --git a/src/BLL/Demo.BillView/Demo.BillView.csproj b/src/BLL/Demo.BillView/Demo.BillView.csproj
index 93b4deb..a0deb39 100644
--- a/src/BLL/Demo.BillView/Demo.BillView.csproj
+++ b/src/BLL/Demo.BillView/Demo.BillView.csproj
@@ -200,6 +200,7 @@
     <Compile Include="PRD\ProCompleteAnalysisMateriel.cs" />
     <Compile Include="PRD\ProCompleteAnalysisDetails.cs" />
     <Compile Include="PRD\Pro_ScDayImport.cs" />
+    <Compile Include="PRD\Pro_TlPlanConfigure.cs" />
     <Compile Include="PRD\Pro_WorkBillPlatform.cs" />
     <Compile Include="PRD\Pro_WorkBillPlatImport.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
diff --git a/src/BLL/Demo.BillView/PRD/PODemandPlanListLoad.cs b/src/BLL/Demo.BillView/PRD/PODemandPlanListLoad.cs
index 5a61a52..4576664 100644
--- a/src/BLL/Demo.BillView/PRD/PODemandPlanListLoad.cs
+++ b/src/BLL/Demo.BillView/PRD/PODemandPlanListLoad.cs
@@ -6,6 +6,8 @@
 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
 {
@@ -16,37 +18,52 @@
         public override void OnFormatRowConditions(Kingdee.BOS.Core.List.PlugIn.Args.ListFormatConditionArgs args)
         {
             base.OnFormatRowConditions(args);
-            //1.浜哄憳浜ц兘涓嶈冻     绾㈣壊
-            //2.妯″叿璁惧褰卞搷
-            //3.鍘熸枡澶囪揣寤舵湡       姗欒壊
-            //4.浜у搧璐ㄩ噺闂
-            //5.璁捐鍙樻洿鍥犵礌褰卞搷      榛勮壊
-            //6.蹇�掔墿娴佸師鍥�
-            //7.涓嶅彲鎶楀姏鍥犵礌       钃濊壊
-            FormatCondition fc = new FormatCondition();
-            fc.ApplayRow = true;
-
-            if (args.DataRow["FLateReason"].ToString() == "浜哄憳浜ц兘涓嶈冻" || args.DataRow["FLateReason"].ToString() == "妯″叿璁惧褰卞搷")
+            try
             {
-
-                fc.BackColor = ColorTranslator.ToHtml(System.Drawing.Color.Red);// 绾㈣壊;
+                FormatCondition fc = new FormatCondition();
+                fc.ApplayRow = true;
+                DataTable dt = new DataTable();
+                dt = DBServiceHelper.ExecuteDataSet(Context, "/*dialect*/select * from Jit_TlPlanConfigureDetail").Tables[0];
+                foreach (DataRow dr in dt.Rows)
+                {
+                    if (args.DataRow["FLateReason2"].ToString() == dr["FLateReason"].ToString())
+                    {
+                        fc.BackColor = ColorTranslator.ToHtml(Color.FromName(dr["FSYSTEMCOLOR"].ToString()));
+                    }
+                }
+                args.FormatConditions.Add(fc);
             }
-            else if (args.DataRow["FLateReason"].ToString() == "鍘熸枡澶囪揣寤舵湡" || args.DataRow["FLateReason"].ToString() == "浜у搧璐ㄩ噺闂")
+            catch (Exception ex)
             {
-
-                fc.BackColor = ColorTranslator.ToHtml(System.Drawing.Color.Orange);// 姗欒壊;
+                LogService.WriteAsync("娴嬭瘯");
             }
-            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);
-
         }
+
+        #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
+
     }
 }
diff --git a/src/BLL/Demo.BillView/PRD/Pro_TlPlanConfigure.cs b/src/BLL/Demo.BillView/PRD/Pro_TlPlanConfigure.cs
new file mode 100644
index 0000000..88c34d1
--- /dev/null
+++ b/src/BLL/Demo.BillView/PRD/Pro_TlPlanConfigure.cs
@@ -0,0 +1,25 @@
+锘縰sing Kingdee.BOS.Core.Bill.PlugIn;
+using Kingdee.BOS.ServiceHelper;
+using Kingdee.BOS.Util;
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Demo.BillView.PRD
+{
+    [HotUpdate]
+    [Description("鎻愭枡璁″垝閰嶇疆")]
+    public class Pro_TlPlanConfigure : AbstractBillPlugIn
+    {
+        public override void AfterBindData(EventArgs e)
+        {
+            base.AfterBindData(e);
+            var FLot = this.View.Model.GetValue("FSystemColor");
+            this.View.ShowMessage(FLot.ToString()); ;
+        }
+    }
+}

--
Gitblit v1.9.1