gongqiuhong 1 år sedan
förälder
incheckning
0cc222ba84

+ 11 - 46
XdCxRhDW.App/EditForms/EditorTar.Designer.cs

@@ -39,8 +39,6 @@
             this.layoutControlItem4 = new DevExpress.XtraLayout.LayoutControlItem();
             this.layoutControlItem5 = new DevExpress.XtraLayout.LayoutControlItem();
             this.emptySpaceItem2 = new DevExpress.XtraLayout.EmptySpaceItem();
-            this.txtTarColor = new DevExpress.XtraEditors.ColorPickEdit();
-            this.layoutControlItem2 = new DevExpress.XtraLayout.LayoutControlItem();
             ((System.ComponentModel.ISupportInitialize)(this.layoutControl1)).BeginInit();
             this.layoutControl1.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.searchLookUpEdit1.Properties)).BeginInit();
@@ -51,13 +49,10 @@
             ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem4)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem5)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.emptySpaceItem2)).BeginInit();
-            ((System.ComponentModel.ISupportInitialize)(this.txtTarColor.Properties)).BeginInit();
-            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem2)).BeginInit();
             this.SuspendLayout();
             // 
             // layoutControl1
             // 
-            this.layoutControl1.Controls.Add(this.txtTarColor);
             this.layoutControl1.Controls.Add(this.btnOk);
             this.layoutControl1.Controls.Add(this.btnCancel);
             this.layoutControl1.Controls.Add(this.searchLookUpEdit1);
@@ -66,13 +61,13 @@
             this.layoutControl1.Name = "layoutControl1";
             this.layoutControl1.OptionsCustomizationForm.DesignTimeCustomizationFormPositionAndSize = new System.Drawing.Rectangle(831, 101, 650, 400);
             this.layoutControl1.Root = this.Root;
-            this.layoutControl1.Size = new System.Drawing.Size(258, 195);
+            this.layoutControl1.Size = new System.Drawing.Size(258, 151);
             this.layoutControl1.TabIndex = 0;
             this.layoutControl1.Text = "layoutControl1";
             // 
             // btnOk
             // 
-            this.btnOk.Location = new System.Drawing.Point(131, 131);
+            this.btnOk.Location = new System.Drawing.Point(131, 90);
             this.btnOk.Name = "btnOk";
             this.btnOk.Size = new System.Drawing.Size(105, 22);
             this.btnOk.StyleController = this.layoutControl1;
@@ -82,7 +77,7 @@
             // 
             // btnCancel
             // 
-            this.btnCancel.Location = new System.Drawing.Point(22, 131);
+            this.btnCancel.Location = new System.Drawing.Point(22, 90);
             this.btnCancel.Name = "btnCancel";
             this.btnCancel.Size = new System.Drawing.Size(105, 22);
             this.btnCancel.StyleController = this.layoutControl1;
@@ -118,19 +113,18 @@
             this.layoutControlItem1,
             this.layoutControlItem4,
             this.layoutControlItem5,
-            this.emptySpaceItem2,
-            this.layoutControlItem2});
+            this.emptySpaceItem2});
             this.Root.Name = "Root";
             this.Root.Padding = new DevExpress.XtraLayout.Utils.Padding(20, 20, 20, 20);
-            this.Root.Size = new System.Drawing.Size(258, 195);
+            this.Root.Size = new System.Drawing.Size(258, 151);
             this.Root.TextVisible = false;
             // 
             // emptySpaceItem1
             // 
             this.emptySpaceItem1.AllowHotTrack = false;
-            this.emptySpaceItem1.Location = new System.Drawing.Point(0, 135);
+            this.emptySpaceItem1.Location = new System.Drawing.Point(0, 94);
             this.emptySpaceItem1.Name = "emptySpaceItem1";
-            this.emptySpaceItem1.Size = new System.Drawing.Size(218, 20);
+            this.emptySpaceItem1.Size = new System.Drawing.Size(218, 17);
             this.emptySpaceItem1.TextSize = new System.Drawing.Size(0, 0);
             // 
             // layoutControlItem1
@@ -149,7 +143,7 @@
             // layoutControlItem4
             // 
             this.layoutControlItem4.Control = this.btnCancel;
-            this.layoutControlItem4.Location = new System.Drawing.Point(0, 109);
+            this.layoutControlItem4.Location = new System.Drawing.Point(0, 68);
             this.layoutControlItem4.Name = "layoutControlItem4";
             this.layoutControlItem4.Size = new System.Drawing.Size(109, 26);
             this.layoutControlItem4.TextSize = new System.Drawing.Size(0, 0);
@@ -158,7 +152,7 @@
             // layoutControlItem5
             // 
             this.layoutControlItem5.Control = this.btnOk;
-            this.layoutControlItem5.Location = new System.Drawing.Point(109, 109);
+            this.layoutControlItem5.Location = new System.Drawing.Point(109, 68);
             this.layoutControlItem5.Name = "layoutControlItem5";
             this.layoutControlItem5.Size = new System.Drawing.Size(109, 26);
             this.layoutControlItem5.TextSize = new System.Drawing.Size(0, 0);
