Ver código fonte

添加返工需求单Null处理

章政 8 anos atrás
pai
commit
c30399990c

+ 2 - 2
UAS-MES/FunctionCode/Make/Make_Repair.cs

@@ -276,7 +276,7 @@ namespace UAS_MES.Make
                     OperatResult.AppendText(">>回流工序不在回流工艺中\n", Color.Red);
                 else
                 {
-                    string ms_ifrework = dh.getFieldDataByCondition("makeserial", "ms_ifrework", "ms_sncode='" + ms_sncode.Text + "' and ms_makecode='" + macode + "'").ToString();
+                    string ms_ifrework = dh.getFieldDataByCondition("makeserial", "nvl(ms_ifrework,0)", "ms_sncode='" + ms_sncode.Text + "' and ms_makecode='" + macode + "'").ToString();
                     if (ms_ifrework == "0")
                     {
                         dh.UpdateByCondition("makeserial", "ms_paststep = ms_paststep ||'," + User.CurrentStepCode + "',ms_nextstepcode='" + cd_stepcode.Text + "',ms_craftcode='" + cr_code.Text + "',ms_stepcode='" + User.CurrentStepCode + "',ms_status=1", "ms_sncode='" + ms_sncode.Text + "'");
@@ -308,7 +308,7 @@ namespace UAS_MES.Make
                     string confirm = MessageBox.Show(this.ParentForm, "此操作不可撤销,是否确认报废", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Asterisk).ToString();
                     if (confirm == "Yes")
                     {
-                        string ms_ifrework = dh.getFieldDataByCondition("makeserial", "ms_ifrework", "ms_sncode='" + ms_sncode.Text + "' and ms_makecode='" + macode + "'").ToString();
+                        string ms_ifrework = dh.getFieldDataByCondition("makeserial", "nvl(ms_ifrework,0)", "ms_sncode='" + ms_sncode.Text + "' and ms_makecode='" + macode + "'").ToString();
                         if (ms_ifrework == "0")
                         {
                             dh.UpdateByCondition("makeserial", "ms_paststep = ms_paststep ||'," + User.CurrentStepCode + "',ms_status=4,ms_nextstepcode='',ms_stepcode='" + User.CurrentStepCode + "'", "ms_sncode='" + ms_sncode.Text + "' and ms_makecode='" + macode + "'");

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

@@ -1030,7 +1030,7 @@ namespace UAS_MES.PublicMethod
             //之前保存的不良就不再调用
             if (ms_status != "3")
             {
-                DataTable dt = dh.getFieldsDataByCondition("makeserial", new string[] { "ms_stepcode", "ms_ifrework" }, "ms_sncode='" + iSnCode + "'");
+                DataTable dt = dh.getFieldsDataByCondition("makeserial", new string[] { "ms_stepcode", "nvl(ms_ifrework,0)ms_ifrework" }, "ms_sncode='" + iSnCode + "'");
                 if (dt.Rows.Count > 0)
                 {
                     string ifrework = dt.Rows[0]["ms_ifrework"].ToString();