Ejemplo n.º 1
0
        /* =============================================
         *  공장 콤보박스를 선택했을경우 발생하는 이벤트
         * =============================================== */
        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);
            }
        }
Ejemplo n.º 2
0
        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);
            }
        }
Ejemplo n.º 3
0
        private void ComboBinding()
        {
            // 반제품 라인일 경우 생산 1팀
            // 완제품 라인일 경우 생산 2팀

            try
            {
                UtilClass.ComboBinding(cboWorker, new Service().GetWorker(FactoryDivision), "작업자 선택");
            }
            catch (Exception ex)
            {
                Program.Log.WriteError(ex.Message, ex);
            }
        }
Ejemplo n.º 4
0
        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);
            }
        }
Ejemplo n.º 5
0
        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
        }
Ejemplo n.º 6
0
        private void SettingControl()
        {
            this.Icon = Properties.Resources.IMG_POPMain;

            //폼이 뜰때
            this.WindowState = FormWindowState.Maximized;

            //버튼 활성화 관련
            BtnDisable(btnDefective);
            BtnDisable(btnWorker);
            BtnDisable(btnProduceStart);

            #region 이미지관련



            picLeft.Image   = Resources.Img_LeftButton;
            picRight.Image  = Resources.Img_RightButton;
            picLogout.Image = Resources.Img_Logout;
            picExit.Image   = Resources.Img_Exit;

            picLeft.SizeMode = picRight.SizeMode = picLogout.SizeMode = picExit.SizeMode
                                                                            = PictureBoxSizeMode.StretchImage;

            #endregion



            // =============================================
            //               스플릿 컨테이너 디자인
            // =============================================

            splitContainer1.IsSplitterFixed = splitContainer2.IsSplitterFixed = splitContainer3.IsSplitterFixed
                                                                                    = splitContainer4.IsSplitterFixed = splitContainer5.IsSplitterFixed =
                                                                                          splitContainer6.IsSplitterFixed = splitContainer7.IsSplitterFixed = splitContainer8.IsSplitterFixed
                                                                                                                                                                  = splitContainer9.IsSplitterFixed = splitContainer10.IsSplitterFixed =
                                                                                                                                                                        splitContainer11.IsSplitterFixed = true;

            //panelHaderRight.BorderStyle = panelHaderLeft.BorderStyle = panel1.BorderStyle = BorderStyle.None;

            #region 그리드뷰 디자인
            // =============================================
            //                그리드뷰 디자인
            // =============================================


            // 작업 그리드뷰
            UtilClass.SettingDgv(dgvWork);

            UtilClass.AddNewColum(dgvWork, "작업지시번호", "Work_ID", true, 160);
            UtilClass.AddNewColum(dgvWork, "작업 시작날짜", "Work_StartDate", true, 150);
            UtilClass.AddNewColum(dgvWork, "작업 종료날짜", "Work_EndDate", true, 150);
            UtilClass.AddNewColum(dgvWork, "출하지시번호", "Shipment_ID", true, 170);
            UtilClass.AddNewColum(dgvWork, "작업 현황", "Work_State", true);
            UtilClass.AddNewColum(dgvWork, "작업지시자 사번", "Employees_ID", false);
            UtilClass.AddNewColum(dgvWork, "작업지시자 이름", "Employees_Name", true, 250);
            UtilClass.AddNewColum(dgvWork, "출하 요청일", "Shipment_RequiredDate", true, 150);

            // 생산 그리드뷰
            UtilClass.SettingDgv(dgvProduce);

            UtilClass.AddNewColum(dgvProduce, "생산지시번호", "Produce_ID", true, 160);
            UtilClass.AddNewColum(dgvProduce, "상품코드", "Product_ID", true, 100);
            UtilClass.AddNewColum(dgvProduce, "생산시작날짜", "Produce_StartDate", true, 135);
            UtilClass.AddNewColum(dgvProduce, "생산완료날짜", "Produce_DoneDate", true, 135);
            UtilClass.AddNewColum(dgvProduce, "상품명", "Product_Name", true, 200);
            UtilClass.AddNewColum(dgvProduce, "요청", "Produce_QtyRequested", true, 70, DataGridViewContentAlignment.MiddleRight);
            UtilClass.AddNewColum(dgvProduce, "투입", "Produce_QtyReleased", true, 70, DataGridViewContentAlignment.MiddleRight);
            UtilClass.AddNewColum(dgvProduce, "불량", "Performance_QtyDefectiveItem", true, 70, DataGridViewContentAlignment.MiddleRight);
            UtilClass.AddNewColum(dgvProduce, "생산 상태", "Produce_State", true);


            // 실적 그리드뷰
            UtilClass.SettingDgv(dgvPerformance);

            UtilClass.AddNewColum(dgvPerformance, "생산실적번호", "Performance_ID", true, 160);
            UtilClass.AddNewColum(dgvPerformance, "실적날짜", "Performance_Date", true, 130);
            UtilClass.AddNewColum(dgvPerformance, "생산지시번호", "Produce_ID", false, 150);
            UtilClass.AddNewColum(dgvPerformance, "양품", "Performance_QtySuccessItem", true, 70, DataGridViewContentAlignment.MiddleRight);
            UtilClass.AddNewColum(dgvPerformance, "불량", "Performance_QtyDefectiveItem", true, 70, DataGridViewContentAlignment.MiddleRight);
            UtilClass.AddNewColum(dgvPerformance, "생산 시작", "Performance_StartDate", true, 110);
            UtilClass.AddNewColum(dgvPerformance, "생산 종료", "Performance_EndDate", true, 110);
            UtilClass.AddNewColum(dgvPerformance, "사원번호", "Employees_ID", false);
            UtilClass.AddNewColum(dgvPerformance, "작업자 명", "Employees_Name", false);
            UtilClass.AddNewColum(dgvPerformance, "불량률", "Performance_DefectiveRate", true, 100, DataGridViewContentAlignment.MiddleRight);
            UtilClass.AddNewColum(dgvPerformance, "가동시간", "Performance_ElapsedTime", true, 100, DataGridViewContentAlignment.MiddleRight);


            //그리드뷰 포멧 관련
            dgvWork.Columns[1].DefaultCellStyle.Format = Resources.FormateDate;
            dgvWork.Columns[2].DefaultCellStyle.Format = Resources.FormateDate;
            dgvWork.Columns[7].DefaultCellStyle.Format = Resources.FormateDate;

            dgvProduce.Columns[2].DefaultCellStyle.Format = Resources.FormateDate;
            dgvProduce.Columns[3].DefaultCellStyle.Format = Resources.FormateDate;

            dgvPerformance.Columns[1].DefaultCellStyle.Format = Resources.FormateDate;
            dgvPerformance.Columns[5].DefaultCellStyle.Format = "HH:mm:ss";
            dgvPerformance.Columns[6].DefaultCellStyle.Format = "HH:mm:ss";

            dgvPerformance.Columns[9].DefaultCellStyle.Format = "0.0#\\%";

            #endregion 그리드뷰 디자인
        }