From 70234836f31c3d1f5d110eca85bc73525ddf8f67 Mon Sep 17 00:00:00 2001
From: zzr99 <1940172413@qq.com>
Date: 星期二, 17 五月 2022 10:44:16 +0800
Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API

---
 BaseSet/导入模板/Gy_DataIn_StdWorkTimes.resx        |    0 
 /dev/null                                       |  230 --------------------
 Model/基础资料/其他基础资料/ClsGy_StdWorkTimes_Model.cs   |    4 
 BaseSet/导入模板/Gy_DataIn_StdWorkTimes.Designer.cs |   79 +++----
 LMES/ClsShowMod.cs                              |   10 
 DAL/基础资料/其他基础资料/ClsGy_StdWorkTimes_Ctl.cs       |   14 +
 BaseSet/导入模板/Gy_DataIn_StdWorkTimes.cs          |  294 ++++++++++++++++++++++++++
 BaseSet/BaseSet.csproj                          |   10 
 PlanM/PlanM.csproj                              |   10 
 9 files changed, 360 insertions(+), 291 deletions(-)

diff --git a/BaseSet/BaseSet.csproj b/BaseSet/BaseSet.csproj
index 4751d46..239fba4 100644
--- a/BaseSet/BaseSet.csproj
+++ b/BaseSet/BaseSet.csproj
@@ -1564,6 +1564,12 @@
     <Compile Include="瀵煎叆妯℃澘\Gy_DataIn_WorkCenter.designer.cs">
       <DependentUpon>Gy_DataIn_WorkCenter.cs</DependentUpon>
     </Compile>
+    <Compile Include="瀵煎叆妯℃澘\Gy_DataIn_StdWorkTimes.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="瀵煎叆妯℃澘\Gy_DataIn_StdWorkTimes.Designer.cs">
+      <DependentUpon>Gy_DataIn_StdWorkTimes.cs</DependentUpon>
+    </Compile>
   </ItemGroup>
   <ItemGroup>
     <COMReference Include="stdole">
@@ -2551,6 +2557,10 @@
       <SubType>Designer</SubType>
       <DependentUpon>Gy_DataIn_WorkCenter.cs</DependentUpon>
     </EmbeddedResource>
+    <EmbeddedResource Include="瀵煎叆妯℃澘\Gy_DataIn_StdWorkTimes.resx">
+      <DependentUpon>Gy_DataIn_StdWorkTimes.cs</DependentUpon>
+      <SubType>Designer</SubType>
+    </EmbeddedResource>
   </ItemGroup>
   <ItemGroup>
     <Folder Include="CLOUD鍩虹璧勬枡\" />
diff --git "a/PlanM/\346\225\260\346\215\256\345\257\274\345\205\245/Gy_StdWorkTimes_RoutingBill.Designer.cs" "b/BaseSet/\345\257\274\345\205\245\346\250\241\346\235\277/Gy_DataIn_StdWorkTimes.Designer.cs"
similarity index 70%
rename from "PlanM/\346\225\260\346\215\256\345\257\274\345\205\245/Gy_StdWorkTimes_RoutingBill.Designer.cs"
rename to "BaseSet/\345\257\274\345\205\245\346\250\241\346\235\277/Gy_DataIn_StdWorkTimes.Designer.cs"
index 3eea509..c5564ae 100644
--- "a/PlanM/\346\225\260\346\215\256\345\257\274\345\205\245/Gy_StdWorkTimes_RoutingBill.Designer.cs"
+++ "b/BaseSet/\345\257\274\345\205\245\346\250\241\346\235\277/Gy_DataIn_StdWorkTimes.Designer.cs"
@@ -1,6 +1,6 @@
-namespace PlanM
+namespace BaseSet
 {
-    partial class Gy_StdWorkTimes_RoutingBill
+    partial class Gy_DataIn_StdWorkTimes
     {
         /// <summary>
         /// 必需的设计器变量。
@@ -41,8 +41,8 @@
             // 
             // pPic
             // 
-            this.pPic.Margin = new System.Windows.Forms.Padding(5, 5, 5, 5);
-            this.pPic.Size = new System.Drawing.Size(1544, 56);
+            this.pPic.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.pPic.Size = new System.Drawing.Size(1158, 45);
             // 
             // panel1
             // 
@@ -53,8 +53,8 @@
             this.panel1.Controls.Add(this.label2);
             this.panel1.Controls.Add(this.cmbHYear);
             this.panel1.Controls.Add(this.label1);
-            this.panel1.Margin = new System.Windows.Forms.Padding(5, 5, 5, 5);
-            this.panel1.Size = new System.Drawing.Size(1544, 52);
+            this.panel1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.panel1.Size = new System.Drawing.Size(1158, 42);
             this.panel1.Controls.SetChildIndex(this.cmdHPath, 0);
             this.panel1.Controls.SetChildIndex(this.label4, 0);
             this.panel1.Controls.SetChildIndex(this.txtHPath, 0);
@@ -68,33 +68,32 @@
             // 
             // lblCaption
             // 
-            this.lblCaption.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0);
-            this.lblCaption.Size = new System.Drawing.Size(160, 24);
+            this.lblCaption.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.lblCaption.Size = new System.Drawing.Size(129, 19);
             this.lblCaption.Text = "数据导入模块";
             // 
             // cmdHPath
             // 
-            this.cmdHPath.Location = new System.Drawing.Point(1043, 9);
-            this.cmdHPath.Margin = new System.Windows.Forms.Padding(5, 5, 5, 5);
+            this.cmdHPath.Location = new System.Drawing.Point(782, 7);
+            this.cmdHPath.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             // 
             // txtHPath
             // 
-            this.txtHPath.Location = new System.Drawing.Point(615, 4);
-            this.txtHPath.Margin = new System.Windows.Forms.Padding(5, 5, 5, 5);
-            this.txtHPath.Size = new System.Drawing.Size(419, 39);
+            this.txtHPath.Location = new System.Drawing.Point(461, 3);
+            this.txtHPath.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.txtHPath.Size = new System.Drawing.Size(315, 32);
             // 
             // label4
             // 
-            this.label4.Location = new System.Drawing.Point(520, 15);
-            this.label4.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0);
+            this.label4.Location = new System.Drawing.Point(390, 12);
+            this.label4.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             // 
             // label1
             // 
             this.label1.AutoSize = true;
