示例#1
0
        private void gv_Lg_plan_Query_FocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e)
        {
            try
            {
                //加载选中订单的物料信息
                string C_ROUT         = "";
                int    selectedHandle = this.gv_Lg_plan_Query.FocusedRowHandle;
                if (selectedHandle < 0)
                {
                    return;
                }
                string C_STL_GRD = this.gv_Lg_plan_Query.GetRowCellValue(selectedHandle, "C_STL_GRD").ToString();
                string C_ROUTE   = this.gv_Lg_plan_Query.GetRowCellValue(selectedHandle, "C_ROUTE").ToString();
                #region 获取物料工艺路线
                string wllj = "";
                string dfp  = "";
                if (C_ROUTE.Contains("KP"))
                {
                    dfp = "Y";
                    if (C_ROUTE.Contains("LF") && C_ROUTE.Contains("RH"))
                    {
                        wllj = "(BLR)";
                    }
                    if (C_ROUTE.Contains("LF") && !C_ROUTE.Contains("RH"))
                    {
                        wllj = "(BL)";
                    }
                    if (!C_ROUTE.Contains("LF") && C_ROUTE.Contains("RH"))
                    {
                        wllj = "(BR)";
                    }
                }
                else
                {
                    wllj = "";
                    dfp  = "N";
                }

                DataTable dtlzp = bll_wl.GetLZPMatrlList(C_STL_GRD, wllj, dfp).Tables[0];

                if (dtlzp.Rows.Count > 0)
                {
                    cbo_lzpwl.Properties.Items.Clear();
                    cbo_lzpwl.Text = "";
                    for (int i = 0; i < dtlzp.Rows.Count; i++)
                    {
                        cbo_lzpwl.Properties.Items.Add(dtlzp.Rows[i]["WLMC"].ToString(), dtlzp.Rows[i]["C_ID"].ToString(), -1);
                    }
                }

                if (C_ROUTE.Contains("KP"))
                {
                    DataTable dtrzp = bll_wl.GetRZPMatrlList(C_STL_GRD, wllj).Tables[0];
                    if (dtrzp.Rows.Count > 0)
                    {
                        cbo_rzpwl.Properties.Items.Clear();
                        cbo_rzpwl.Text = "";
                        for (int i = 0; i < dtrzp.Rows.Count; i++)
                        {
                            cbo_rzpwl.Properties.Items.Add(dtrzp.Rows[i]["WLMC"].ToString(), dtrzp.Rows[i]["C_ID"].ToString(), -1);
                        }
                    }
                }
                else
                {
                    cbo_rzpwl.Properties.Items.Clear();
                    cbo_rzpwl.Text = "";
                }


                #endregion
            }
            catch (Exception)
            {
            }
        }