فهرست منبع

增加报告程序,粒级表右键新建功能

zhangjiaxin 3 سال پیش
والد
کامیت
833868071c

+ 9 - 0
OTSIncAReportApp/OTSIncAReportApp.csproj

@@ -343,6 +343,12 @@
     <Compile Include="frmMultiSourceSelect.Designer.cs">
       <DependentUpon>frmMultiSourceSelect.cs</DependentUpon>
     </Compile>
+    <Compile Include="OTSMgrInfo\FormNewLJFile.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="OTSMgrInfo\FormNewLJFile.Designer.cs">
+      <DependentUpon>FormNewLJFile.cs</DependentUpon>
+    </Compile>
     <Compile Include="OutputNlog.cs">
       <SubType>Form</SubType>
     </Compile>
@@ -532,6 +538,9 @@
     <EmbeddedResource Include="frmMultiSourceSelect.resx">
       <DependentUpon>frmMultiSourceSelect.cs</DependentUpon>
     </EmbeddedResource>
+    <EmbeddedResource Include="OTSMgrInfo\FormNewLJFile.resx">
+      <DependentUpon>FormNewLJFile.cs</DependentUpon>
+    </EmbeddedResource>
     <EmbeddedResource Include="OutputNlog.resx">
       <DependentUpon>OutputNlog.cs</DependentUpon>
     </EmbeddedResource>

+ 144 - 0
OTSIncAReportApp/OTSMgrInfo/FormNewLJFile.Designer.cs

@@ -0,0 +1,144 @@
+
+namespace OTSIncAReportApp.OTSMgrInfo
+{
+    partial class FormNewLJFile
+    {
+        /// <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.label1 = new System.Windows.Forms.Label();
+            this.label2 = new System.Windows.Forms.Label();
+            this.label3 = new System.Windows.Forms.Label();
+            this.tb_FlieName = new System.Windows.Forms.TextBox();
+            this.tb_new_ljm = new System.Windows.Forms.TextBox();
+            this.tb_new_ljz = new System.Windows.Forms.TextBox();
+            this.bt_save = new System.Windows.Forms.Button();
+            this.bt_export = new System.Windows.Forms.Button();
+            this.SuspendLayout();
+            // 
+            // label1
+            // 
+            this.label1.AutoSize = true;
+            this.label1.Location = new System.Drawing.Point(51, 24);
+            this.label1.Name = "label1";
+            this.label1.Size = new System.Drawing.Size(41, 12);
+            this.label1.TabIndex = 0;
+            this.label1.Text = "文件名";
+            // 
+            // label2
+            // 
+            this.label2.AutoSize = true;
+            this.label2.Location = new System.Drawing.Point(51, 56);
+            this.label2.Name = "label2";
+            this.label2.Size = new System.Drawing.Size(41, 12);
+            this.label2.TabIndex = 0;
+            this.label2.Text = "粒级名";
+            // 
+            // label3
+            // 
+            this.label3.AutoSize = true;
+            this.label3.Location = new System.Drawing.Point(51, 88);
+            this.label3.Name = "label3";
+            this.label3.Size = new System.Drawing.Size(41, 12);
+            this.label3.TabIndex = 0;
+            this.label3.Text = "粒级值";
+            // 
+            // tb_FlieName
+            // 
+            this.tb_FlieName.Location = new System.Drawing.Point(97, 21);
+            this.tb_FlieName.Margin = new System.Windows.Forms.Padding(2);
+            this.tb_FlieName.Name = "tb_FlieName";
+            this.tb_FlieName.Size = new System.Drawing.Size(209, 21);
+            this.tb_FlieName.TabIndex = 13;
+            // 
+            // tb_new_ljm
+            // 
+            this.tb_new_ljm.Location = new System.Drawing.Point(97, 53);
+            this.tb_new_ljm.Margin = new System.Windows.Forms.Padding(2);
+            this.tb_new_ljm.Name = "tb_new_ljm";
+            this.tb_new_ljm.Size = new System.Drawing.Size(209, 21);
+            this.tb_new_ljm.TabIndex = 14;
+            // 
+            // tb_new_ljz
+            // 
+            this.tb_new_ljz.Location = new System.Drawing.Point(97, 85);
+            this.tb_new_ljz.Margin = new System.Windows.Forms.Padding(2);
+            this.tb_new_ljz.Name = "tb_new_ljz";
+            this.tb_new_ljz.Size = new System.Drawing.Size(209, 21);
+            this.tb_new_ljz.TabIndex = 15;
+            // 
+            // bt_save
+            // 
+            this.bt_save.Location = new System.Drawing.Point(72, 143);
+            this.bt_save.Name = "bt_save";
+            this.bt_save.Size = new System.Drawing.Size(75, 23);
+            this.bt_save.TabIndex = 16;
+            this.bt_save.Text = "Save";
+            this.bt_save.UseVisualStyleBackColor = true;
+            this.bt_save.Click += new System.EventHandler(this.bt_save_Click);
+            // 
+            // bt_export
+            // 
+            this.bt_export.Location = new System.Drawing.Point(215, 143);
+            this.bt_export.Name = "bt_export";
+            this.bt_export.Size = new System.Drawing.Size(75, 23);
+            this.bt_export.TabIndex = 16;
+            this.bt_export.Text = "Export";
+            this.bt_export.UseVisualStyleBackColor = true;
+            this.bt_export.Click += new System.EventHandler(this.bt_export_Click);
+            // 
+            // FormNewLJFile
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.ClientSize = new System.Drawing.Size(386, 206);
+            this.Controls.Add(this.bt_export);
+            this.Controls.Add(this.bt_save);
+            this.Controls.Add(this.tb_new_ljz);
+            this.Controls.Add(this.tb_new_ljm);
+            this.Controls.Add(this.tb_FlieName);
+            this.Controls.Add(this.label3);
+            this.Controls.Add(this.label2);
+            this.Controls.Add(this.label1);
+            this.Name = "FormNewLJFile";
+            this.Text = "FormNewLJFile";
+            this.ResumeLayout(false);
+            this.PerformLayout();
+
+        }
+
+        #endregion
+
+        private System.Windows.Forms.Label label1;
+        private System.Windows.Forms.Label label2;
+        private System.Windows.Forms.Label label3;
+        public System.Windows.Forms.TextBox tb_FlieName;
+        public System.Windows.Forms.TextBox tb_new_ljm;
+        public System.Windows.Forms.TextBox tb_new_ljz;
+        private System.Windows.Forms.Button bt_save;
+        private System.Windows.Forms.Button bt_export;
+    }
+}

