Ver código fonte

修改颗粒类别功能

zhangjiaxin 7 meses atrás
pai
commit
532e35e0ce

+ 6 - 0
.cr/personal/FavoritesList/List.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Root Type="DevExpress.CodeRush.Foundation.CodePlaces.Options.FavoritesListContainer">
+  <Options Language="Neutral">
+    <Groups />
+  </Options>
+</Root>

+ 1 - 1
Bin/x64/Debug/Resources/XMLData/AppResource_ZH.xml

@@ -1478,7 +1478,7 @@
       <Control name="ToolStripMenuItem1" text="复制整个表" />
 	  <Control name="ToolStripMenuItem2" text="复制选择区域" />
 	  <Control name="toolStripMenuItem4" text="复制当前显示列表图像" />
-	  <Control name="ToolStripMenuItem3" text="恢复至初始状态" />
+	  <Control name="ToolStripMenuItem3" text="修改颗粒分类" />
 	  <Control name="ToolStripMenuItem5" text="移动SEM到颗粒视域位置" />
 	  <Control name="ToolStripMenuItem_selectparticle" text="选择颗粒" />
 	  <Control name="ToolStripMenuItem_exportimagefile" text="导出图像文件" />

+ 138 - 0
OTSIncAReportApp/1-UI/Control_Grids/ParticlesGridDevidePage/ModifyCategoryForm.Designer.cs

