private Bll_TB_MATRL_MAIN bll_wl = new Bll_TB_MATRL_MAIN();//物料信息表 /// <summary> /// 选中炉次计划 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void gridView7_FocusedRowObjectChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowObjectChangedEventArgs e) { int index = gridView7.FocusedRowHandle; if (index < 0) { return; } string C_STL_GRD = gridView7.GetRowCellValue(index, "C_STL_GRD").ToString(); string C_STD_CODE = gridView7.GetRowCellValue(index, "C_STD_CODE").ToString(); string C_ROUTE = gridView7.GetRowCellValue(index, "C_ROUTE").ToString(); int N_GROUP = Convert.ToInt32(gridView7.GetRowCellValue(index, "N_GROUP").ToString()); #region 加载可修改的物料信息 string wllj = ""; 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)"; } DataTable dtgpwl = null;//bll_wl.GetGPWL( C_STL_GRD, C_STD_CODE, "", wllj); if (C_ROUTE.Contains("KP")) { dtgpwl = bll_wl.GetGPWL(C_STL_GRD, "", null, "6", wllj, "大方坯连铸坯").Tables[0]; } else { dtgpwl = bll_wl.GetGPWL(C_STL_GRD, "", null, "6", wllj, "小方坯连铸坯").Tables[0]; } this.gridControl5.DataSource = dtgpwl; this.gridView5.OptionsView.ColumnAutoWidth = false; SetGridViewRowNum.SetRowNum(gridView5); this.gridView5.BestFitColumns(); #endregion #region 加载同组的可以变更的炉次计划 List <Mod_TSP_PLAN_SMS> lst = bll_plan_sms.GetListByJcGroup(N_GROUP); List <Mod_TSP_PLAN_SMS> lstkg = new List <Mod_TSP_PLAN_SMS>(); var changelst = lst.Where(a => a.C_STL_GRD != C_STL_GRD || a.C_STD_CODE != C_STD_CODE).GroupBy(a => new { a.C_STD_CODE, a.C_STL_GRD, a.C_MATRL_NO }).ToList(); if (changelst.Count > 0) { for (int i = 0; i < changelst.Count; i++) { // Mod_TSP_PLAN_SMS mod = bll_plan_sms.GetModelList(); } } #endregion }