|
|
@@ -641,9 +641,9 @@ namespace UAS_MES.Make
|
|
|
dt = (DataTable)dh.ExecuteSql("select mbl_id,mbl_loc from makebadrsloc where mbl_mbrid=" + mbr_id, "select");
|
|
|
BaseUtil.FillDgvWithDataTable(mbl_locdgv, dt);
|
|
|
sql.Clear();
|
|
|
- sql.Append("select bd_soncode from bom inner join bomdetail on bo_id = bd_bomid ");
|
|
|
- sql.Append("where bo_mothercode='" + ms_prodcode.Text + "' and bd_location<>' 'and ");
|
|
|
- sql.Append(" instr(','||bd_location||',','," + mbl_loc.Text.ToUpper() + ",')>0 order by bd_detno desc ");
|
|
|
+ sql.Append("with temp1 as (select bd_soncode,bd_location from bomdetail,bom where bo_id=bd_bomid ");
|
|
|
+ sql.Append(" start with bo_mothercode='" + ms_prodcode.Text + "' connect by bo_mothercode= prior bd_soncode) ");
|
|
|
+ sql.Append("select bd_soncode from temp1 where instr(','||bd_location||',','," + mbl_loc.Text.ToUpper() + ",')>0");
|
|
|
dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
|
|
|
if (dt.Rows.Count > 0)
|
|
|
{
|