Browse Source

验证合同防呆公共方法

shim 8 years ago
parent
commit
42a17989a2
1 changed files with 26 additions and 1 deletions
  1. 26 1
      UAS-MES/PublicMethod/LogicHandler.cs

+ 26 - 1
UAS-MES/PublicMethod/LogicHandler.cs

@@ -1385,6 +1385,31 @@ namespace UAS_MES.PublicMethod
             error = "";
             return true;
         }
-
+        /// <summary>
+        /// 验证是否符合合同防呆
+        /// </summary>
+        /// <param name="msid"></param>
+        /// <param name="macOrBt"></param>
+        /// <param name="type"></param>
+        /// <returns></returns>
+        public static Boolean checkMacOrBtRange(string msid,string macOrBt,string type)
+        {
+            //--判断是否有合同,是否在合同定义的范围内
+            string saleCode= dh.getFieldDataByCondition("makeserial", "ms_salecode", "ms_id='" + msid + "'").ToString();
+            if (saleCode=="")
+            {
+                return true;
+            }
+            //判断是否有合同范围
+            if (dh.CheckExist("SaleMacBTRange","Sr_Sacode = '"+saleCode+"' and sr_type = '"+type+"'"))
+            {
+                //有合同范围再判断是否在范围内
+                if (!dh.CheckExist("SaleMacBTRange", "Sr_Sacode = '"+saleCode+"' and sr_type = '"+type+"' and '"+macOrBt+"' between SR_STARTCODE and SR_ENDCODE"))
+                {
+                    return false;
+                }
+            }
+            return true;
+        }
     }
 }