@@ -0,0 +1,138 @@
+namespace OTSIncAReportApp._1_UI.Control_Grids.ParticlesGridDevidePage
+{
+    partial class ModifyCategoryForm
+    {
+        /// <summary>
+        /// Required designer variable.
+        /// </summary>
+        private System.ComponentModel.IContainer components = null;
+
+        /// <summary>
+        /// Clean up any resources being used.
+        /// </summary>
+        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+        protected override void Dispose(bool disposing)
+        {
+            if (disposing && (components != null))
+            {
+                components.Dispose();
+            }
+            base.Dispose(disposing);
+        }
+
+        #region Windows Form Designer generated code
+
+        /// <summary>
+        /// Required method for Designer support - do not modify
+        /// the contents of this method with the code editor.
+        /// </summary>
+        private void InitializeComponent()
+        {
+            this.panel1 = new System.Windows.Forms.Panel();
+            this.button1 = new System.Windows.Forms.Button();
+            this.button2 = new System.Windows.Forms.Button();
+            this.textBox1 = new System.Windows.Forms.TextBox();
+            this.comboBox1 = new System.Windows.Forms.ComboBox();
+            this.radioButton2 = new System.Windows.Forms.RadioButton();
+            this.radioButton1 = new System.Windows.Forms.RadioButton();
+            this.panel1.SuspendLayout();
+            this.SuspendLayout();
+            // 
+            // panel1
+            // 
+            this.panel1.Controls.Add(this.button1);
+            this.panel1.Controls.Add(this.button2);
+            this.panel1.Controls.Add(this.textBox1);
+            this.panel1.Controls.Add(this.comboBox1);
+            this.panel1.Controls.Add(this.radioButton2);
+            this.panel1.Controls.Add(this.radioButton1);
+            this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.panel1.Location = new System.Drawing.Point(0, 0);
+            this.panel1.Name = "panel1";
+            this.panel1.Size = new System.Drawing.Size(388, 148);
+            this.panel1.TabIndex = 0;
+            // 
+            // button1
+            // 
+            this.button1.Location = new System.Drawing.Point(212, 99);
+            this.button1.Name = "button1";
+            this.button1.Size = new System.Drawing.Size(69, 23);
+            this.button1.TabIndex = 5;
+            this.button1.Text = "取消";
+            this.button1.UseVisualStyleBackColor = true;
+            this.button1.Click += new System.EventHandler(this.button1_Click);
+            // 
+            // button2
+            // 
+            this.button2.Location = new System.Drawing.Point(76, 99);
+            this.button2.Name = "button2";
+            this.button2.Size = new System.Drawing.Size(69, 23);
+            this.button2.TabIndex = 1;
+            this.button2.Text = "确定";
+            this.button2.UseVisualStyleBackColor = true;
+            this.button2.Click += new System.EventHandler(this.button2_Click);
+            // 
+            // textBox1
+            // 
+            this.textBox1.Location = new System.Drawing.Point(176, 62);
+            this.textBox1.Name = "textBox1";
+            this.textBox1.Size = new System.Drawing.Size(144, 21);
+            this.textBox1.TabIndex = 0;
+            // 
+            // comboBox1
+            // 
+            this.comboBox1.FormattingEnabled = true;
+            this.comboBox1.Location = new System.Drawing.Point(176, 27);
+            this.comboBox1.Name = "comboBox1";
+            this.comboBox1.Size = new System.Drawing.Size(144, 20);
+            this.comboBox1.TabIndex = 4;
+            // 
+            // radioButton2
+            // 
+            this.radioButton2.AutoSize = true;
+            this.radioButton2.Checked = true;
+            this.radioButton2.Location = new System.Drawing.Point(51, 63);
+            this.radioButton2.Name = "radioButton2";
+            this.radioButton2.Size = new System.Drawing.Size(107, 16);
+            this.radioButton2.TabIndex = 1;
+            this.radioButton2.TabStop = true;
+            this.radioButton2.Text = "定义新颗粒类别";
+            this.radioButton2.UseVisualStyleBackColor = true;
+            // 
+            // radioButton1
+            // 
+            this.radioButton1.AutoSize = true;
+            this.radioButton1.Location = new System.Drawing.Point(51, 28);
+            this.radioButton1.Name = "radioButton1";
+            this.radioButton1.Size = new System.Drawing.Size(119, 16);
+            this.radioButton1.TabIndex = 0;
+            this.radioButton1.Text = "选择现有颗粒类别";
+            this.radioButton1.UseVisualStyleBackColor = true;
+            this.radioButton1.CheckedChanged += new System.EventHandler(this.radioButton1_CheckedChanged);
+            // 
+            // ModifyCategoryForm
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.ClientSize = new System.Drawing.Size(388, 148);
+            this.Controls.Add(this.panel1);
+            this.Name = "ModifyCategoryForm";
+            this.Text = "ModifyCategoryForm";
+            this.Load += new System.EventHandler(this.ModifyCategoryForm_Load);
+            this.panel1.ResumeLayout(false);
+            this.panel1.PerformLayout();
+            this.ResumeLayout(false);
+
+        }
+
+        #endregion
+
+        private System.Windows.Forms.Panel panel1;
+        private System.Windows.Forms.RadioButton radioButton2;
+        private System.Windows.Forms.RadioButton radioButton1;
+        private System.Windows.Forms.TextBox textBox1;
+        private System.Windows.Forms.ComboBox comboBox1;
+        private System.Windows.Forms.Button button2;
+        private System.Windows.Forms.Button button1;
+    }
+}

+ 139 - 0
OTSIncAReportApp/1-UI/Control_Grids/ParticlesGridDevidePage/ModifyCategoryForm.cs