+ 131 - 0
OTSIncAReportApp/OTSMgrInfo/FormNewLJFile.cs

@@ -0,0 +1,131 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.IO;
+using System.Linq;
+using System.Text;
+using System.Text.RegularExpressions;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+using System.Xml;
+
+namespace OTSIncAReportApp.OTSMgrInfo
+{
+    public partial class FormNewLJFile : Form
+    {
+        private DataTable partsize = new DataTable();
+        
+        public FormNewLJFile(DataTable a_dataTable)
+        {
+            partsize = a_dataTable;
+            InitializeComponent();
+        }
+
+        private bool Verify()
+        {
+            if (tb_FlieName.Text == "")
+            {
+                MessageBox.Show("输入的粒级名错误,请重新输入", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
+                tb_FlieName.Focus();
+                return false;
+            }
+
+            string tipstr = "粒级值输入错误,请输入粒级的阶段,中间使用“,”号进行分隔,例如:\r\n “1,5,10,15,20,30,40,50” \r\n或可带有小数,例如: \r\n “0.5,1.0,2.22,5.55,8.55,10.33,15,30,40” \r\n如果出现错误,请详细检查输入的格式是否正确,\r\n符号“,”与“.”的输入法是否为英文,及是否半角格式。";
+            //粒级值判断
+            if (tb_new_ljz.Text == "")
+            {
+                MessageBox.Show(tipstr, "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
+                tb_new_ljz.Focus();
+                return false;
+            }
+
+            //粒级值判断,判断是否能通过,纯数字和.及,号组合的正则表达式判断
+            string pat = @"^[-.,0-9]+$";//纯数字,和.及,
+            Regex rg = new Regex(pat);
+            if (false == rg.Match(tb_new_ljz.Text).Success)
+            {
+                MessageBox.Show(tipstr, "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
+                tb_new_ljz.Focus();
+                return false;
+            }
+
+            //粒级值判断,对输入的值进行拆分,然后再对拆分出的各值判断
+            string[] spstr = tb_new_ljz.Text.Split(',');
+            for (int i = 0; i < spstr.Length; i++)
+            {
+                string lsstr = spstr[i];
+
+                pat = @"^\d+(\.\d+)?$";//纯正浮点数数值,含0
+                rg = new Regex(pat);
+
+                if (false == rg.Match(lsstr).Success)
+                {
+                    MessageBox.Show(tipstr, "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
+                    tb_new_ljz.Focus();
+                    return false;
+                }
+            }
+
+            //最后转换,是否抱错
+            try
+            {
+                for (int i = 0; i < spstr.Length; i++)
+                {
+                    double lsd = Convert.ToDouble(spstr[i].Trim());
+                }
+            }
+            catch
+            {
+                MessageBox.Show(tipstr, "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
+                tb_new_ljz.Focus();
+                return false;
+            }
+
+
+            return true;
+        }
+
+        private void bt_save_Click(object sender, EventArgs e)
+        {
+            //校验输入合法性
+            if (Verify() == false)
+            {
+                return;
+            }
+            for (int i=0; i< partsize.Rows.Count;i++ )
+            {
+                if(partsize.Rows[i]["FileName"].ToString()== tb_FlieName.Text+ ".psf")
+                {
+                    MessageBox.Show("File name conflict");
+                    return;
+                }
+                if(partsize.Rows[i]["Name"].ToString() == tb_new_ljz.Text)
+                {
+                    MessageBox.Show("Particle name conflict");
+                    return;
+                }
+            }
+
+            FileStream file = new FileStream(Environment.CurrentDirectory + "\\Config\\ProData\\" + tb_FlieName.Text + ".psf", FileMode.CreateNew);
+            byte[] data = System.Text.Encoding.UTF8.GetBytes("<?xml version=\"1.0\" encoding=\"UTF-8\"?> \r\n<XMLData FileMark=\"626\" Name=\"" + tb_new_ljm.Text.Trim() + "\" Sizes=\"" + tb_new_ljz.Text.Trim() + "\" Version=\"1.1.1\" /> ");
+            file.Write(data, 0, data.Length);
+            file.Flush();
+            file.Close();
+
+            this.Close();
+            ////再重新绑定显示
+            //BindGridView();
+
+            ////为全局选择变量进行重新赋值
+            //ReControlsValue();
+
+        }
+
+        private void bt_export_Click(object sender, EventArgs e)
+        {
+            this.Close();
+        }
+    }
+}

+ 120 - 0
OTSIncAReportApp/OTSMgrInfo/FormNewLJFile.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>

+ 60 - 26
OTSIncAReportApp/OTSMgrInfo/frmPartSizeEditorNew.Designer.cs

@@ -28,6 +28,7 @@
         /// </summary>
         private void InitializeComponent()
         {
+            this.components = new System.ComponentModel.Container();
             System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(frmPartSizeEditorNew));
             this.Gview_LJ = new System.Windows.Forms.DataGridView();
             this.tb_ljm = new System.Windows.Forms.TextBox();
@@ -40,7 +41,10 @@
             this.button4 = new System.Windows.Forms.Button();
             this.tb_lj = new System.Windows.Forms.TextBox();
             this.label3 = new System.Windows.Forms.Label();
+            this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components);
+            this.newFileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
             ((System.ComponentModel.ISupportInitialize)(this.Gview_LJ)).BeginInit();
+            this.contextMenuStrip1.SuspendLayout();
             this.SuspendLayout();
             // 
             // Gview_LJ
@@ -51,53 +55,60 @@
             this.Gview_LJ.AllowUserToResizeRows = false;
             this.Gview_LJ.BackgroundColor = System.Drawing.SystemColors.ControlLightLight;
             this.Gview_LJ.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
-            this.Gview_LJ.Location = new System.Drawing.Point(12, 12);
+            this.Gview_LJ.ContextMenuStrip = this.contextMenuStrip1;
+            this.Gview_LJ.Location = new System.Drawing.Point(8, 8);
+            this.Gview_LJ.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
             this.Gview_LJ.MultiSelect = false;
             this.Gview_LJ.Name = "Gview_LJ";
             this.Gview_LJ.ReadOnly = true;
             this.Gview_LJ.RowHeadersVisible = false;
             this.Gview_LJ.RowTemplate.Height = 30;
-            this.Gview_LJ.Size = new System.Drawing.Size(571, 261);
+            this.Gview_LJ.Size = new System.Drawing.Size(381, 174);
             this.Gview_LJ.TabIndex = 11;
             this.Gview_LJ.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.Gview_LJ_CellClick);
             // 
             // tb_ljm
             // 
-            this.tb_ljm.Location = new System.Drawing.Point(88, 327);
+            this.tb_ljm.Location = new System.Drawing.Point(59, 218);
+            this.tb_ljm.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
             this.tb_ljm.Name = "tb_ljm";
-            this.tb_ljm.Size = new System.Drawing.Size(491, 28);
+            this.tb_ljm.Size = new System.Drawing.Size(329, 21);
             this.tb_ljm.TabIndex = 12;
             // 
             // tb_ljz
             // 
-            this.tb_ljz.Location = new System.Drawing.Point(88, 374);
+            this.tb_ljz.Location = new System.Drawing.Point(59, 249);
+            this.tb_ljz.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
             this.tb_ljz.Name = "tb_ljz";
-            this.tb_ljz.Size = new System.Drawing.Size(491, 28);
+            this.tb_ljz.Size = new System.Drawing.Size(329, 21);
             this.tb_ljz.TabIndex = 12;
             // 
             // label1
             // 
             this.label1.AutoSize = true;
-            this.label1.Location = new System.Drawing.Point(15, 334);
+            this.label1.Location = new System.Drawing.Point(10, 223);
+            this.label1.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
             this.label1.Name = "label1";
-            this.label1.Size = new System.Drawing.Size(62, 18);
+            this.label1.Size = new System.Drawing.Size(41, 12);
             this.label1.TabIndex = 13;
             this.label1.Text = "粒级名";
             // 
             // label2
             // 
             this.label2.AutoSize = true;
-            this.label2.Location = new System.Drawing.Point(15, 381);
+            this.label2.Location = new System.Drawing.Point(10, 254);
+            this.label2.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
             this.label2.Name = "label2";
-            this.label2.Size = new System.Drawing.Size(62, 18);
+            this.label2.Size = new System.Drawing.Size(41, 12);
             this.label2.TabIndex = 13;
             this.label2.Text = "粒级值";
             // 
             // button1
             // 
-            this.button1.Location = new System.Drawing.Point(183, 422);
+            this.button1.Location = new System.Drawing.Point(122, 281);
+            this.button1.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
             this.button1.Name = "button1";
-            this.button1.Size = new System.Drawing.Size(109, 37);
+            this.button1.Size = new System.Drawing.Size(73, 25);
             this.button1.TabIndex = 14;
             this.button1.Text = "保  存";
             this.button1.UseVisualStyleBackColor = true;
@@ -105,9 +116,10 @@
             // 
             // button2
             // 
-            this.button2.Location = new System.Drawing.Point(327, 422);
+            this.button2.Location = new System.Drawing.Point(218, 281);
+            this.button2.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
             this.button2.Name = "button2";
-            this.button2.Size = new System.Drawing.Size(109, 37);
+            this.button2.Size = new System.Drawing.Size(73, 25);
             this.button2.TabIndex = 14;
             this.button2.Text = "确  定";
             this.button2.UseVisualStyleBackColor = true;
@@ -115,9 +127,10 @@
             // 
             // button3
             // 
-            this.button3.Location = new System.Drawing.Point(471, 422);
+            this.button3.Location = new System.Drawing.Point(314, 281);
+            this.button3.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
             this.button3.Name = "button3";
-            this.button3.Size = new System.Drawing.Size(109, 37);
+            this.button3.Size = new System.Drawing.Size(73, 25);
             this.button3.TabIndex = 14;
             this.button3.Text = "返  回";
             this.button3.UseVisualStyleBackColor = true;
@@ -125,9 +138,10 @@
             // 
             // button4
             // 
-            this.button4.Location = new System.Drawing.Point(29, 422);
+            this.button4.Location = new System.Drawing.Point(19, 281);
+            this.button4.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
             this.button4.Name = "button4";
-            this.button4.Size = new System.Drawing.Size(109, 37);
+            this.button4.Size = new System.Drawing.Size(73, 25);
             this.button4.TabIndex = 14;
             this.button4.Text = "另  存";
             this.button4.UseVisualStyleBackColor = true;
@@ -135,26 +149,42 @@
             // 
             // tb_lj
             // 
-            this.tb_lj.Location = new System.Drawing.Point(88, 282);
+            this.tb_lj.Location = new System.Drawing.Point(59, 188);
+            this.tb_lj.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
             this.tb_lj.Name = "tb_lj";
             this.tb_lj.ReadOnly = true;
-            this.tb_lj.Size = new System.Drawing.Size(491, 28);
+            this.tb_lj.Size = new System.Drawing.Size(329, 21);
             this.tb_lj.TabIndex = 12;
             // 
             // label3
             // 
             this.label3.AutoSize = true;
-            this.label3.Location = new System.Drawing.Point(15, 289);
+            this.label3.Location = new System.Drawing.Point(10, 193);
+            this.label3.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
             this.label3.Name = "label3";
-            this.label3.Size = new System.Drawing.Size(62, 18);
+            this.label3.Size = new System.Drawing.Size(41, 12);
             this.label3.TabIndex = 13;
             this.label3.Text = "路  径";
             // 
+            // contextMenuStrip1
+            // 
+            this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
+            this.newFileToolStripMenuItem});
+            this.contextMenuStrip1.Name = "contextMenuStrip1";
+            this.contextMenuStrip1.Size = new System.Drawing.Size(181, 48);
+            // 
+            // newFileToolStripMenuItem
+            // 
+            this.newFileToolStripMenuItem.Name = "newFileToolStripMenuItem";
+            this.newFileToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
+            this.newFileToolStripMenuItem.Text = "NewFile";
+            this.newFileToolStripMenuItem.Click += new System.EventHandler(this.newFileToolStripMenuItem_Click);
+            // 
             // frmPartSizeEditorNew
             // 
-            this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 18F);
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(592, 471);
+            this.ClientSize = new System.Drawing.Size(399, 325);
             this.Controls.Add(this.button3);
             this.Controls.Add(this.button2);
             this.Controls.Add(this.button4);