-            this.label1.Location = new System.Drawing.Point(35, 11);
-            this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label1.Location = new System.Drawing.Point(26, 9);
             this.label1.Name = "label1";
-            this.label1.Size = new System.Drawing.Size(67, 15);
+            this.label1.Size = new System.Drawing.Size(53, 12);
             this.label1.TabIndex = 104;
             this.label1.Text = "会计年:";
             // 
@@ -102,10 +101,9 @@
             // 
             this.cmbHYear.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
             this.cmbHYear.FormattingEnabled = true;
-            this.cmbHYear.Location = new System.Drawing.Point(112, 10);
-            this.cmbHYear.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.cmbHYear.Location = new System.Drawing.Point(84, 8);
             this.cmbHYear.Name = "cmbHYear";
-            this.cmbHYear.Size = new System.Drawing.Size(124, 23);
+            this.cmbHYear.Size = new System.Drawing.Size(94, 20);
             this.cmbHYear.TabIndex = 105;
             // 
             // cmbHPeriod
@@ -125,62 +123,55 @@
             "10",
             "11",
             "12"});
-            this.cmbHPeriod.Location = new System.Drawing.Point(359, 12);
-            this.cmbHPeriod.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.cmbHPeriod.Location = new System.Drawing.Point(269, 10);
             this.cmbHPeriod.Name = "cmbHPeriod";
-            this.cmbHPeriod.Size = new System.Drawing.Size(112, 23);
+            this.cmbHPeriod.Size = new System.Drawing.Size(85, 20);
             this.cmbHPeriod.TabIndex = 107;
             // 
             // label2
             // 
             this.label2.AutoSize = true;
-            this.label2.Location = new System.Drawing.Point(264, 12);
-            this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label2.Location = new System.Drawing.Point(198, 10);
             this.label2.Name = "label2";
-            this.label2.Size = new System.Drawing.Size(82, 15);
+            this.label2.Size = new System.Drawing.Size(65, 12);
             this.label2.TabIndex = 106;
             this.label2.Text = "会计期间:";
             // 
             // checkadd
             // 
             this.checkadd.AutoSize = true;
-            this.checkadd.Checked = true;
-            this.checkadd.CheckState = System.Windows.Forms.CheckState.Checked;
-            this.checkadd.Location = new System.Drawing.Point(1447, 12);
-            this.checkadd.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.checkadd.Location = new System.Drawing.Point(1085, 10);
             this.checkadd.Name = "checkadd";
-            this.checkadd.Size = new System.Drawing.Size(59, 19);
+            this.checkadd.Size = new System.Drawing.Size(48, 16);
             this.checkadd.TabIndex = 108;
             this.checkadd.Text = "追加";
             this.checkadd.UseVisualStyleBackColor = true;
             // 
             // txtHSheetName
             // 
-            this.txtHSheetName.Location = new System.Drawing.Point(1265, 11);
-            this.txtHSheetName.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.txtHSheetName.Location = new System.Drawing.Point(949, 9);
             this.txtHSheetName.Name = "txtHSheetName";
-            this.txtHSheetName.Size = new System.Drawing.Size(132, 25);
+            this.txtHSheetName.Size = new System.Drawing.Size(100, 21);
             this.txtHSheetName.TabIndex = 109;
             this.txtHSheetName.Text = "Sheet1";
             // 
             // label3
             // 
             this.label3.AutoSize = true;
-            this.label3.Location = new System.Drawing.Point(1203, 12);
-            this.label3.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label3.Location = new System.Drawing.Point(902, 10);
             this.label3.Name = "label3";
-            this.label3.Size = new System.Drawing.Size(52, 15);
+            this.label3.Size = new System.Drawing.Size(41, 12);
             this.label3.TabIndex = 110;
             this.label3.Text = "工作簿";
             // 
-            // Gy_StdWorkTimes_RoutingBill
+            // Gy_DataIn_StdWorkTimes
             // 
-            this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
-            this.ClientSize = new System.Drawing.Size(1544, 789);
-            this.Margin = new System.Windows.Forms.Padding(5, 5, 5, 5);
-            this.Name = "Gy_StdWorkTimes_RoutingBill";
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
+            this.ClientSize = new System.Drawing.Size(1158, 631);
+            this.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.Name = "Gy_DataIn_StdWorkTimes";
             this.Text = "数据导入模块";
-            this.Load += new System.EventHandler(this.Gy_StdWorkTimes_RoutingBill_Load);
+            this.Load += new System.EventHandler(this.Gy_DataIn_StdWorkTimes_Load);
             this.pPic.ResumeLayout(false);
             this.pPic.PerformLayout();
             this.panel1.ResumeLayout(false);