@@ -167,7 +161,7 @@
             // emptySpaceItem2
             // 
             this.emptySpaceItem2.AllowHotTrack = false;
-            this.emptySpaceItem2.Location = new System.Drawing.Point(0, 85);
+            this.emptySpaceItem2.Location = new System.Drawing.Point(0, 44);
             this.emptySpaceItem2.MaxSize = new System.Drawing.Size(0, 24);
             this.emptySpaceItem2.MinSize = new System.Drawing.Size(104, 24);
             this.emptySpaceItem2.Name = "emptySpaceItem2";
@@ -175,36 +169,11 @@
             this.emptySpaceItem2.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom;
             this.emptySpaceItem2.TextSize = new System.Drawing.Size(0, 0);
             // 
-            // txtTarColor
-            // 
-            this.txtTarColor.EditValue = System.Drawing.Color.Empty;
-            this.txtTarColor.Location = new System.Drawing.Point(22, 83);
-            this.txtTarColor.Name = "txtTarColor";
-            this.txtTarColor.Properties.AutomaticColor = System.Drawing.Color.Black;
-            this.txtTarColor.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
-            new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)});
-            this.txtTarColor.Properties.NullColor = System.Drawing.Color.Empty;
-            this.txtTarColor.Properties.ShowSystemColors = false;
-            this.txtTarColor.Properties.ShowWebColors = false;
-            this.txtTarColor.Size = new System.Drawing.Size(214, 20);
-            this.txtTarColor.StyleController = this.layoutControl1;
-            this.txtTarColor.TabIndex = 9;
-            // 
-            // layoutControlItem2
-            // 
-            this.layoutControlItem2.Control = this.txtTarColor;
-            this.layoutControlItem2.Location = new System.Drawing.Point(0, 44);
-            this.layoutControlItem2.Name = "layoutControlItem2";
-            this.layoutControlItem2.Size = new System.Drawing.Size(218, 41);
-            this.layoutControlItem2.Text = "目标颜色";
-            this.layoutControlItem2.TextLocation = DevExpress.Utils.Locations.Top;
-            this.layoutControlItem2.TextSize = new System.Drawing.Size(48, 14);
-            // 
             // EditorTar
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 14F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(258, 195);
+            this.ClientSize = new System.Drawing.Size(258, 151);
             this.Controls.Add(this.layoutControl1);
             this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
             this.Name = "EditorTar";
@@ -220,8 +189,6 @@
             ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem4)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem5)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.emptySpaceItem2)).EndInit();
-            ((System.ComponentModel.ISupportInitialize)(this.txtTarColor.Properties)).EndInit();
-            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem2)).EndInit();
             this.ResumeLayout(false);
 
         }
@@ -239,7 +206,5 @@
         private DevExpress.XtraLayout.LayoutControlItem layoutControlItem4;
         private DevExpress.XtraLayout.LayoutControlItem layoutControlItem5;
         private DevExpress.XtraLayout.EmptySpaceItem emptySpaceItem2;
-        private DevExpress.XtraEditors.ColorPickEdit txtTarColor;
-        private DevExpress.XtraLayout.LayoutControlItem layoutControlItem2;
     }
 }

+ 0 - 4
XdCxRhDW.App/EditForms/EditorTar.cs

@@ -39,11 +39,7 @@ namespace XdCxRhDW.App.EditForms
             this.searchLookUpEdit1.UseDefault().SetData(infos,nameof(TargetInfo.TargetName)).UseDoubleClickToSelectAll();
             this.searchLookUpEdit1.Properties.View.RowCellStyle += View_RowCellStyle;
             if (info != null)
-            {
                 this.searchLookUpEdit1.Text = info.TargetName;
-                var clolrRes = ColorTranslator.FromHtml(info.TargeColor);
-                this.txtTarColor.EditValue = clolrRes;
-            }
         }
 
         private void View_RowCellStyle(object sender, DevExpress.XtraGrid.Views.Grid.RowCellStyleEventArgs e)

+ 7 - 0
XdCxRhDW.App/UserControl/CtrlHome.cs

@@ -36,6 +36,7 @@ using DevExpress.Utils.Drawing.Helpers;
 using DevExpress.Office.Crypto;
 using XdCxRhDW.App.Model;
 using DPP_YH_Core.Extensions;
+using static DevExpress.Utils.Drawing.Helpers.NativeMethods;
 
 namespace XdCxRhDW.App.UserControl
 {
@@ -381,7 +382,13 @@ namespace XdCxRhDW.App.UserControl
                         {
                             t.TargetInfoID = tar.ID;
                             //t.TargetName = tar.TargetName;
+                            t.ColorKey = tar.TargeColor;
                         });
+                        //groupItems.ForEach(t =>
+                        //{
+                        //    t.ColorKey = tar.TargeColor;
+                        //});
+                        mapControl1.UpdatePosItem(tarItems);
                         db.PosRes.AddOrUpdate(tarItems);
                         await db.SaveChangesAsync();
                     }