@@ -167,15 +197,17 @@
             this.Controls.Add(this.tb_ljm);
             this.Controls.Add(this.Gview_LJ);
             this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
+            this.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
             this.MaximizeBox = false;
-            this.MaximumSize = new System.Drawing.Size(614, 527);
+            this.MaximumSize = new System.Drawing.Size(415, 364);
             this.MinimizeBox = false;
-            this.MinimumSize = new System.Drawing.Size(614, 527);
+            this.MinimumSize = new System.Drawing.Size(415, 364);
             this.Name = "frmPartSizeEditorNew";
             this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
             this.Text = "粒级文件编辑器";
             this.Load += new System.EventHandler(this.frmPartSizeEditorNew_Load);
             ((System.ComponentModel.ISupportInitialize)(this.Gview_LJ)).EndInit();
+            this.contextMenuStrip1.ResumeLayout(false);
             this.ResumeLayout(false);
             this.PerformLayout();
 
@@ -194,5 +226,7 @@
         private System.Windows.Forms.Button button4;
         public System.Windows.Forms.TextBox tb_lj;
         private System.Windows.Forms.Label label3;
+        private System.Windows.Forms.ContextMenuStrip contextMenuStrip1;
+        private System.Windows.Forms.ToolStripMenuItem newFileToolStripMenuItem;
     }
 }

+ 10 - 0
OTSIncAReportApp/OTSMgrInfo/frmPartSizeEditorNew.cs

@@ -1,4 +1,5 @@
 using OTSIncAReportApp.Controls;
+using OTSIncAReportApp.OTSMgrInfo;
 using System;
 using System.Data;
 using System.IO;
@@ -413,5 +414,14 @@ namespace OTSIncAReportApp
 
         #endregion
 
+        private void newFileToolStripMenuItem_Click(object sender, EventArgs e)
+        {
+            FormNewLJFile newLJFile = new FormNewLJFile(m_dt_partsize);
+            newLJFile.ShowDialog();
+            //再重新绑定显示
+            BindGridView();
+            //为全局选择变量进行重新赋值
+            ReControlsValue();
+        }
     }
 }

+ 3 - 0
OTSIncAReportApp/OTSMgrInfo/frmPartSizeEditorNew.resx

@@ -117,6 +117,9 @@
   <resheader name="writer">
     <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   </resheader>
+  <metadata name="contextMenuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>17, 17</value>
+  </metadata>
   <metadata name="$this.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>