@@ -0,0 +1,139 @@
+using DevExpress.XtraEditors;
+using NPOI.SS.Formula.Functions;
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+
+namespace OTSIncAReportApp._1_UI.Control_Grids.ParticlesGridDevidePage
+{
+    public partial class ModifyCategoryForm : Form
+    {
+        private DataTable inputData = new DataTable();
+        string CategoryName = "";
+        public List<string> OutTypeAndName = new List<string>();//确定按钮有输出TypeID和类别名
+        public bool DoYouWantToModifyIt = false;
+        public ModifyCategoryForm(DataTable a_inputData,string a_CategoryName)
+        {
+            inputData = a_inputData;
+            CategoryName = a_CategoryName;
+            InitializeComponent();
+        }
+
+        private void ModifyCategoryForm_Load(object sender, EventArgs e)
+        {
+            //如果没有分类的话就不允许选择类别只能新增
+            if(inputData.Rows.Count==0)
+            {
+                radioButton1.Checked = false;
+                radioButton2.Checked = true;
+            }
+
+            for (int i=0;i< inputData.Rows.Count;i++)
+            {
+                comboBox1.Items.Add(inputData.Rows[i]["TypeName"].ToString());
+            }
+
+            // 假设 comboBox1 是你的 ComboBox 控件
+            string itemToFind = CategoryName;
+
+            // 使用 Items.IndexOf 方法找到项的索引
+            int index = comboBox1.Items.IndexOf(itemToFind);
+
+            // 检查是否找到了该项
+            if (index != -1)
+            {
+                // 设置选中项
+                comboBox1.SelectedIndex = index;
+            }
+            else
+            {
+                // 设置选中项
+                comboBox1.SelectedIndex = 0;
+            }
+        }
+
+        private void button2_Click(object sender, EventArgs e)
+        {
+            bool DoYouWantToExit = true;//判断是否退出
+            if (radioButton1.Checked==true)
+            {
+                SelectExistingCategoryMethods();
+            }
+            else
+            {
+                DoYouWantToExit = MethodForAddingNewCategories();
+            }
+            if(DoYouWantToExit)
+            {
+                Close();
+            }
+            
+        }
+        /// <summary>
+        /// 新增类别方法
+        /// </summary>
+        private bool MethodForAddingNewCategories()
+        {
+            if (string.IsNullOrWhiteSpace(textBox1.Text))
+            {
+                MessageBox.Show("类别名称不能为空!");
+                return false;
+            }
+            int TypeId = 50000 + inputData.Rows.Count + 1;
+            string TypeName = textBox1.Text;
+            Random random = new Random();
+            // 生成随机颜色
+            int r = random.Next(0, 256); // 红色分量,0到255
+            int g = random.Next(0, 256); // 绿色分量,0到255
+            int b = random.Next(0, 256); // 蓝色分量,0到255
+            // 创建Color对象
+            string hexColor = $"#{r:X2}{g:X2}{b:X2}";
+            string NewCategory = "New Category";
+            OutTypeAndName.Add(TypeId.ToString());
+            OutTypeAndName.Add(TypeName);
+            OutTypeAndName.Add(hexColor);
+            OutTypeAndName.Add(NewCategory);
+            DoYouWantToModifyIt = true;
+            return true;
+        }
+        /// <summary>
+        /// 选择现有类别方法
+        /// </summary>
+        private void SelectExistingCategoryMethods()
+        {
+            string TypeId = inputData.Rows[comboBox1.SelectedIndex]["TypeId"].ToString();
+            string TypeName = inputData.Rows[comboBox1.SelectedIndex]["TypeName"].ToString();
+            string TypeColor = inputData.Rows[comboBox1.SelectedIndex]["TypeColor"].ToString();
+            string GroupName= inputData.Rows[comboBox1.SelectedIndex]["GroupName"].ToString();
+            OutTypeAndName.Add(TypeId);
+            OutTypeAndName.Add(TypeName);
+            OutTypeAndName.Add(TypeColor);
+            OutTypeAndName.Add(GroupName);
+            DoYouWantToModifyIt = true;
+        }
+
+        private void button1_Click(object sender, EventArgs e)
+        {
+            Close();
+        }
+
+        private void radioButton1_CheckedChanged(object sender, EventArgs e)
+        {
+            if(radioButton1.Checked==true)
+            {
+                if (inputData.Rows.Count == 0)
+                {
+                    radioButton1.Checked = false;
+                    radioButton2.Checked = true;
+                }
+            }
+           
+        }
+    }
+}

+ 120 - 0
OTSIncAReportApp/1-UI/Control_Grids/ParticlesGridDevidePage/ModifyCategoryForm.resx

@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+</root>

+ 56 - 5
OTSIncAReportApp/1-UI/Control_Grids/ParticlesGridDevidePage/ParticlesGridDevidePage.cs

@@ -19,6 +19,7 @@ using System;
 using System.Collections;
 using System.Collections.Generic;
 using System.Data;
+using System.Data.SQLite;
 using System.Drawing;
 using System.Drawing.Imaging;
 using System.IO;
