|
|
@@ -50,6 +50,7 @@ namespace UAS_MES.Make
|
|
|
{
|
|
|
Dbfind = ma_code.ReturnData;
|
|
|
BaseUtil.SetFormValue(this.Controls, Dbfind);
|
|
|
+ FillDataGridView();
|
|
|
}
|
|
|
|
|
|
private void 岗位备料_SizeChanged(object sender, EventArgs e)
|
|
|
@@ -95,8 +96,8 @@ namespace UAS_MES.Make
|
|
|
sql.Clear();
|
|
|
sql.Append("insert into makesourcestock (mss_id,mss_makecode,mss_linecode ,mss_craftcode,");
|
|
|
sql.Append("mss_stepcode,mss_barcode,mss_fprodcode,mss_indate,mss_inman,mss_qty,");
|
|
|
- sql.Append("mss_remain ,mss_baseqty ,mss_prodcode,mss_maid) values(makesourcestock_seq.nextval,'" + ma_code.Text + "','" + User.UserLineCode + "',");
|
|
|
- sql.Append("'','" + sc_stepcode.Text + "','" + pr_batchnum.Text + "','" + mm_prodcode + "',");
|
|
|
+ sql.Append("mss_remain,mss_baseqty,mss_prodcode,mss_maid) values(makesourcestock_seq.nextval,'" + ma_code.Text + "','" + User.UserLineCode + "',");
|
|
|
+ sql.Append("'"+ma_craftcode.Text+"','" + sc_stepcode.Text + "','" + pr_batchnum.Text + "','" + mm_prodcode + "',");
|
|
|
sql.Append("sysdate,'" + User.UserCode + "','" + bar_remain + "','" + bar_remain + "','" + mm_oneuseqty + "','" + bar_prodcode + "','" + ma_id + "')");
|
|
|
dh.ExecuteSql(sql.GetString(), "insert");
|
|
|
dh.UpdateByCondition("barcode", "bar_place='" + ma_code.Text + "'", "bar_code='" + pr_batchnum.Text + "'");
|
|
|
@@ -165,6 +166,7 @@ namespace UAS_MES.Make
|
|
|
string id = BatchProductDGV.Rows[e.RowIndex].Cells["mss_id"].Value.ToString();
|
|
|
if (id != "0")
|
|
|
{
|
|
|
+ BatchProductDGV.Rows.RemoveAt(e.RowIndex);
|
|
|
dh.ExecuteSql("delete from makesourcestock where mss_id='" + id + "'", "delete");
|
|
|
}
|
|
|
}
|
|
|
@@ -197,5 +199,30 @@ namespace UAS_MES.Make
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ private void BatchProductDGV_CellEndEdit(object sender, DataGridViewCellEventArgs e)
|
|
|
+ {
|
|
|
+ string id = BatchProductDGV.Rows[e.RowIndex].Cells["mss_id"].Value.ToString();
|
|
|
+ string qty ="0";
|
|
|
+ if (id != "0")
|
|
|
+ {
|
|
|
+ try
|
|
|
+ {
|
|
|
+ if (int.Parse(BatchProductDGV.Rows[e.RowIndex].Cells["mss_qty"].Value.ToString()) > 0)
|
|
|
+ {
|
|
|
+ qty = BatchProductDGV.Rows[e.RowIndex].Cells["mss_qty"].Value.ToString();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ OperateResult.AppendText(">>数量必须大于0\n", Color.Red);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ catch (Exception)
|
|
|
+ {
|
|
|
+ }
|
|
|
+ dh.UpdateByCondition("makesourcestock", "mss_qty='"+ qty + "'", "mss_id='" + id + "'");
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|