diff --git "a/BaseSet/\345\257\274\345\205\245\346\250\241\346\235\277/Gy_DataIn_StdWorkTimes.cs" "b/BaseSet/\345\257\274\345\205\245\346\250\241\346\235\277/Gy_DataIn_StdWorkTimes.cs"
new file mode 100644
index 0000000..85d088f
--- /dev/null
+++ "b/BaseSet/\345\257\274\345\205\245\346\250\241\346\235\277/Gy_DataIn_StdWorkTimes.cs"
@@ -0,0 +1,294 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Text;
+using System.Windows.Forms;
+using Pub_Class;
+using SQLHelper;
+
+namespace BaseSet
+{
+    public partial class Gy_DataIn_StdWorkTimes : BLL.Gy_DataInTmp
+    {
+        public Gy_DataIn_StdWorkTimes()
+        {
+            InitializeComponent();
+        }
+        public int HItemIDCol = 0;
+        public int HMaterNumberCol = 0;     //物料代码
+        public int HProcNumberCol = 0;      //工序代码
+        public int HStdWorkTimesCol = 0;    //标准工时
+        public int HUpperlimitCol = 0;      //上限比例
+        public int HLowerlimitCol = 0;      //下限比例
+        public int HStdPieceCol = 0;        //标准计件
+        public int HStdPricCol = 0;         //标准计价
+        public int HUSEORGIDCol = 0;        //组织ID
+        public int HMakerCol = 0;           //制单人
+        public int HMakeDateCol = 0;        //制单日期
+        // 
+        public DAL.ClsGy_Process_View oProcHlp = new DAL.ClsGy_Process_View();
+        public DAL.ClsGy_StdWorkTimes_Ctl BillNew = new DAL.ClsGy_StdWorkTimes_Ctl();
+        DAL.ClsIF_Material_View oMaterHlp = new DAL.ClsIF_Material_View();
+        int c = 0;
+
+        public override bool OpenExcelData()
+        {
+            base.sSheetName = txtHSheetName.Text;
+            return base.OpenExcelData();
+        }
+
+        /// <summary>
+        ///  初始化界面
+        /// </summary>
+        public override void initData()
+        {
+            base.initData();
+            base.sSheetName = "标准工时导入";
+            base.ModRightName = "Gy_DataIn_StdWorkTimes";
+            base.ModRightNameCheck = base.ModRightName + base.ModRightNameCheck;
+            base.ModRightNameClose = base.ModRightName + base.ModRightNameClose;
+            base.ModRightNameDelete = base.ModRightName + base.ModRightNameDelete;
+            base.ModRightNameEdit = base.ModRightName + base.ModRightNameEdit;
+            base.ModRightNameMoney = base.ModRightName + base.ModRightNameMoney;
+            base.ModRightNameQty = base.ModRightName + base.ModRightNameQty;
+            base.ModCaption = "标准工时导入";
+            this.Text = base.ModCaption;
+            lblCaption.Text = base.ModCaption;
+            //
+            DBUtility.Gy_BaseFun.SetComboxYear(cmbHYear);
+            DBUtility.Gy_BaseFun.SetComboxPeriod(cmbHPeriod);
+        }
+
+        public override void Sub_DataIn()
+        {
+            HStdWorkTimesCol = DBUtility.Gy_BaseFun.Fun_GetCol("标准工时", grdMain);
+            HProcNumberCol = DBUtility.Gy_BaseFun.Fun_GetCol("工序代码", grdMain);
+            HMaterNumberCol = DBUtility.Gy_BaseFun.Fun_GetCol("物料代码", grdMain);
+            HUpperlimitCol = DBUtility.Gy_BaseFun.Fun_GetCol("上线比例", grdMain);
+            HLowerlimitCol = DBUtility.Gy_BaseFun.Fun_GetCol("下线比例", grdMain);
+            HStdPieceCol = DBUtility.Gy_BaseFun.Fun_GetCol("标准计件", grdMain);
+            HStdPricCol = DBUtility.Gy_BaseFun.Fun_GetCol("标准计价", grdMain);
+
+            //判断导入文档中是否存在以下标题列
+            if (HStdWorkTimesCol == -1)
+            {
+                MessageBox.Show("没有找到【标准工时】的标题", "提示");
+                return;
+            }
+            if (HProcNumberCol == -1)
+            {
+                MessageBox.Show("没有找到【工序代码】的标题", "提示");
+                return;
+            }
+            if (HMaterNumberCol == -1)
+            {
+                MessageBox.Show("没有找到【物料代码】的标题", "提示");
+                return;
+            }
+            if (HUpperlimitCol == -1)
+            {
+                MessageBox.Show("没有找到【上线比例】的标题", "提示");
+                return;
+            }
+            if (HLowerlimitCol == -1)
+            {
+                MessageBox.Show("没有找到【下线比例】的标题", "提示");
+                return;
+            }
+            if (HStdPieceCol == -1)
+            {
+                MessageBox.Show("没有找到【标准计件】的标题", "提示");
+                return;
+            }
+            if (HStdPricCol == -1)
+            {
+                MessageBox.Show("没有找到【标准计价】的标题", "提示");
+                return;
+            }
+            //导入前数据是否合理判断
+            if (!Checkdata())
+            {
+                return;
+            }
+
+            for (int i = 0; i <= grdMain.Rows.Count - 1; i++)
+            {
+                //写入类
+                if (WriteClass(i))
+                {
+                    bool b = false;
+                    //保存记录
+                    b = BillNew.AddNew();
+                    if (b == false) return;
+                    c++;
+                }
+            }
+            MessageBox.Show("导入完毕:共" + c.ToString() + "条数据!");
+            grdMain.DataSource = null;
+            c = 0;
+        }
+
+        //写入类 从控件
+        private bool WriteClass(int row)
+        {
+            Model.ClsGy_StdWorkTimes_Model oSub = new Model.ClsGy_StdWorkTimes_Model();
+            BillNew.DetailColl.Clear();
+            string sHMaterNumber = "";
+            string sHProcNumber = "";
+            //
+            sHMaterNumber = DBUtility.ClsPub.isStrNull(grdMain.Rows[row].Cells[HMaterNumberCol].Value);
+            sHProcNumber = DBUtility.ClsPub.isStrNull(grdMain.Rows[row].Cells[HProcNumberCol].Value);
+
+            //写入信息
+            //得到物料内码
+            if (oMaterHlp.GetInfoByNumber(sHMaterNumber))
+            {
+                oSub.HMaterID = oMaterHlp.omodel.HItemID;
+            }
+            //得到工序内码
+            if (oProcHlp.GetInfoByNumber(sHProcNumber))
+            {
+                oSub.HProcID = oProcHlp.omodel.HItemID;
+            }
+            oSub.HRemark = "";
+            oSub.HStdWorkTimes = DBUtility.ClsPub.isDoule(grdMain.Rows[row].Cells[HStdWorkTimesCol].Value);
+            oSub.HUpperlimit = DBUtility.ClsPub.isDoule(grdMain.Rows[row].Cells[HUpperlimitCol].Value);
+            oSub.HLowerlimit = DBUtility.ClsPub.isDoule(grdMain.Rows[row].Cells[HLowerlimitCol].Value);
+            oSub.HStdPiece = DBUtility.ClsPub.isDoule(grdMain.Rows[row].Cells[HStdPieceCol].Value);
+            oSub.HStdPric = DBUtility.ClsPub.isDoule(grdMain.Rows[row].Cells[HStdPricCol].Value);
+            oSub.HUSEORGID = DBUtility.ClsPub.HOrgID;
+            oSub.HMaker = DBUtility.ClsPub.CurUserName;
+            oSub.HMakeDate = DateTime.Today.ToShortDateString();
+            BillNew.DetailColl.Add(oSub);
+
+            //非追加模式,导入前根据物料ID、工序ID查找删除对应记录
+            if (checkadd.Checked == false)
+            {
+                BillNew.DeleteByMaterIDAndHProcID(oSub.HMaterID, oSub.HProcID);
+            }
+            return true;
+        }
+
+        //检查导入数据是否合理
+        private bool Checkdata()
+        {
+            bool b = false;
+            string sErrMsg = "";
+            string sMsg = "";
+            for (int i = 0; i <= grdMain.Rows.Count - 1; i++)
+            {
+                string sHMaterNumber = "";
+                string sHProcNumber = "";
+                double sHStdWorkTimes = 0;
+                double sHUpperlimit = 0;
+                double sHLowerlimit = 0;
+                double sHStdPiece = 0;
+                double sHStdPric = 0;
+                //
+                sHMaterNumber = DBUtility.ClsPub.isStrNull(grdMain.Rows[i].Cells[HMaterNumberCol].Value);
+                sHProcNumber = DBUtility.ClsPub.isStrNull(grdMain.Rows[i].Cells[HProcNumberCol].Value);
+                sHStdWorkTimes = DBUtility.ClsPub.isDoule(grdMain.Rows[i].Cells[HStdWorkTimesCol].Value);
+                sHUpperlimit = DBUtility.ClsPub.isDoule(grdMain.Rows[i].Cells[HUpperlimitCol].Value);
+                sHLowerlimit = DBUtility.ClsPub.isDoule(grdMain.Rows[i].Cells[HLowerlimitCol].Value);
+                sHStdPiece = DBUtility.ClsPub.isDoule(grdMain.Rows[i].Cells[HStdPieceCol].Value);
+                sHStdPric = DBUtility.ClsPub.isDoule(grdMain.Rows[i].Cells[HStdPricCol].Value);
+                // 
+                //审核代码是否合理
+                if (!DBUtility.ClsPub.AllowNumber(sHMaterNumber))
+                {
+                    sErrMsg = sErrMsg + "第" + (i + 1).ToString() + "行,物料代码中不能出现连续‘.’并且首位末位不能为‘.’!\r\n";
+                    b = true;
+                }
+                if (!DBUtility.ClsPub.AllowNumber(sHProcNumber))
+                {
+                    sErrMsg = sErrMsg + "第" + (i + 1).ToString() + "行,工序代码中不能出现连续‘.’并且首位末位不能为‘.’!\r\n";
+                    b = true;
+                }
+
+                //判断所导入数据是否正确
+                if (sHStdWorkTimes<=0)
+                {
+                    sErrMsg = sErrMsg + "第" + (i + 1).ToString() + "行,标准工时不能小于或等于0!\r\n";
+                    b = true;
+                }
+                if (sHUpperlimit < 0)
+                {
+                    sErrMsg = sErrMsg + "第" + (i + 1).ToString() + "行,上限比例不能小于0!\r\n";
+                    b = true;
+                }
+                if (sHLowerlimit < 0)
+                {
+                    sErrMsg = sErrMsg + "第" + (i + 1).ToString() + "行,下限比例不能小于0!\r\n";
+                    b = true;
+                }
+                if (sHStdPiece < 0)
+                {
+                    sErrMsg = sErrMsg + "第" + (i + 1).ToString() + "行,标准计件不能小于0!\r\n";
+                    b = true;
+                }
+                if (sHStdPric < 0)
+                {
+                    sErrMsg = sErrMsg + "第" + (i + 1).ToString() + "行,标准计价不能小于0!\r\n";
+                    b = true;
+                }
+
+                if (sHMaterNumber == "")
+                {
+                    sErrMsg = sErrMsg + "第" + (i + 1).ToString() + "行,物料代码不能为空!\r\n";
+                    b = true;
+                }
+                else
+                {
+                    //得到物料内码
+                    if (!oMaterHlp.GetInfoByNumber(sHMaterNumber))
+                    {
+                        sMsg = "[" + sHMaterNumber + "]物料不存在";
+                        if (sErrMsg.Contains(sMsg) == false)
+                        {
+                            sErrMsg = sErrMsg + "[" + sHMaterNumber + "]物料不存在\r\n";
+                        }
+                        b = true;
+                    }
+                }
+
+                if (sHProcNumber == "")
+                {
+                    sErrMsg = sErrMsg + "第" + (i + 1).ToString() + "行,工序代码不能为空!\r\n";
+                    b = true;
+                }
+                else
+                {
+                    //得到工序内码
+                    if (!oProcHlp.GetInfoByNumber(sHProcNumber))
+                    {
+                        sMsg = "[" + sHProcNumber + "]工序不存在";
+                        if (sErrMsg.Contains(sMsg) == false)
+                        {
+                            sErrMsg = sErrMsg + "[" + sHProcNumber + "]工序不存在\r\n";
+                        }
+                        b = true;
+                    }
+                }
+            }
+            if (b == true)
+            {
+                Pub_Control.ErrMsgBox oMsgbox = new Pub_Control.ErrMsgBox();
+                oMsgbox.txtHErrMsg.Text = sErrMsg;
+                oMsgbox.ShowDialog();
+                return false;
+            }
+            else
+            {
+                return true;
+            }
+        }
+
+        private void Gy_DataIn_StdWorkTimes_Load(object sender, EventArgs e)
+        {
+
+        }
+    }
+}
+
diff --git "a/PlanM/\346\225\260\346\215\256\345\257\274\345\205\245/Gy_StdWorkTimes_RoutingBill.resx" "b/BaseSet/\345\257\274\345\205\245\346\250\241\346\235\277/Gy_DataIn_StdWorkTimes.resx"
similarity index 100%
rename from "PlanM/\346\225\260\346\215\256\345\257\274\345\205\245/Gy_StdWorkTimes_RoutingBill.resx"
rename to "BaseSet/\345\257\274\345\205\245\346\250\241\346\235\277/Gy_DataIn_StdWorkTimes.resx"
diff --git "a/DAL/\345\237\272\347\241\200\350\265\204\346\226\231/\345\205\266\344\273\226\345\237\272\347\241\200\350\265\204\346\226\231/ClsGy_StdWorkTimes_Ctl.cs" "b/DAL/\345\237\272\347\241\200\350\265\204\346\226\231/\345\205\266\344\273\226\345\237\272\347\241\200\350\265\204\346\226\231/ClsGy_StdWorkTimes_Ctl.cs"
index 42260f2..30aa5ff 100644
--- "a/DAL/\345\237\272\347\241\200\350\265\204\346\226\231/\345\205\266\344\273\226\345\237\272\347\241\200\350\265\204\346\226\231/ClsGy_StdWorkTimes_Ctl.cs"
+++ "b/DAL/\345\237\272\347\241\200\350\265\204\346\226\231/\345\205\266\344\273\226\345\237\272\347\241\200\350\265\204\346\226\231/ClsGy_StdWorkTimes_Ctl.cs"
@@ -146,6 +146,20 @@
             }
         }
 