@@ -1102,14 +1103,63 @@ namespace OTSIncAReportGrids
 
         private void ToolStripMenuItem3_Click(object sender, EventArgs e)
         {
-            //恢复至初始状态
+            //如果没有选中颗粒退出
+            if (dgV_ParticlesDevidePage.SelectedRows.Count==0)
+            {
+                return;
+            }
+            string CategoryName = "";
+            //循环选中颗粒
+            for (int i=0;i< dgV_ParticlesDevidePage.SelectedRows.Count;i++)
+            {
+                DataGridViewRow dgvr = dgV_ParticlesDevidePage.SelectedRows[i];
+                CategoryName = dgvr.Cells[1].Value.ToString();
+            }
+            string TypeId = "";
+            string TypeName = "";
+            string TypeColor = "";
+            string GroupName = "";
+            DataTable da = Particledata.GetParticleListForParticlSize("area", "");
+           
+            ModifyCategoryForm modifyCategoryForm = new ModifyCategoryForm(da, CategoryName);
+            DialogResult result = modifyCategoryForm.ShowDialog();
+            if(modifyCategoryForm.DoYouWantToModifyIt)
+            {
+                TypeId = modifyCategoryForm.OutTypeAndName[0];
+                TypeName = modifyCategoryForm.OutTypeAndName[1];
+                TypeColor = modifyCategoryForm.OutTypeAndName[2];
+                GroupName = modifyCategoryForm.OutTypeAndName[3];
+
+
+                List<string> strings = new List<string>();
+                strings.Add(TypeId);
+                strings.Add(TypeName);
+                strings.Add(TypeColor);
+                strings.Add(GroupName);
+                List<KeyValuePair<string, SQLiteParameter[]>> cmdlist = new List<KeyValuePair<string, SQLiteParameter[]>>();
+                for (int i = 0; i < dgV_ParticlesDevidePage.SelectedRows.Count; i++)
+                {
+                    DataGridViewRow dgvr = dgV_ParticlesDevidePage.SelectedRows[i];
+                    dgvr.Cells[1].Value = TypeName;
+                    Bitmap ls_bp = (Bitmap)dgvr.Cells[2].Value;
+                    List<string> list_str = (List<string>)ls_bp.Tag;
+                    int i_ls_fieldid = Convert.ToInt32(list_str[0]);
+                    int i_ls_particleid = Convert.ToInt32(list_str[1]);
+                    List<int> ints = new List<int>();
+                    ints.Add(i_ls_fieldid);
+                    ints.Add(i_ls_particleid);
 
-            dgV_ParticlesDevidePage.Rows.Clear();
-            dgV_ParticlesDevidePage.Columns.Clear();
+                    var cmd= Particledata.GetUpdataAIncACmd(ints, strings);
+                    cmdlist.Add(cmd);
+                }
+                Particledata.ExecuteNonQueryBatch(cmdlist);
+            }
+        
+            
+    
+            
 
-            BindDataGridView();
 
-            SetDataGridViewStyle();
         }
 
         private void ToolStripMenuItem5_Click(object sender, EventArgs e)
@@ -2105,6 +2155,7 @@ namespace OTSIncAReportGrids
                 for (int ii = 0; ii < dgV_ParticlesDevidePage.SelectedRows.Count; ii++)
                 {
                     
+
                     DataGridViewRow dgvr = dgV_ParticlesDevidePage.SelectedRows[ii];
                     Bitmap ls_bp = (Bitmap)dgvr.Cells[2].Value;
                     List<string> list_str = (List<string>)ls_bp.Tag;

+ 42 - 1
OTSIncAReportApp/3-ServiceCenter/DataOperation/DataAccess/ParticleData.cs

@@ -1,7 +1,9 @@
-using OTSCommon.DBOperate.Model;
+using DevExpress.Xpo.Helpers;
+using OTSCommon.DBOperate.Model;
 using System;
 using System.Collections.Generic;
 using System.Data;
+using System.Data.SqlClient;
 using System.Data.SQLite;
 using System.Drawing;
 using System.Drawing.Imaging;
@@ -822,6 +824,42 @@ namespace OTSIncAReportApp.DataOperation.DataAccess
             return new_ret_bp;
         }
 
