/* ============================================= * 공장 콤보박스를 선택했을경우 발생하는 이벤트 * =============================================== */ private void cboFactory_SelectedIndexChanged(object sender, EventArgs e) { try { if (cboFactory.SelectedIndex > 0) { // 공장리스트에서 공장타입번호가 같은것만 찾아서 공정 리스트를 호출 바인딩함 string facDivision = factory.Find(f => f.ID == cboFactory.SelectedValue.ToString()).CodeType; UtilClass.ComboBinding(cboWorker, new Service().GetWorker(Convert.ToInt32(facDivision)), "작업자 선택"); UtilClass.ComboBinding(cboLine, new Service().GetLineList(Convert.ToInt32(cboFactory.SelectedValue)), "공정 선택"); if (workerInfo != null) { cboLine.SelectedValue = workerInfo.LineID.ToString(); //cboLine.SelectedIndex = ((List<ComboItemVO>)cboLine.DataSource).FindIndex(k => k.ID == workerInfo.LineID.ToString()); workerInfo = null; } } else { List <ComboItemVO> list = null; UtilClass.ComboBinding(cboLine, list, string.Format(Properties.Resources.MsgChoice2, "공장")); UtilClass.ComboBinding(cboWorker, list, string.Format(Properties.Resources.MsgChoice2, "공장")); } } catch (Exception ex) { Program.Log.WriteError(ex.Message, ex); } }
private void DowntimeRegister_Load(object sender, EventArgs e) { try { lblFairName.Text = LineName; lblFairName.Tag = LineID; cboDowntime.DropDownStyle = ComboBoxStyle.DropDownList; Service service = new Service(); List <ComboItemVO> list = service.GetDowntimeCode(); UtilClass.ComboBinding(cboDowntime, list, "비가동유형 선택"); // 바인딩한 값이 없는 경우 if (list == null) { if (CustomMessageBox.ShowDialog(Properties.Resources.MsgDowntimeGetResultFailHeader , Properties.Resources.MsgDowntimeGetResultFailContent, MessageBoxIcon.Information, MessageBoxButtons.OKCancel) == DialogResult.OK) { list = service.GetDowntimeCode(); UtilClass.ComboBinding(cboDowntime, list, "비가동유형 선택"); } } } catch (Exception ex) { Program.Log.WriteError(ex.Message, ex); } }
private void ComboBinding() { // 반제품 라인일 경우 생산 1팀 // 완제품 라인일 경우 생산 2팀 try { UtilClass.ComboBinding(cboWorker, new Service().GetWorker(FactoryDivision), "작업자 선택"); } catch (Exception ex) { Program.Log.WriteError(ex.Message, ex); } }
private void InitData() { try { // 공장의 정보 목록을 가져오는 코드 Service service = new Service(); factory = service.GetFactoryList(); List <ComboItemVO> list = null; UtilClass.ComboBinding(cboFactory, factory, "공장 선택"); UtilClass.ComboBinding(cboLine, list, string.Format(Properties.Resources.MsgChoice2, "공장")); UtilClass.ComboBinding(cboWorker, list, string.Format(Properties.Resources.MsgChoice2, "공정")); } catch (Exception ex) { Program.Log.WriteError(ex.Message, ex); } }
private void InitData() { lblPerformance.Text = Performance_ID; #region 콤보박스 바인딩 - 불량유형, 불량처리 유형 Service service = new Service(); try { List <ComboItemVO> list = service.GetDefectiveCode(); UtilClass.ComboBinding(cboDefectiveName, list.FindAll(c => c.CodeType.Contains("Defec")), "불량유형 선택"); UtilClass.ComboBinding(cboHandle, list.FindAll(c => c.CodeType.Contains("Handle")), "불량처리유형 선택"); } catch (Exception ex) { Program.Log.WriteError(ex.Message, ex); } #endregion #region 콤보박스 바인딩 - 생산실적에 있는 불량 유형 try { List <string> listDefective = service.GetDefective(Performance_ID); UtilClass.ComboBinding(cboDefItem, listDefective, "코드 선택"); } catch (Exception ex) { Program.Log.WriteError(ex.Message, ex); } #endregion }