From 01f5e329d4dfbcd2253a273d8d65b5bfce8d570e Mon Sep 17 00:00:00 2001
From: jinghz@oceic.com <jinghz@oceic.com>
Date: 星期二, 15 八月 2023 16:26:33 +0800
Subject: [PATCH] 增加系统参数

---
 BaseSet/公用资料/其他基础资料/Gy_StdWorkTimes.cs |   76 +++++++++++++++++--------------------
 1 files changed, 35 insertions(+), 41 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_StdWorkTimes.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_StdWorkTimes.cs"
index 1fc5869..757f566 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_StdWorkTimes.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_StdWorkTimes.cs"
@@ -8,7 +8,7 @@
 using System.Text;
 using System.Windows.Forms;
 
-namespace BaseSet.鍏敤璧勬枡.鍏朵粬鍩虹璧勬枡
+namespace BaseSet
 {
     public partial class Gy_StdWorkTimes : Form
     {
@@ -382,24 +382,21 @@
         {
             switch (BillStatus)
             {
-                case DBUtility.ClsPub.Enum_BillStatus.BillStatus_View:
-                    //case DBUtility.ClsPub.Enum_BillStatus.BillStatus_Viewonly:
-                    //娴忚鐘舵��
-                    
+                case 0:
                     xg.Enabled = true;
                     AddRow.Enabled = false;
                     DelRow.Enabled = false;
                     bc.Enabled = false;
                     tc.Enabled = true;
-                    //鏈鏍�
-                    if (txtHChecker.Text.Trim() == "")
-                    {
-                        xg.Enabled = true;
-                    }
-                    else
-                    {
-                        xg.Enabled = false;
-                    }
+                    Sub_LrtextStatus(true);
+                    grdStatus = true;
+                    break;
+                case DBUtility.ClsPub.Enum_BillStatus.BillStatus_View:
+                    xg.Enabled = true;
+                    AddRow.Enabled = false;
+                    DelRow.Enabled = false;
+                    bc.Enabled = false;
+                    tc.Enabled = true;
                     Sub_LrtextStatus(false);
                     grdStatus = false;
                     break;
@@ -423,6 +420,7 @@
                     Sub_LrtextStatus(true);
                     grdStatus = true;
                     break;
+
             }
 
         }
@@ -468,16 +466,6 @@
         //鍗曟嵁瀹屾暣鎬у垽鏂�          鏈畬鎴�
         private bool Sub_AllowSave()
         {
-            //蹇呰緭椤圭洰鏄惁涓虹┖
-            //ClsK3_DepartmentHlp oDept = new ClsK3_DepartmentHlp();
-            //if(!oDept.GetInfoByID(ClsPub.isLong(txtHDeptID.Tag)))
-            //{
-            //    MessageBox.Show("閮ㄩ棬涓嶅瓨鍦紒");
-            //    return false;
-            //}
-
-            //鏄庣粏琛ㄦ槸鍚︿负闆惰
-            
             if (!IsNullRow(0))
             {
                 MessageBox.Show("琛ㄤ綋鏄庣粏琛屼笉瀛樺湪锛佽褰曞叆锛�", "鎻愮ず");
@@ -485,8 +473,18 @@
             }
             else
             {
+
                 return true;
             }
+        }
+        //鏄惁鏄┖琛�
+        private bool IsNullRow(int Row)
+        {
+            if (ClsPub.isInt(grdMain1.Rows[Row].Cells[HMaterIDCol].Value) == 0&& ClsPub.isInt(grdMain1.Rows[Row].Cells[HProcIDCol].Value) == 0&& ClsPub.isDoule( grdMain1.Rows[Row].Cells[HStdWorkTimes].Value )== 0&& ClsPub.isDoule(grdMain1.Rows[Row].Cells[HUpperlimit].Value) == 0&& ClsPub.isDoule(grdMain1.Rows[Row].Cells[HLowerlimit].Value) == 0&& ClsPub.isStrNull(grdMain1.Rows[Row].Cells[HRemarkCol].Value) == ""&& ClsPub.isDoule(grdMain1.Rows[Row].Cells[HStdPiece].Value) == 0&& ClsPub.isDoule(grdMain1.Rows[Row].Cells[HStdPiece].Value) == 0)
+            {
+                return true;
+            }
+            return false;
         }
         //淇濆瓨鍗曟嵁
         private bool Sub_SaveBill()
@@ -495,11 +493,7 @@
             Int32 i;
             bool bResult;
             BillNew = new DAL.ClsGy_StdWorkTimes_Ctl();
-            //缂栬緫鏉冮檺
-            //if (!ClsPub.Security_Log(ModRightNameEdit, 1, true, DBUtility.ClsPub.CurUserName))
-            //{
-            //    return false;
-            //}
+            
             //澶卞幓鐒︾偣
             lblCaption.Focus();
             //
@@ -511,9 +505,13 @@
             BillNew.DetailColl = new List<Model.ClsGy_StdWorkTimes_Model>();
             for (i = 0; i <= grdMain1.RowCount - 1; i++)
             {
-                if (DBUtility.ClsPub.isLong(grdMain1.Rows[i].Cells[HMaterIDCol].Value) != 0 && DBUtility.ClsPub.isLong(grdMain1.Rows[i].Cells[HProcIDCol].Value) != 0)
+                if (IsNullRow(i))
                 {
-                    if (DBUtility.ClsPub.isLong(grdMain1.Rows[i].Cells[HStdWorkTimes].Value)>0&& DBUtility.ClsPub.isLong(grdMain1.Rows[i].Cells[HUpperlimit].Value) > 0&& DBUtility.ClsPub.isLong(grdMain1.Rows[i].Cells[HLowerlimit].Value) > 0 && DBUtility.ClsPub.isLong(grdMain1.Rows[i].Cells[HStdPiece].Value) > 0 && DBUtility.ClsPub.isLong(grdMain1.Rows[i].Cells[HStdPric].Value) > 0)
+                    break;
+                }
+                if (DBUtility.ClsPub.isStrNull(grdMain1.Rows[i].Cells[HMaterIDCol].Value) != "" && DBUtility.ClsPub.isStrNull(grdMain1.Rows[i].Cells[HProcIDCol].Value) != "" && DBUtility.ClsPub.isStrNull(grdMain1.Rows[i].Cells[HStdWorkTimes].Value) != "")
+                {
+                    if (DBUtility.ClsPub.isDoule(grdMain1.Rows[i].Cells[HStdWorkTimes].Value) > 0 && DBUtility.ClsPub.isDoule(grdMain1.Rows[i].Cells[HUpperlimit].Value) > 0 && DBUtility.ClsPub.isDoule(grdMain1.Rows[i].Cells[HLowerlimit].Value) > 0 && DBUtility.ClsPub.isDoule(grdMain1.Rows[i].Cells[HStdPiece].Value) > 0 && DBUtility.ClsPub.isDoule(grdMain1.Rows[i].Cells[HStdPric].Value) > 0)
                     {
                         Model.ClsGy_StdWorkTimes_Model oSub = new Model.ClsGy_StdWorkTimes_Model();
                         oSub.HMaterID = ClsPub.isLong(grdMain1.Rows[i].Cells[HMaterIDCol].Value);
@@ -532,9 +530,14 @@
                     }
                     else
                     {
-                        MessageBox.Show("绗�" + (i+1) + "琛�,鏍囧噯宸ユ椂,涓婇檺姣斾緥,涓嬮檺姣斾緥锛屾爣鍑嗚浠跺拰鏍囧噯璁′环閮藉簲澶т簬0", "鎻愮ず");
+                        MessageBox.Show("绗�" + (i + 1) + "琛�,鏍囧噯宸ユ椂,涓婇檺姣斾緥,涓嬮檺姣斾緥锛屾爣鍑嗚浠跺拰鏍囧噯璁′环閮藉簲澶т簬0", "鎻愮ず");
                         return false;
                     }
+                }
+                else
+                {
+                    MessageBox.Show("绗�" + (i + 1) + "琛�,鐗╂枡銆佸伐搴忓拰鏍囧噯宸ユ椂涓嶈兘涓虹┖", "鎻愮ず");
+                    return false;
                 }
             }
             //淇濆瓨瀹屾瘯鍚庡鐞�
@@ -686,15 +689,6 @@
             //  
             oSumGrid.EditStatus = false;
             return true;
-        }
-        //鏄惁鏄┖琛�
-        private bool IsNullRow(int Row)
-        {
-            if (ClsPub.isInt(grdMain1.Rows[Row].Cells[HMaterIDCol].Value) == 0)
-            {
-                return true;
-            }
-            return false;
         }
         //'鍒ゆ柇缃戞牸琛岀殑褰曞叆鏄惁姝g‘
         private bool CheckGridRow(int Row)

--
Gitblit v1.9.1