+        public void InsertUpdate(List<int> particleID, List<string> particleData)
+        {
+            List<KeyValuePair<string, SQLiteParameter[]>> cmdlist = new List<KeyValuePair<string, SQLiteParameter[]>>();
+            var str = dbHelper.UpdateINCAEntryData(particleID, particleData);
+            cmdlist.Add(str);
+            try
+            {
+                dbHelper.ExecuteNonQueryBatch(ref cmdlist);
+
+            }
+            catch (Exception e)
+            {
+                //NLog.LogManager.GetCurrentClassLogger().Error(e.Message);
+
+            }
+        }
+
+        public KeyValuePair<string, SQLiteParameter[]> GetUpdataAIncACmd(List<int> particleID, List<string> particleData)
+        {
+            var str = dbHelper.UpdateINCAEntryData(particleID, particleData);
+            return str;
+        }
+        public void ExecuteNonQueryBatch(List<KeyValuePair<string, SQLiteParameter[]>> cmdlist)
+        {
+            try
+            {
+                dbHelper.ExecuteNonQueryBatch(ref cmdlist);
+
+            }
+            catch (Exception e)
+            {
+                //NLog.LogManager.GetCurrentClassLogger().Error(e.Message);
+
+            }
+        }
+
         #endregion
     }
 
@@ -869,5 +907,8 @@ namespace OTSIncAReportApp.DataOperation.DataAccess
         }
 
         public SqlHelper GetSqlHelper() { return dbHelper; }
+
+
+        
     }
 }

+ 83 - 1
OTSIncAReportApp/3-ServiceCenter/DataOperation/DataAccess/SqlHelper.cs

@@ -1,6 +1,8 @@
 using System;
 using System.Collections.Generic;
 using System.Data;
+using System.Data.Common;
+using System.Data.SqlClient;
 using System.Data.SQLite;
 
 namespace OTSIncAReportApp.DataOperation.DataAccess
@@ -40,7 +42,7 @@ namespace OTSIncAReportApp.DataOperation.DataAccess
             {
                 dbConnection = new SQLiteConnection(con);
                 dbConnection.Open();
-
+                connectionString = con;
                 dbCommand = new SQLiteCommand();
                 dbCommand.Connection = dbConnection;
             }
@@ -663,6 +665,86 @@ namespace OTSIncAReportApp.DataOperation.DataAccess
             tr.Rollback();
         }
 
+        public KeyValuePair<string, SQLiteParameter[]> UpdateINCAEntryData(List<int> particleID,List<string> particleData)
+        {
+            string sSQLCommand = "Update IncAData set TypeId=@TypeId,TypeName= @TypeName," +
+                "TypeColor=@TypeColor,GroupName=@GroupName where FieldID =@FieldId and XrayId =@XrayId ";  //sSQLCommand.Format(sSQLCommand,a_pParticle->GetAveGray(),a_pParticle->GetArea(),a_pParticle->GetType(),a_pParticle->GetFieldId(),a_pParticle->GetTagId());
+            //using (var command = new SQLiteCommand(sSQLCommand, dbCommand.Connection))
+            //{
+            //    // 添加参数并赋值
+            //    command.Parameters.AddWithValue("@TypeName", particleData[1]); 
+            //    command.Parameters.AddWithValue("@TypeId", particleData[0]); 
+            //    command.Parameters.AddWithValue("@TypeColor", particleData[2]);
+            //    command.Parameters.AddWithValue("@GroupName", particleData[3]);
+
+            //    command.Parameters.AddWithValue("@FieldId", particleID[0]);
+            //    command.Parameters.AddWithValue("@XrayId", particleID[1]);
+            //    // 执行更新命令
+            //    int rowsAffected = command.ExecuteNonQuery();
+            //    //Console.WriteLine($"{rowsAffected} 行受到影响。");
+            //}
+
+
+            var paras = new SQLiteParameter[6];
+            paras[0] = new SQLiteParameter("TypeId");
+            paras[0].Value = particleData[0];
+            paras[1] = new SQLiteParameter("TypeName");
+            paras[1].Value = particleData[1];
+            paras[2] = new SQLiteParameter("TypeColor");
+            paras[2].Value = particleData[2];
+            paras[3] = new SQLiteParameter("GroupName");
+            paras[3].Value = particleData[3];
+
+            paras[4] = new SQLiteParameter("XrayId");
+            paras[4].Value = particleID[1];
+            paras[5] = new SQLiteParameter("FieldId");
+            paras[5].Value = particleID[0];
+
+            return new KeyValuePair<string, SQLiteParameter[]>(sSQLCommand, paras);
+        }
 
