From 5a517fbdc48beb4eb8291ec18452e11fcbf9da7a Mon Sep 17 00:00:00 2001
From: duhe <226547893@qq.com>
Date: 星期四, 07 三月 2024 11:42:16 +0800
Subject: [PATCH] 1

---
 BaseSet/公用资料/其他基础资料/Gy_ProcPrice.cs |  146 ++++++++++++++++++++++++++++++++++++++++++------
 1 files changed, 128 insertions(+), 18 deletions(-)

diff --git "a/BaseSet/\345\205\254\347\224\250\350\265\204\346\226\231/\345\205\266\344\273\226\345\237\272\347\241\200\350\265\204\346\226\231/Gy_ProcPrice.cs" "b/BaseSet/\345\205\254\347\224\250\350\265\204\346\226\231/\345\205\266\344\273\226\345\237\272\347\241\200\350\265\204\346\226\231/Gy_ProcPrice.cs"
index a0d4391..dc8f1ac 100644
--- "a/BaseSet/\345\205\254\347\224\250\350\265\204\346\226\231/\345\205\266\344\273\226\345\237\272\347\241\200\350\265\204\346\226\231/Gy_ProcPrice.cs"
+++ "b/BaseSet/\345\205\254\347\224\250\350\265\204\346\226\231/\345\205\266\344\273\226\345\237\272\347\241\200\350\265\204\346\226\231/Gy_ProcPrice.cs"
@@ -38,7 +38,19 @@
         public const Int16 HCostFlagCol = 18;
         public const Int16 HFlowFlagCol = 19;
         public const Int16 HPayFlagCol = 20;
-        public const Int16 HRemarkCol = 21;
+        public const Int16 HWorkCenterIDCol = 21;
+        public const Int16 HWorkCenterNumberCol = 22;
+        public const Int16 HWorkCenterNameCol = 23;
+        public const Int16 HWorkQtyCol = 24;
+        public const Int16 HStdEmpCol = 25;
+        public const Int16 HChangeTimesCol = 26;
+        public const Int16 HChangeMoneyCol = 27;
+        public const Int16 HProcNoCol = 28;
+        public const Int16 HPieceTimesCol = 29;
+        public const Int16 HMouldQtyCol = 30;
+        public const Int16 HChangeMouldMoneyCol = 31;
+        public const Int16 HRushQtyCol = 32;
+        public const Int16 HRemarkCol = 33;
         public bool BillChange;   //
         public DBUtility.ClsPub.Enum_OKTag OkTag;
         public DBUtility.ClsPub.Enum_BillStatus BillStatus;
@@ -53,6 +65,8 @@
         public DAL.ClsGy_ProcPrice_Ctl BillNew = new DAL.ClsGy_ProcPrice_Ctl();
         public Model.ClsGy_ProcPrice_Model BillOld = new Model.ClsGy_ProcPrice_Model();
         ClsGridViewSum oSumGrid = new ClsGridViewSum();
+        SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
+        public Int64 sHOrgID = -1;
         //-------------------------------------------------------------------------
         #region 鍥哄畾浠g爜
 
@@ -100,6 +114,13 @@
                     default:
                         break;
                 }
+            }
+            //鏄剧ず褰撳墠鐧诲叆缁勭粐
+            DataSet Ds1 = oCn.RunProcReturn("select * from Xt_ORGANIZATIONS with(nolock) where HItemID=" + ClsPub.HOrgID, "Xt_ORGANIZATIONS", ref DBUtility.ClsPub.sExeReturnInfo);
+            if (Ds1.Tables[0].Rows.Count != 0)
+            {
+                cmbHOrgID.Text = DBUtility.ClsPub.isStrNull(Ds1.Tables[0].Rows[0]["HName"]);
+                sHOrgID = ClsPub.HOrgID;
             }
             //
             initGrid();
@@ -210,8 +231,28 @@
             oSumGrid.oGridsum = grdSum;
             lblCaption.Text = ModName;
             this.Text = ModName;
+            //鍔犺浇缁勭粐淇℃伅
+            Sub_AddOrdList();
         }
