Hcsy 8 жил өмнө
parent
commit
b841565805

+ 1 - 1
UAS-MES/FunctionCode/Make/Make_Decompose.cs

@@ -71,7 +71,7 @@ namespace UAS_MES.Make
                 if (ms_id != "")
                 {
                     sql.Clear();
-                    sql.Append("select ms_id,ms_status,ms_makecode,ms_prodcode,pr_detail ||',' || pr_spec pr_name ,ms_sncode,ms_firstsn,ms_craftcode,ms_craftname,ms_wccode from makeserial left join product on pr_code=ms_prodcode where ms_id='" + ms_id + "'");
+                    sql.Append("select ms_id,ms_status,ms_makecode,ms_prodcode,pr_detail ||' | '|| pr_spec pr_name ,ms_sncode,ms_firstsn,ms_craftcode,ms_craftname,ms_wccode from makeserial left join product on pr_code=ms_prodcode where ms_id='" + ms_id + "'");
                     dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
                     if (dt.Rows[0][1].ToString() != "0" && dt.Rows[0][1].ToString() != "1")
                     {

+ 68 - 65
UAS-MES/FunctionCode/SystemSetting/SystemSetting_LabelMaintain.cs

@@ -145,79 +145,82 @@ namespace UAS_MES.SystemSetting
 
         private void LabelDataGridView_CellContentClick(object sender, DataGridViewCellEventArgs e)
         {
-            if (LabelDataGridView.Columns[e.ColumnIndex].HeaderText == "预览")
+            if (e.ColumnIndex >= 0 && e.RowIndex >= 0)
             {
-                //获取路径和标签名称
-                LabelPath = LabelDataGridView.Rows[e.RowIndex].Cells["pl_labelurl"].Value.ToString();
-                LabelCode = LabelDataGridView.Rows[e.RowIndex].Cells["pl_labelcode"].Value.ToString();
-                pl_id1 = LabelDataGridView.Rows[e.RowIndex].Cells["pl_id"].Value.ToString();
-                La_id1 = LabelDataGridView.Rows[e.RowIndex].Cells["la_id"].Value.ToString();
-                if (CodeSoft.Checked)
+                if (LabelDataGridView.Columns[e.ColumnIndex].HeaderText == "预览")
                 {
-                    string LabelName = LabelDataGridView.Rows[e.RowIndex].Cells["pl_labelname"].Value.ToString();
-                    doc = lbl.Documents.Open(BaseUtil.GetLabelUrl(LabelPath, LabelName));
-                    if (doc == null)
-                    {
-                        MessageBox.Show("指定位置文件不存在");
-                        return;
-                    }
-                    ParamNum = doc.Variables.FreeVariables.Count;
-                    //去除之前添加的控件
-                    for (int i = 0; i < (ParamName == null ? 0 : ParamName.Length); i++)
+                    //获取路径和标签名称
+                    LabelPath = LabelDataGridView.Rows[e.RowIndex].Cells["pl_labelurl"].Value.ToString();
+                    LabelCode = LabelDataGridView.Rows[e.RowIndex].Cells["pl_labelcode"].Value.ToString();
+                    pl_id1 = LabelDataGridView.Rows[e.RowIndex].Cells["pl_id"].Value.ToString();
+                    La_id1 = LabelDataGridView.Rows[e.RowIndex].Cells["la_id"].Value.ToString();
+                    if (CodeSoft.Checked)
                     {
-                        if (this.Controls["LabelParam"].Controls[ParamName[i] + "_label"] != null)
+                        string LabelName = LabelDataGridView.Rows[e.RowIndex].Cells["pl_labelname"].Value.ToString();
+                        doc = lbl.Documents.Open(BaseUtil.GetLabelUrl(LabelPath, LabelName));
+                        if (doc == null)
                         {
-                            this.Controls["LabelParam"].Controls.Remove(this.Controls["LabelParam"].Controls[ParamName[i] + "_label"]);
-                            this.Controls["LabelParam"].Controls.Remove(this.Controls["LabelParam"].Controls[ParamName[i]]);
+                            MessageBox.Show("指定位置文件不存在");
+                            return;
                         }
+                        ParamNum = doc.Variables.FreeVariables.Count;
+                        //去除之前添加的控件
+                        for (int i = 0; i < (ParamName == null ? 0 : ParamName.Length); i++)
+                        {
+                            if (this.Controls["LabelParam"].Controls[ParamName[i] + "_label"] != null)
+                            {
+                                this.Controls["LabelParam"].Controls.Remove(this.Controls["LabelParam"].Controls[ParamName[i] + "_label"]);
+                                this.Controls["LabelParam"].Controls.Remove(this.Controls["LabelParam"].Controls[ParamName[i]]);
+                            }
+                        }
+                        ParamName = new string[ParamNum];
+                        for (int i = 0; i < ParamNum; i++)
+                        {
+                            ParamName[i] = doc.Variables.FreeVariables.Item(i + 1).Name;
+                        }
+                        int y = 20;
+                        for (int i = 0; i < ParamName.Length; i++)
+                        {
+                            //变量的名称Label
+                            Label Param = new Label();
+                            Param.Text = ParamName[i];
+                            Param.Name = ParamName[i] + "_label";
+                            Param.AutoSize = true;
+                            Param.Anchor = AnchorStyles.Left;
+                            Param.Anchor = AnchorStyles.Top;
+                            Param.Location = new Point(30, y + 5);
+                            this.Controls["LabelParam"].Controls.Add(Param);
+                            //维护变量的打印测试参数
+                            EnterTextBox TempParam = new EnterTextBox();
+                            TempParam.Anchor = AnchorStyles.Left;
+                            TempParam.Anchor = AnchorStyles.Top;
+                            TempParam.Name = ParamName[i];
+                            TempParam.Location = new Point(110, y);
+                            y = y + 30;
+                            TempParam.Size = new Size(170, 22);
+                            this.Controls["LabelParam"].Controls.Add(TempParam);
+                            y = y + 30;
+                        }
+                        doc.Close();
                     }
-                    ParamName = new string[ParamNum];
-                    for (int i = 0; i < ParamNum; i++)
-                    {
-                        ParamName[i] = doc.Variables.FreeVariables.Item(i + 1).Name;
-                    }
-                    int y = 20;
-                    for (int i = 0; i < ParamName.Length; i++)
-                    {
-                        //变量的名称Label
-                        Label Param = new Label();
-                        Param.Text = ParamName[i];
-                        Param.Name = ParamName[i] + "_label";
-                        Param.AutoSize = true;
-                        Param.Anchor = AnchorStyles.Left;
-                        Param.Anchor = AnchorStyles.Top;
-                        Param.Location = new Point(30, y + 5);
-                        this.Controls["LabelParam"].Controls.Add(Param);
-                        //维护变量的打印测试参数
-                        EnterTextBox TempParam = new EnterTextBox();
-                        TempParam.Anchor = AnchorStyles.Left;
-                        TempParam.Anchor = AnchorStyles.Top;
-                        TempParam.Name = ParamName[i];
-                        TempParam.Location = new Point(110, y);
-                        y = y + 30;
-                        TempParam.Size = new Size(170, 22);
-                        this.Controls["LabelParam"].Controls.Add(TempParam);
-                        y = y + 30;
-                    }
-                    doc.Close();
                 }
-            }
-            if (LabelDataGridView.Columns[e.ColumnIndex].HeaderText == "编辑")
-            {
-                if (e.RowIndex >= 0 && e.ColumnIndex >= 0)
+                if (LabelDataGridView.Columns[e.ColumnIndex].HeaderText == "编辑")
                 {
-                    LabelPath = LabelDataGridView.Rows[e.RowIndex].Cells["pl_labelurl"].Value.ToString();
-                    string LabelName = LabelDataGridView.Rows[e.RowIndex].Cells["pl_labelname"].Value.ToString();
-                    pr_code.Text = LabelDataGridView.Rows[e.RowIndex].Cells["pr_code1"].Value.ToString();
-                    la_code.Text = LabelDataGridView.Rows[e.RowIndex].Cells["pl_labelcode"].Value.ToString();
-                    la_name.Text = LabelDataGridView.Rows[e.RowIndex].Cells["pl_labelname"].Value.ToString();
-                    la_type.Text = LabelDataGridView.Rows[e.RowIndex].Cells["pl_labeltype"].Value.ToString();
-                    FolderPath.Text = ftpOperater.DownLoadTo;
-                    pl_id2 = LabelDataGridView.Rows[e.RowIndex].Cells["pl_id"].Value.ToString();
-                    pr_code_1 = LabelDataGridView.Rows[e.RowIndex].Cells["pr_code1"].Value.ToString();
-                    la_type_1 = LabelDataGridView.Rows[e.RowIndex].Cells["pl_labeltype"].Value.ToString();
-                    pl_default = LabelDataGridView.Rows[e.RowIndex].Cells["pl_isdefault"].Value.ToString();
-                    System.Diagnostics.Process.Start(BaseUtil.GetLabelUrl(LabelPath, LabelName));
+                    if (e.RowIndex >= 0 && e.ColumnIndex >= 0)
+                    {
+                        LabelPath = LabelDataGridView.Rows[e.RowIndex].Cells["pl_labelurl"].Value.ToString();
+                        string LabelName = LabelDataGridView.Rows[e.RowIndex].Cells["pl_labelname"].Value.ToString();
+                        pr_code.Text = LabelDataGridView.Rows[e.RowIndex].Cells["pr_code1"].Value.ToString();
+                        la_code.Text = LabelDataGridView.Rows[e.RowIndex].Cells["pl_labelcode"].Value.ToString();
+                        la_name.Text = LabelDataGridView.Rows[e.RowIndex].Cells["pl_labelname"].Value.ToString();
+                        la_type.Text = LabelDataGridView.Rows[e.RowIndex].Cells["pl_labeltype"].Value.ToString();
+                        FolderPath.Text = ftpOperater.DownLoadTo;
+                        pl_id2 = LabelDataGridView.Rows[e.RowIndex].Cells["pl_id"].Value.ToString();
+                        pr_code_1 = LabelDataGridView.Rows[e.RowIndex].Cells["pr_code1"].Value.ToString();
+                        la_type_1 = LabelDataGridView.Rows[e.RowIndex].Cells["pl_labeltype"].Value.ToString();
+                        pl_default = LabelDataGridView.Rows[e.RowIndex].Cells["pl_isdefault"].Value.ToString();
+                        System.Diagnostics.Process.Start(BaseUtil.GetLabelUrl(LabelPath, LabelName));
+                    }
                 }
             }
         }