+        /// <summary>
+        /// 批量处理数据操作语句。
+        /// </summary>
+        /// <param name="list">SQL语句集合。</param>
+        /// <exception cref="Exception"></exception>
+        public void ExecuteNonQueryBatch(ref List<KeyValuePair<string, SQLiteParameter[]>> list)
+        {
+            using (SQLiteConnection conn = new SQLiteConnection(connectionString))
+            {
+                try { conn.Open(); }
+                catch { throw; }
+                SQLiteCommand cmd1 = conn.CreateCommand();
+                cmd1.CommandText = "pragma synchronous = 0;";
+                cmd1.ExecuteNonQuery();
+                using (SQLiteTransaction tran = conn.BeginTransaction())
+                {
+                    using (SQLiteCommand cmd = new SQLiteCommand(conn))
+                    {
+
+                        try
+                        {
+                            foreach (var item in list)
+                            {
+                                cmd.CommandText = item.Key;
+                                if (item.Value != null)
+                                {
+                                    cmd.Parameters.AddRange(item.Value);
+                                }
+                                cmd.ExecuteNonQuery();
+                                cmd.Parameters.Clear();
+                            }
+                            tran.Commit();
+
+                        }
+                        catch (Exception ex)
+                        {
+                            tran.Rollback();
+                            //log.Error(ex.ToString());
+                        }
+                    }
+                }
+            }
+        }
     }
 }

+ 10 - 0
OTSIncAReportApp/OTSIncAReportApp.csproj

@@ -539,6 +539,12 @@
   </ItemGroup>
   <ItemGroup>
     <Compile Include="1-UI\Control_Graph\Controls\ImageSplicer.cs" />
+    <Compile Include="1-UI\Control_Grids\ParticlesGridDevidePage\ModifyCategoryForm.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="1-UI\Control_Grids\ParticlesGridDevidePage\ModifyCategoryForm.Designer.cs">
+      <DependentUpon>ModifyCategoryForm.cs</DependentUpon>
+    </Compile>
     <Compile Include="1-UI\Control_Grids\ParticlesGridDevidePage\ParticlesGridDevidePageShowConfig.cs">
       <SubType>Form</SubType>
     </Compile>
@@ -914,6 +920,9 @@
     <Compile Include="1-UI\OTSMgrInfo\frmReportSysConfig.Designer.cs">
       <DependentUpon>frmReportSysConfig.cs</DependentUpon>
     </Compile>
+    <EmbeddedResource Include="1-UI\Control_Grids\ParticlesGridDevidePage\ModifyCategoryForm.resx">
+      <DependentUpon>ModifyCategoryForm.cs</DependentUpon>
+    </EmbeddedResource>
     <EmbeddedResource Include="1-UI\Control_Grids\ParticlesGridDevidePage\ParticlesGridDevidePage.resx">
       <DependentUpon>ParticlesGridDevidePage.cs</DependentUpon>
     </EmbeddedResource>
@@ -1617,6 +1626,7 @@
     <EmbeddedResource Include="Help.resx">
       <DependentUpon>Help.cs</DependentUpon>
     </EmbeddedResource>
+    <EmbeddedResource Include="Properties\licenses.licx" />
     <EmbeddedResource Include="Properties\Resources.resx">
       <Generator>PublicResXFileCodeGenerator</Generator>
       <LastGenOutput>Resources.Designer.cs</LastGenOutput>

+ 2 - 0
OTSIncAReportApp/Properties/licenses.licx

@@ -0,0 +1,2 @@
+DevExpress.XtraCharts.ChartControl, DevExpress.XtraCharts.v24.1.UI, Version=24.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
+DevExpress.XtraReports.UI.XtraReport, DevExpress.XtraReports.v24.1, Version=24.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a