|
|
@@ -6,6 +6,7 @@ using System.Drawing;
|
|
|
using System.Text;
|
|
|
using System.Windows.Forms;
|
|
|
using UAS_MES.CustomControl.DataGrid_View;
|
|
|
+using UAS_MES.CustomControl.TextBoxWithIcon;
|
|
|
using UAS_MES.DataOperate;
|
|
|
using UAS_MES.Entity;
|
|
|
using UAS_MES.PublicMethod;
|
|
|
@@ -47,6 +48,8 @@ namespace UAS_MES.Make
|
|
|
|
|
|
string dbtable2 = "(select distinct nvl(dsl_prodcode,msl_prodcode)prodcode from ReduceStepRecord left join devsmtlocation on dsl_linecode=rsd_linecode and dsl_makecode=rsd_macode left join makesmtlocation on msl_linecode=rsd_linecode and msl_makecode=rsd_macode where rsd_macode=':macode' and rsd_sncode=':sncode' and ((dsl_location=':msl_location' and dsl_validtime<sysdate and sysdate<dsl_invalidtime) ) or (msl_location=':msl_location' and msl_validtime<sysdate and sysdate<msl_invalidtime)) left join product on pr_code=prodcode";
|
|
|
|
|
|
+ DataTable Dbfind;
|
|
|
+
|
|
|
public Make_Repair()
|
|
|
{
|
|
|
InitializeComponent();
|
|
|
@@ -61,12 +64,14 @@ namespace UAS_MES.Make
|
|
|
cr_code.SelectField = "cr_name # 工艺名称,cr_code # 工艺编号,cr_prodcode # 物料编号";
|
|
|
cr_code.SetValueField = new string[] { "cr_code" };
|
|
|
cr_code.DBTitle = "回流工艺";
|
|
|
+ cr_code.DbChange += Cr_code_DbChange;
|
|
|
|
|
|
cd_stepcode.FormName = Name;
|
|
|
cd_stepcode.TableName = "craftdetail left join step on st_code=cd_stepcode left join craft on cd_crid=cr_id";
|
|
|
cd_stepcode.SetValueField = new string[] { "cd_stepcode" };
|
|
|
cd_stepcode.SelectField = "cd_stepname # 工序名称 ,cd_stepcode # 工序编号,cd_stepno # 执行顺序";
|
|
|
cd_stepcode.DBTitle = "回流工序";
|
|
|
+ cd_stepcode.DbChange += Cd_stepcode_DbChange;
|
|
|
|
|
|
prodcode.FormName = Name;
|
|
|
prodcode.TableName = dbtable1.Replace(":macode", macode).Replace(":sncode", GetSNCode.Text);
|
|
|
@@ -78,6 +83,19 @@ namespace UAS_MES.Make
|
|
|
GetSNCode.Focus();
|
|
|
}
|
|
|
|
|
|
+ private void Cd_stepcode_DbChange(object sender, EventArgs e)
|
|
|
+ {
|
|
|
+ Dbfind = cd_stepcode.ReturnData;
|
|
|
+ BaseUtil.SetFormValue(this.Controls, Dbfind);
|
|
|
+ }
|
|
|
+
|
|
|
+ private void Cr_code_DbChange(object sender, EventArgs e)
|
|
|
+ {
|
|
|
+ Dbfind = cr_code.ReturnData;
|
|
|
+ BaseUtil.SetFormValue(this.Controls, Dbfind);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
private void GetSNCode_KeyDown(object sender, KeyEventArgs e)
|
|
|
{
|
|
|
if (e.KeyCode == Keys.Enter)
|
|
|
@@ -122,7 +140,7 @@ namespace UAS_MES.Make
|
|
|
BadCodeTree.Nodes.Clear();
|
|
|
return;
|
|
|
}
|
|
|
- if (reworkstatus != "0"&& reworkstatus != "3")
|
|
|
+ if (reworkstatus != "0" && reworkstatus != "3")
|
|
|
{
|
|
|
OperatResult.AppendText(">>序列号:" + GetSNCode.Text + "不处于维修状态\n", Color.Red);
|
|
|
BaseUtil.CleanForm(this);
|
|
|
@@ -294,7 +312,7 @@ namespace UAS_MES.Make
|
|
|
}
|
|
|
if (ifrework != "0" && reworkstatus == "0")
|
|
|
{
|
|
|
- if (dh.getRowCount("Makebad", "mb_sncode='"+ms_sncode.Text+"' and mb_status=0") == 0)
|
|
|
+ if (dh.getRowCount("Makebad", "mb_sncode='" + ms_sncode.Text + "' and mb_status=0") == 0)
|
|
|
{
|
|
|
OperatResult.AppendText(">>维修必须维护不良代码\n", Color.Red);
|
|
|
return;
|
|
|
@@ -363,7 +381,7 @@ namespace UAS_MES.Make
|
|
|
string confirm = MessageBox.Show(this.ParentForm, "此操作不可撤销,是否确认报废", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Asterisk).ToString();
|
|
|
if (confirm == "Yes")
|
|
|
{
|
|
|
- DataTable dt = dh.getFieldsDataByCondition("makeserial", new string[] { "nvl(ms_ifrework,0)ms_ifrework", "ms_reworkcode"}, "ms_sncode='" + ms_sncode.Text + "' and ms_makecode='" + macode + "'");
|
|
|
+ DataTable dt = dh.getFieldsDataByCondition("makeserial", new string[] { "nvl(ms_ifrework,0)ms_ifrework", "ms_reworkcode" }, "ms_sncode='" + ms_sncode.Text + "' and ms_makecode='" + macode + "'");
|
|
|
if (dt.Rows.Count > 0)
|
|
|
{
|
|
|
string ms_ifrework = dt.Rows[0]["ms_ifrework"].ToString();
|