-       
+
+        //鍔犺浇缁勭粐淇℃伅
+        private void Sub_AddOrdList()
+        {
+            DataSet ds;
+            DAL.ClsGy_ORGANIZATIONS_View oClsGy_ORGANIZATIONS_View = new DAL.ClsGy_ORGANIZATIONS_View();
+            ds = oClsGy_ORGANIZATIONS_View.GetList();
+            if (ds == null || ds.Tables[0].Rows.Count == 0)
+            {
+                MessageBox.Show("鑾峰彇缁勭粐澶辫触");
+                return;
+            }
+            cmbHOrgID.Items.Clear();
+            for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
+            {
+                cmbHOrgID.Items.Add(DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[i]["HName"]));
+            }
+        }
+
         //瀹℃牳鍗曟嵁
         private void Sub_CheckBill()
         {
@@ -408,8 +449,9 @@
             DAL.ClsIF_Process_View oProc = new DAL.ClsIF_Process_View();
             DAL.ClsIF_Department_View oDept = new DAL.ClsIF_Department_View();
             DAL.ClsIF_Source_View oSource = new DAL.ClsIF_Source_View();
+            DAL.ClsIF_WorkCenter_View oWorkCenter = new DAL.ClsIF_WorkCenter_View();
             //鍒ゆ柇鏄惁瀛樺湪鍗曟嵁
-            if(BillNew.ShowBill(BillOld.HItemID,ref  ClsPub.sExeReturnInfo)==false )
+            if (BillNew.ShowBill(BillOld.HItemID,ref  ClsPub.sExeReturnInfo)==false )
             {
                 MessageBox.Show(ClsPub.sExeReturnInfo, "鎻愮ず");
                 return;
@@ -485,12 +527,31 @@
                     grdMain.Rows[i].Cells[HSourceNumberCol].Value = "";
                     grdMain.Rows[i].Cells[HSourceNameCol].Value = "";
                 }
+                if (oWorkCenter.GetInfoByID(oSub.HWorkCenterID))
+                {
+                    grdMain.Rows[i].Cells[HWorkCenterNumberCol].Value = oWorkCenter.omodel.HNumber;
+                    grdMain.Rows[i].Cells[HWorkCenterNameCol].Value = oWorkCenter.omodel.HName;
+                }
+                else
+                {
+                    grdMain.Rows[i].Cells[HWorkCenterNumberCol].Value = "";
+                    grdMain.Rows[i].Cells[HWorkCenterNameCol].Value = "";
+                }
                 grdMain.Rows[i].Cells[HBeginDateCol].Value = oSub.HBeginDate.ToShortDateString();
                 grdMain.Rows[i].Cells[HEndDateCol].Value = oSub.HEndDate.ToShortDateString();
                 grdMain.Rows[i].Cells[HCostFlagCol].Value = oSub.HCostFlag.ToString();
                 grdMain.Rows[i].Cells[HFlowFlagCol].Value = oSub.HFlowFlag.ToString();
                 grdMain.Rows[i].Cells[HPayFlagCol].Value = oSub.HPayFlag.ToString();
                 grdMain.Rows[i].Cells[HPriceCol].Value = oSub.HPrice.ToString();
+                grdMain.Rows[i].Cells[HWorkQtyCol].Value = oSub.HWorkQty.ToString();
+                grdMain.Rows[i].Cells[HStdEmpCol].Value = oSub.HStdEmp.ToString();
+                grdMain.Rows[i].Cells[HChangeTimesCol].Value = oSub.HChangeTimes.ToString();
+                grdMain.Rows[i].Cells[HChangeMoneyCol].Value = oSub.HChangeMoney.ToString();
+                grdMain.Rows[i].Cells[HProcNoCol].Value = oSub.HProcNo.ToString();
+                grdMain.Rows[i].Cells[HPieceTimesCol].Value = oSub.HPieceTimes.ToString();
+                grdMain.Rows[i].Cells[HMouldQtyCol].Value = oSub.HMouldQty.ToString();
+                grdMain.Rows[i].Cells[HChangeMouldMoneyCol].Value = oSub.HChangeMouldMoney.ToString();
+                grdMain.Rows[i].Cells[HRushQtyCol].Value = oSub.HRushQty.ToString();
                 grdMain.Rows[i].Cells[HRemarkCol].Value = oSub.HRemark;
                 
                 i = i + 1;
@@ -567,10 +628,20 @@
                     oSub.HFlowFlag = ClsPub.GridToBool(grdMain.Rows[i].Cells[HFlowFlagCol].Value);
                     oSub.HPayFlag = ClsPub.GridToBool(grdMain.Rows[i].Cells[HPayFlagCol].Value);
                     oSub.HDeptID = ClsPub.isLong(txtHDeptID.Tag);
-                    oSub.HStopflag = true;
+                    oSub.HStopflag = false;
                     oSub.HMaker = ClsPub.CurUserName;
                     oSub.HMakeDate = DateTime.Today.ToString();
                     oSub.HRemark = ClsPub.isStrNull(grdMain.Rows[i].Cells[HRemarkCol].Value);
+                    oSub.HWorkCenterID = ClsPub.isLong(grdMain.Rows[i].Cells[HWorkCenterIDCol].Value);
+                    oSub.HWorkQty = ClsPub.isSingle(grdMain.Rows[i].Cells[HWorkQtyCol].Value);
+                    oSub.HStdEmp = ClsPub.isSingle(grdMain.Rows[i].Cells[HStdEmpCol].Value);
+                    oSub.HChangeTimes = ClsPub.isSingle(grdMain.Rows[i].Cells[HChangeTimesCol].Value);
+                    oSub.HChangeMoney = ClsPub.isSingle(grdMain.Rows[i].Cells[HChangeMoneyCol].Value);
+                    oSub.HProcNo = ClsPub.isLong(grdMain.Rows[i].Cells[HProcNoCol].Value);
+                    oSub.HPieceTimes = ClsPub.isSingle(grdMain.Rows[i].Cells[HPieceTimesCol].Value);
+                    oSub.HMouldQty = ClsPub.isSingle(grdMain.Rows[i].Cells[HMouldQtyCol].Value);
+                    oSub.HChangeMouldMoney = ClsPub.isSingle(grdMain.Rows[i].Cells[HChangeMouldMoneyCol].Value);
+                    oSub.HRushQty = ClsPub.isSingle(grdMain.Rows[i].Cells[HRushQtyCol].Value);
                     BillNew.DetailColl.Add(oSub);
                 }
             }