+        //鏍规嵁鐗╂枡ID銆佸伐搴廔D 鍒犻櫎 鏍囧噯宸ユ椂
+        public bool DeleteByMaterIDAndHProcID(Int64 HMaterID, Int64 HProcID)
+        {
+            try
+            {
+                oCn.RunProc("Delete from Gy_StdWorkTimes where HMaterID=" + HMaterID.ToString() + " and HProcID=" + HProcID.ToString());
+                return true;
+            }
+            catch (Exception e)
+            {
+                return false;
+            }
+        }
+
         public ClsGy_StdWorkTimes_Ctl()
         {
             MvarItemKey = "Gy_StdWorkTimes";
diff --git a/LMES/ClsShowMod.cs b/LMES/ClsShowMod.cs
index 2fe85ee..12493be 100644
--- a/LMES/ClsShowMod.cs
+++ b/LMES/ClsShowMod.cs
@@ -8085,11 +8085,11 @@
                         oGy_DataIn_ProcessPrice.Show();
                         oMainForm.AddTabPage(oGy_DataIn_ProcessPrice);
                         break;
-                    case "gy_stdworktimes_routingbill":
-                        Gy_StdWorkTimes_RoutingBill oGy_StdWorkTimes_RoutingBill = new Gy_StdWorkTimes_RoutingBill();
-                        oGy_StdWorkTimes_RoutingBill.MdiParent = oMain;
-                        oGy_StdWorkTimes_RoutingBill.Show();
-                        oMainForm.AddTabPage(oGy_StdWorkTimes_RoutingBill);
+                    case "gy_datain_stdworktimes":
+                        Gy_DataIn_StdWorkTimes oGy_DataIn_StdWorkTimes = new Gy_DataIn_StdWorkTimes();
+                        oGy_DataIn_StdWorkTimes.MdiParent = oMain;
+                        oGy_DataIn_StdWorkTimes.Show();
+                        oMainForm.AddTabPage(oGy_DataIn_StdWorkTimes);
                         break;
                     case "gy_datain_process":
                         Gy_DataIn_Process oGy_DataIn_Process = new Gy_DataIn_Process();
diff --git "a/Model/\345\237\272\347\241\200\350\265\204\346\226\231/\345\205\266\344\273\226\345\237\272\347\241\200\350\265\204\346\226\231/ClsGy_StdWorkTimes_Model.cs" "b/Model/\345\237\272\347\241\200\350\265\204\346\226\231/\345\205\266\344\273\226\345\237\272\347\241\200\350\265\204\346\226\231/ClsGy_StdWorkTimes_Model.cs"
index 1ff276e..a965b48 100644
--- "a/Model/\345\237\272\347\241\200\350\265\204\346\226\231/\345\205\266\344\273\226\345\237\272\347\241\200\350\265\204\346\226\231/ClsGy_StdWorkTimes_Model.cs"
+++ "b/Model/\345\237\272\347\241\200\350\265\204\346\226\231/\345\205\266\344\273\226\345\237\272\347\241\200\350\265\204\346\226\231/ClsGy_StdWorkTimes_Model.cs"
@@ -24,7 +24,7 @@
         public double HStdWorkTimes;    //鏍囧噯宸ユ椂
         public double HUpperlimit;  //涓婇檺姣斾緥
         public double HLowerlimit;	//涓嬮檺姣斾緥
-        public double HStdPiece;  //涓婇檺姣斾緥
-        public double HStdPric;	//涓嬮檺姣斾緥
+        public double HStdPiece;  //鏍囧噯璁′欢
+        public double HStdPric;	//鏍囧噯璁′环
     }
 }
