Explorar o código

修改获取多个序列的方法

章政 %!s(int64=8) %!d(string=hai) anos
pai
achega
22d039d632

+ 2 - 2
UAS-MES/DataOperate/DataHelper.cs

@@ -681,10 +681,10 @@ namespace UAS_MES.DataOperate
         /// </summary>
         /// <param name="SeqName"></param>
         /// <returns></returns>
-        public string[] GetSEQ(string SeqName, int Num)
+        public string[] GetSEQ(string SeqName,string TableName, int Num)
         {
             DataTable dt = new DataTable();
-            dt = (DataTable)ExecuteSql("select " + SeqName + ".nextval from (select 1 from OQCITEMSAMPLES where rownum<" + (Num + 1) + ")", "select");
+            dt = (DataTable)ExecuteSql("select " + SeqName + ".nextval from (select 1 from "+ TableName + " where rownum<" + (Num + 1) + ")", "select");
             string[] SerialNum = new string[dt.Rows.Count];
             for (int i = 0; i < dt.Rows.Count; i++)
             {

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

@@ -178,7 +178,7 @@ namespace UAS_MES.Make
 
         private void FillPrintLabel()
         {
-            DataTable _dt = (DataTable)dh.ExecuteSql("select pl_labelcode ||':'||pl_labelname pl_name,pl_labelname,pl_labelcode,pl_labelurl,pl_indate from productlabel where pl_prodcode='" + pa_prodcode.Text + "' and PL_LABELTYPE='栈板标' order by PL_ISDEFAULT DESC", "select");
+            DataTable _dt = (DataTable)dh.ExecuteSql("select pl_labelcode ||':'||pl_labelname pl_name,pl_labelname,pl_labelcode,pl_labelurl,pl_indate from productlabel where pl_prodcode='" + pa_prodcode.Text + "' and PL_LABELTYPE='大箱标' order by PL_ISDEFAULT DESC", "select");
             PrintLabel.DataSource = _dt;
             PrintLabel.DisplayMember = "pl_name";
             PrintLabel.ValueMember = "pl_labelcode";

+ 1 - 1
UAS-MES/FunctionCode/OQC/OQC_SamplingDataCollection.cs

@@ -265,7 +265,7 @@ namespace UAS_MES.OQC
                         if (oi_itemcode_insert.Count > 0)
                         {
                             string[] id = new string[oi_itemcode_insert.Count];
-                            id = dh.GetSEQ("OQCItemSamples_SEQ", id.Length);
+                            id = dh.GetSEQ("OQCItemSamples_SEQ", "OQCItemSamples", id.Length);
                             sql.Clear();
                             sql.Append("insert when (not exists (select ois_id from OQCItemSamples where ois_checkno='" + ob_checkno.Text + "' and ois_sncode='" + sncode.Text + "' and ois_itemcode =:ois_itemcode)) then ");
                             sql.Append("into OQCItemSamples (ois_id,ois_checkno,ois_makecode, ois_sncode,ois_projectcode,ois_itemcode,");