@@ -587,13 +658,14 @@
             if (bResult == true)
             {
                 BillChange = true;
-                MessageBox.Show("鍗曟嵁瀛樼洏瀹屾瘯!", "鎻愮ず");
                 if (BillStatus == DBUtility.ClsPub.Enum_BillStatus.BillStatus_AddNew)
                 {
+                    MessageBox.Show("淇濆瓨鎴愬姛锛屾渶鏂版暟鎹杩斿洖鍒楄〃鏌ョ湅锛�", "鎻愮ず");
                     this.Sub_AddBill();
                 }
                 else if (BillStatus == DBUtility.ClsPub.Enum_BillStatus.BillStatus_Modify)
                 {
+                    MessageBox.Show("淇敼鎴愬姛锛�", "鎻愮ず");
                     BillStatus = DBUtility.ClsPub.Enum_BillStatus.BillStatus_View;
                 }
                 this.Sub_OperStatus();
@@ -634,7 +706,8 @@
         //鍒濆鍖朑RID
         private void initGrid()
         {
-            grdMain.ColumnCount = 22;                       //鎬诲垪鏁�
+            grdMain.RowCount = 0;
+            grdMain.ColumnCount = 34;                       //鎬诲垪鏁�
             DBUtility.Xt_BaseBillFun.initGridFst(grdMain, this.Name);
             //
             grdMain.Columns[HMaterIDCol].HeaderText = "鐗╂枡ID";
@@ -656,6 +729,18 @@
             grdMain.Columns[HEndDateCol].HeaderText = "缁撴潫鏃ユ湡";
             grdMain.Columns[HPriceCol].HeaderText = "鍗曚环";
             grdMain.Columns[HRemarkCol].HeaderText = "澶囨敞";
+            grdMain.Columns[HWorkCenterIDCol].HeaderText = "宸ヤ綔涓績ID";
+            grdMain.Columns[HWorkCenterNumberCol].HeaderText = "宸ヤ綔涓績浠g爜";
+            grdMain.Columns[HWorkCenterNameCol].HeaderText = "宸ヤ綔涓績鍚嶇О";
+            grdMain.Columns[HWorkQtyCol].HeaderText = "灏忔椂浜ц兘";
+            grdMain.Columns[HStdEmpCol].HeaderText = "鏍囧噯浜哄姏";
+            grdMain.Columns[HChangeTimesCol].HeaderText = "鎹㈢嚎鏃堕棿";
+            grdMain.Columns[HChangeMoneyCol].HeaderText = "鎹㈢嚎琛ヨ创";
+            grdMain.Columns[HProcNoCol].HeaderText = "宸ヨ壓璺嚎娴佹按鍙�";
+            grdMain.Columns[HPieceTimesCol].HeaderText = "鍗曚欢鍔犲伐鏃堕棿";
+            grdMain.Columns[HMouldQtyCol].HeaderText = "妯″叿鏁伴噺";
+            grdMain.Columns[HChangeMouldMoneyCol].HeaderText = "鎹㈡ā琛ヨ创";
+            grdMain.Columns[HRushQtyCol].HeaderText = "鍗曚欢鍐叉娆℃暟";
             //
             //璁剧疆鐗规畩鍒�
             //HOldMaterBackFlagCol
@@ -690,6 +775,7 @@
             grdMain.Columns[HDeptIDCol].Visible = false;
             grdMain.Columns[HDeptNumberCol].Visible = false;
             grdMain.Columns[HDeptNameCol].Visible = false;
+            grdMain.Columns[HWorkCenterIDCol].Visible = false;
             //
             string sAllowCol = HMaterNumberCol.ToString() +
                             "," + HProcNumberCol.ToString() +
@@ -700,6 +786,16 @@
                             "," + HCostFlagCol.ToString() +
                             "," + HFlowFlagCol.ToString() +
                             "," + HPayFlagCol.ToString() +
+                            "," + HWorkCenterNumberCol.ToString() +
+                            "," + HWorkQtyCol.ToString() +
+                            "," + HStdEmpCol.ToString() +
+                            "," + HChangeTimesCol.ToString() +
+                            "," + HChangeMoneyCol.ToString() +
+                            "," + HProcNoCol.ToString() +
+                            "," + HPieceTimesCol.ToString() +
+                            "," + HMouldQtyCol.ToString() +
+                            "," + HChangeMouldMoneyCol.ToString() +
+                            "," + HRushQtyCol.ToString() +
                             "," + HRemarkCol.ToString();
             string sTotalCol = HPriceCol.ToString();
             //鏍煎紡鍖栫綉鏍�
@@ -744,7 +840,9 @@
         //閫夋嫨鐝粍
         private void cmdHMaterID_Click(object sender, EventArgs e)
         {
-            BLL.ClsBaseSelect_InterFace.SetTextByMater(txtHMaterID,txtHMaterName,txtHMaterModel);
+            string sWhere = "";
+            sWhere = " and HUSEORGID = " + sHOrgID;
+            BLL.ClsBaseSelect_InterFace.SetTextByMater(sWhere,txtHMaterID, txtHMaterName,txtHMaterModel);
 
         }
 
@@ -771,7 +869,7 @@
         //鏄惁鏄┖琛�
         private bool IsNullRow(int Row)
         {
-            if (ClsPub.isInt(grdMain.Rows[Row].Cells[HMaterIDCol].Value) == 0)
+            if (ClsPub.isLong(grdMain.Rows[Row].Cells[HMaterIDCol].Value) == 0)
             {
                 return true;
             }
@@ -795,6 +893,7 @@
         //甯姪鍑芥暟
         private void Sub_GridKey(int sKeyCode, int sRow, int sCol, DataGridViewTextBoxEditingControl oEdit)
         {
+            string sWhere = "";
             if (!grdStatus)
             {
                 return;
@@ -814,8 +913,8 @@
                     switch (sCol)
                     {
                         case HMaterNumberCol:
-                            //BLL.ClsBaseSelect_K3.SetGridByMater_K3(grdMain, sRow, HMaterIDCol, HMaterNumberCol, HMaterNameCol, HMaterModelCol, 0, 0, 0);
-                            BLL.ClsBaseSelect_InterFace.SetGridByMater(grdMain, sRow, HMaterIDCol, HMaterNumberCol, HMaterNameCol, HMaterModelCol, 0, 0, 0);
+                            sWhere = " and HUSEORGID = " + sHOrgID;
+                            BLL.ClsBaseSelect_InterFace.SetGridByMater(grdMain, sWhere, sRow, HMaterIDCol, HMaterNumberCol, HMaterNameCol, HMaterModelCol, 0, 0, 0);
                             if (rbHSelectCus.Checked)
                             {
                                 grdMain.Rows[sRow].Cells[HProcIDCol].Value = txtHProcID.Tag.ToString();
@@ -848,7 +947,11 @@
                             BLL.ClsBaseSelect_InterFace.SetGridBySource(grdMain, sRow, HSourceIDCol, HSourceNumberCol, HSourceNameCol);
                             oEdit.Text = DBUtility.ClsPub.isStrNull(grdMain.Rows[sRow].Cells[HSourceNumberCol].Value);
                             break;
-                        default:
+                            case HWorkCenterNumberCol:
+                                BLL.ClsBaseSelect_InterFace.SetGridByWorkCenter(grdMain, sRow, HWorkCenterIDCol, HWorkCenterNumberCol, HWorkCenterNameCol);
+                                oEdit.Text = DBUtility.ClsPub.isStrNull(grdMain.Rows[sRow].Cells[HWorkCenterNumberCol].Value);
+                                break;
+                            default:
                             break;
                     }
                     break;
@@ -932,12 +1035,19 @@
 
         #endregion
 
-        
-
-        
-
-        
-
-        
+        //閫夋嫨缁勭粐鏃惰Е鍙�
+        private void cmbHOrgID_TextChanged(object sender, EventArgs e)
+        {
+            DAL.ClsGy_ORGANIZATIONS_View oClsGy_ORGANIZATIONS_View = new DAL.ClsGy_ORGANIZATIONS_View();
+            if (oClsGy_ORGANIZATIONS_View.GetInfoByName(cmbHOrgID.Text))
+            {
+                sHOrgID = oClsGy_ORGANIZATIONS_View.omodel.HItemID;
+            }
+            if (sHOrgID == -1)
+            {
+                MessageBox.Show("閫夋嫨缁勭粐鏈夐敊璇紒");
+                return;
+            }
+        }
     }
 }
\ No newline at end of file

--
Gitblit v1.9.1