diff --git a/PlanM/PlanM.csproj b/PlanM/PlanM.csproj
index 0bf7d26..026fa9a 100644
--- a/PlanM/PlanM.csproj
+++ b/PlanM/PlanM.csproj
@@ -183,12 +183,6 @@
     <Compile Include="鏁版嵁瀵煎叆\Gy_DataIn_RoutingBill.designer.cs">
       <DependentUpon>Gy_DataIn_RoutingBill.cs</DependentUpon>
     </Compile>
-    <Compile Include="鏁版嵁瀵煎叆\Gy_StdWorkTimes_RoutingBill.cs">
-      <SubType>Form</SubType>
-    </Compile>
-    <Compile Include="鏁版嵁瀵煎叆\Gy_StdWorkTimes_RoutingBill.designer.cs">
-      <DependentUpon>Gy_StdWorkTimes_RoutingBill.cs</DependentUpon>
-    </Compile>
     <Compile Include="鏁版嵁瀵煎叆\Gy_DataIn_RoutingBill_New.cs">
       <SubType>Form</SubType>
     </Compile>
@@ -285,10 +279,6 @@
     </EmbeddedResource>
     <EmbeddedResource Include="鏁版嵁瀵煎叆\Gy_DataIn_RoutingBill.resx">
       <DependentUpon>Gy_DataIn_RoutingBill.cs</DependentUpon>
-      <SubType>Designer</SubType>
-    </EmbeddedResource>
-    <EmbeddedResource Include="鏁版嵁瀵煎叆\Gy_StdWorkTimes_RoutingBill.resx">
-      <DependentUpon>Gy_StdWorkTimes_RoutingBill.cs</DependentUpon>
       <SubType>Designer</SubType>
     </EmbeddedResource>
     <EmbeddedResource Include="鏁版嵁瀵煎叆\Gy_DataIn_RoutingBill_New.resx">
diff --git "a/PlanM/\346\225\260\346\215\256\345\257\274\345\205\245/Gy_StdWorkTimes_RoutingBill.cs" "b/PlanM/\346\225\260\346\215\256\345\257\274\345\205\245/Gy_StdWorkTimes_RoutingBill.cs"
deleted file mode 100644
index 095e1cd..0000000
--- "a/PlanM/\346\225\260\346\215\256\345\257\274\345\205\245/Gy_StdWorkTimes_RoutingBill.cs"
+++ /dev/null
@@ -1,230 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.ComponentModel;
-using System.Data;
-using System.Drawing;
-using System.Text;
-using System.Windows.Forms;
-using Pub_Class;
-using SQLHelper;
-
-namespace PlanM
-{
-    public partial class Gy_StdWorkTimes_RoutingBill : BLL.Gy_DataInTmp
-    {
-        public Gy_StdWorkTimes_RoutingBill()
-        {
-            InitializeComponent();
-        }
-        public int HItemID =0;
-        public int HMaker = 0;      //制单人
-        public int HMakeDate = 0; //制单日期
-        public int HChecker = 0; //审核人
-        public int HCheckDate = 0; //审核日期
-        public int HStopflag = 0;
-        public int HRemark = 0;
-        public int HUSEORGName = 0;       //组织ID
-        public int HProcName = 0; //
-        public int HMaterName = 0;    //物料ID
-        public int HProcNum = 0; //
-        public int HMaterNum = 0;    //物料ID
-        public int HStdWorkTimes = 0;    //标准工时
-        public int HUpperlimit = 0;  //上限比例
-        public int HLowerlimit = 0;	//下限比例
-        public int HStdPiece = 0;  //上限比例
-        public int HStdPric = 0;	//下限比例
-        //
-        public const int HBeginRow = 2;         //有效数据,开始行数
-
-
-        // 
-        public DAL.ClsGy_Process_View oProcHlp = new DAL.ClsGy_Process_View();
-        public DAL.ClsGy_StdWorkTimes_Ctl BillNew = new DAL.ClsGy_StdWorkTimes_Ctl();
-        DAL.ClsIF_Material_View oMaterHlp = new DAL.ClsIF_Material_View();
-
-       
-
-        public override bool OpenExcelData()
-        {
-            base.sSheetName = txtHSheetName.Text;
-            return base.OpenExcelData();
-        }
-
-
-        /// <summary>
-        ///  初始化界面
-        /// </summary>
-        public override void initData()
-        {
-            base.initData();
-            base.sSheetName = "标准工时";
-            base.ModRightName = "Gy_StdWorkTimes_RoutingBill";
-            base.ModRightNameCheck = base.ModRightName + base.ModRightNameCheck;
-            base.ModRightNameClose = base.ModRightName + base.ModRightNameClose;
-            base.ModRightNameDelete = base.ModRightName + base.ModRightNameDelete;
-            base.ModRightNameEdit = base.ModRightName + base.ModRightNameEdit;
-            base.ModRightNameMoney = base.ModRightName + base.ModRightNameMoney;
-            base.ModRightNameQty = base.ModRightName + base.ModRightNameQty;
-            base.ModCaption = "标准工时";
-            this.Text = base.ModCaption;
-            lblCaption.Text = base.ModCaption;
-            //
-            DBUtility.Gy_BaseFun.SetComboxYear(cmbHYear);
-            DBUtility.Gy_BaseFun.SetComboxPeriod(cmbHPeriod);
-            //
-        }
-
-        public override void Sub_DataIn()
-        {
-            int sHStdWorkTimesCol = DBUtility.Gy_BaseFun.Fun_GetCol("标准工时", grdMain);
-            int sHProcNumCol = DBUtility.Gy_BaseFun.Fun_GetCol("工序代码", grdMain);
-            int sHProcNameCol = DBUtility.Gy_BaseFun.Fun_GetCol("工序", grdMain);
-            int sHMaterNumCol = DBUtility.Gy_BaseFun.Fun_GetCol("物料代码", grdMain);
-            int sHMaterNameCol = DBUtility.Gy_BaseFun.Fun_GetCol("物料", grdMain);
-            int sHUpperlimitCol = DBUtility.Gy_BaseFun.Fun_GetCol("上线比例", grdMain);
-            int sHLowerlimitCol = DBUtility.Gy_BaseFun.Fun_GetCol("下线比例", grdMain);
-            int sHStdPieceCol = DBUtility.Gy_BaseFun.Fun_GetCol("标准计件", grdMain);
-            int sHStdPricCol = DBUtility.Gy_BaseFun.Fun_GetCol("标准计价", grdMain);
-            int sHUSEORGNameCol = DBUtility.Gy_BaseFun.Fun_GetCol("组织", grdMain);
-            int sHMakerCol = DBUtility.Gy_BaseFun.Fun_GetCol("制单人", grdMain);
-            int sHMakeDateCol = DBUtility.Gy_BaseFun.Fun_GetCol("制单日期", grdMain);
-
-            for (int i = 0; i <= grdMain.Rows.Count - 1; i++)
-            {
-                if (DBUtility.ClsPub.isStrNull(grdMain.Rows[i].Cells[sHMaterNumCol].Value) != "" && DBUtility.ClsPub.isStrNull(grdMain.Rows[i].Cells[sHProcNumCol].Value) != ""&& DBUtility.ClsPub.isStrNull(grdMain.Rows[i].Cells[sHStdWorkTimesCol].Value) != "")
-                {
-                    if (DBUtility.ClsPub.isDoule(grdMain.Rows[i].Cells[sHStdWorkTimesCol].Value)>0&& DBUtility.ClsPub.isDoule(grdMain.Rows[i].Cells[sHUpperlimitCol].Value) > 0&& DBUtility.ClsPub.isDoule(grdMain.Rows[i].Cells[sHLowerlimitCol].Value) > 0)
-                    {
-                        //写入类
-                        if (WriteClass(i))
-                        {
-                            //保存记录
-                            if (!BillNew.AddNew())
-                            {
-                                MessageBox.Show("导入失败!原因:" + DBUtility.ClsPub.sExeReturnInfo, "提示");
-                                return;
-                            }
-                        }
-                    }
-                    else
-                    {
-                        MessageBox.Show("第" + (i + 1) + "行,标准工时、上限比例和下限比例不能小于0", "提示");
-                        return;
-                    }
-                }
-                else
-                {
-                    MessageBox.Show("第"+(i+1)+"行,工序代码、物料代码和标准工时不能为空!原因:" + DBUtility.ClsPub.sExeReturnInfo, "提示");
-                    return;
-                }
-            }
-            MessageBox.Show("导入完毕");
-            grdMain.DataSource = null;
-        }
-
-        //写入类 从控件
-        private bool WriteClass(int row)
-        {
-            BillNew.DetailColl.Clear();
-            string sMaterNumber = "";
-            string sMaterName = "";
-            string sProcNumber = "";
-            string sProcName = "";
-            double sStdWorkTimes = 0;
-            double sUpperlimit = 0;
-            double sLowerlimit = 0;
-            double sStdPiece = 0;
-            double sStdPric= 0;
-            int sUSEORGName = 0;
-            DateTime sHMakeDate = DateTime.Today.Date;
-            string sHMaker = DBUtility.ClsPub.CurUserName;
-
-            int sHStdWorkTimesCol = DBUtility.Gy_BaseFun.Fun_GetCol("标准工时", grdMain);
-            int sHProcNumCol = DBUtility.Gy_BaseFun.Fun_GetCol("工序代码", grdMain);
-            int sHProcNameCol = DBUtility.Gy_BaseFun.Fun_GetCol("工序", grdMain);
-            int sHMaterNumCol = DBUtility.Gy_BaseFun.Fun_GetCol("物料代码", grdMain);
-            int sHMaterNameCol = DBUtility.Gy_BaseFun.Fun_GetCol("物料", grdMain);
-            int sHUpperlimitCol = DBUtility.Gy_BaseFun.Fun_GetCol("上线比例", grdMain);
-            int sHLowerlimitCol = DBUtility.Gy_BaseFun.Fun_GetCol("下线比例", grdMain);
-            int sHStdPieceCol = DBUtility.Gy_BaseFun.Fun_GetCol("标准计件", grdMain);
-            int sHStdPricCol = DBUtility.Gy_BaseFun.Fun_GetCol("标准计价", grdMain);
-            int sHUSEORGNameCol = DBUtility.Gy_BaseFun.Fun_GetCol("组织", grdMain);
-            int sHMakerCol = DBUtility.Gy_BaseFun.Fun_GetCol("制单人", grdMain);
-            int sHMakeDateCol = DBUtility.Gy_BaseFun.Fun_GetCol("制单日期", grdMain);
-            //
-            sMaterNumber = DBUtility.ClsPub.isStrNull(grdMain.Rows[row].Cells[sHMaterNumCol].Value);
-            //sMaterName = DBUtility.ClsPub.isStrNull(grdMain.Rows[row].Cells[sHMaterNameCol].Value);
-            sProcNumber = DBUtility.ClsPub.isStrNull(grdMain.Rows[row].Cells[sHProcNumCol].Value);
-            //sProcName = DBUtility.ClsPub.isStrNull(grdMain.Rows[row].Cells[sHProcNameCol].Value);
-            sStdWorkTimes = DBUtility.ClsPub.isDoule(grdMain.Rows[row].Cells[sHStdWorkTimesCol].Value);
-            sUpperlimit = DBUtility.ClsPub.isDoule(grdMain.Rows[row].Cells[sHUpperlimitCol].Value);
-            sLowerlimit = DBUtility.ClsPub.isDoule(grdMain.Rows[row].Cells[sHLowerlimitCol].Value);
-            sStdPiece = DBUtility.ClsPub.isDoule(grdMain.Rows[row].Cells[sHStdPieceCol].Value);
-            sStdPric = DBUtility.ClsPub.isDoule(grdMain.Rows[row].Cells[sHStdPricCol].Value);
-            //sUSEORGName = DBUtility.ClsPub.isInt(grdMain.Rows[row].Cells[sHUSEORGNameCol].Value);
-            //sHMakeDate = DBUtility.ClsPub.isDate(grdMain.Rows[row].Cells[sHMakeDateCol].Value);
-            //sHMaker = DBUtility.ClsPub.isStrNull(grdMain.Rows[row].Cells[sHMakerCol].Value);
-
-            //判断是否允许 保存
-            
-            //审核代码是否合理
-            if (!DBUtility.ClsPub.AllowNumber(sMaterNumber))
-            {
-                MessageBox.Show("产品代码中不能出现连续‘.’并且首位末位不能为‘.’!", "提示");
-                return false;
-            }
-            if (!DBUtility.ClsPub.AllowNumber(sProcNumber))
-            {
-                MessageBox.Show("工序代码中不能出现连续‘.’并且首位末位不能为‘.’!", "提示");
-                return false;
-            }
-
-            Model.ClsGy_StdWorkTimes_Model oSub = new Model.ClsGy_StdWorkTimes_Model();
-            //得到物料内码
-            if (oMaterHlp.GetInfoByNumber(sMaterNumber))
-            {
-                oSub.HMaterID = oMaterHlp.omodel.HItemID;
-            }
-            else
-            {
-                oSub.HMaterID = 0;
-                MessageBox.Show("第" + row.ToString() + "行," + sMaterNumber + "没有找到对应的物料!");
-                return false;
-            }
-            //得到工序内码
-            if (oProcHlp.GetInfoByNumber(sProcNumber))
-            {
-                oSub.HProcID = oProcHlp.omodel.HItemID;
-            }
-            else
-            {
-                oSub.HProcID = 0;
-                MessageBox.Show("第" + row.ToString() + "行," + sProcNumber + "没有找到对应的工序!");
-                return false;
-            }
-            
-            //写入信息
-           
-            oSub.HRemark = "";
-            oSub.HStdWorkTimes = sStdWorkTimes;
-            oSub.HUpperlimit = sUpperlimit;
-            oSub.HLowerlimit = sLowerlimit;
-            oSub.HStdPiece = sStdPiece;
-            oSub.HStdPric = sStdPric;
-            oSub.HUSEORGID = DBUtility.ClsPub.HOrgID;
-            oSub.HMaker = DBUtility.ClsPub.CurUserName;
-            oSub.HMakeDate = DateTime.Today.ToShortDateString();
-            BillNew.DetailColl.Add(oSub);
-            //oProc.oModel.HBillSubType = DBUtility.ClsPub.isStrNull(txtHBillSubType.Text);
-
-            return true;
-        }
-
-
-        private void Gy_StdWorkTimes_RoutingBill_Load(object sender, EventArgs e)
-        {
-
-        }
-    }
-}
-

--
Gitblit v1.9.1