Exemplo n.º 1
0
        public MyUserControl02(string _eqpDesc, string _eqpId, string _workCenter, string _state)
        {
            InitializeComponent();
            try
            {
                this.gridControl1.DoubleClick += GridControl1_DoubleClick;
                //this.gridControl1.Click += GridControl1_Click;
                //this.gridView1.RowCellStyle += GridView1_RowCellStyle;
                this.labelControl1.Text = _eqpDesc;
                this.labelControl2.Text = _eqpId;
                eqpDesc    = _eqpDesc;
                eqpId      = _eqpId;
                workCenter = _workCenter;
                backColor  = _state;
                MyDevExpressFunctions.InitGridControl(this.gridView1, 1);

                int iColumnCount = oHeaderText.Length;

                DevExpress.XtraGrid.Columns.GridColumn[] cCols = new DevExpress.XtraGrid.Columns.GridColumn[iColumnCount];
                for (int i = 0; i < iColumnCount; i++)
                {
                    cCols[i] = new DevExpress.XtraGrid.Columns.GridColumn()
                    {
                        FieldName = Enum.GetNames(typeof(DbColumnIndex))[i].ToString(), Name = Enum.GetNames(typeof(DbColumnIndex))[i], Caption = oHeaderText[i], Visible = true, Width = HeaderWidth[i]
                    };
                    if (oHeaderText[i] == "생산순서")
                    {
                        cCols[i].Visible = false;
                    }

                    this.gridView1.Columns.Add(cCols[i]);
                    MyDevExpressFunctions.SetHeaderAlignmentGridView(this.gridView1, gridView1.Columns.Count - 1);
                    MyDevExpressFunctions.SetCellAlignmentGridView(this.gridView1, gridView1.Columns.Count - 1);
                }
                //this.gridControl1.DataSource = new MyDatabaseConnect01().connection7(_eqpId, _workCenter);
                this.gridControl1.DataSource = DashboardDAO.SelectOrderOfEquipmentList(new DashboardDTO()
                {
                    EQP_ID = _eqpId, WORK_CENTER = _workCenter
                });
                this.labelControl5.Text = "오더수량 : " + gridView1.RowCount.ToString();

                if (_state == "Run")
                {
                    this.panel1.BackColor = Color.DarkGreen; this.panel2.BackColor = Color.Green;
                }
                else if (_state == "Idle" || _state == "Ready")
                {
                    this.panel1.BackColor = Color.DarkGray; this.panel2.BackColor = Color.Gray;
                }
                else if (_state == "Down")
                {
                    this.panel1.BackColor = Color.DarkRed; this.panel2.BackColor = Color.Red;
                }
                else if (_state == "Setup")
                {
                    this.panel1.BackColor = Color.DarkBlue; this.panel2.BackColor = Color.Blue;;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Exemplo n.º 2
0
        public MyTileBar05()
        {
            InitializeComponent();

            try
            {
                MyDevExpressFunctions.InitSearchLookUpEdit(this.slueSelect, "DEPT_NAME", "DEPT_CODE", true);
                MyDevExpressFunctions.SetVisibleColumnSearchLookUpEdit(this.slueSelect, new string[] { "DEPT_NAME", "DEPT_CODE" }, new string[] { "부서명", "부서코드" });
                this.slueSelect.Properties.DataSource = DashboardDAO.SelectDepartmentList(new DashboardDTO());


                //this.slueSelect.EditValueChanged += SlueSelect_EditValueChanged;
                MyDevExpressFunctions.MakeWindowsUIButtonPanel(this.windowsUIButtonPanel1, new string[] { "검색", "초기화", "구분자", "미리보기", "차트", "작업이동", "구분자", "저장", "프린트" });
                WindowsUIButton btnSearch   = this.windowsUIButtonPanel1.Buttons["검색"] as WindowsUIButton;
                WindowsUIButton btnReset    = this.windowsUIButtonPanel1.Buttons["초기화"] as WindowsUIButton;
                WindowsUIButton btnChart    = this.windowsUIButtonPanel1.Buttons["차트"] as WindowsUIButton;
                WindowsUIButton btnPreview  = this.windowsUIButtonPanel1.Buttons["미리보기"] as WindowsUIButton;
                WindowsUIButton btnMoveWork = this.windowsUIButtonPanel1.Buttons["작업이동"] as WindowsUIButton;

                //PeekFormButton btnPanelMoveWork = this.flyoutPanel1.OptionsButtonPanel.Buttons["작업이동"] as PeekFormButton;
                //PeekFormButton btnPanelAccept = this.flyoutPanel1.OptionsButtonPanel.Buttons["적용"] as PeekFormButton;
                //PeekFormButton btnPanelDecline = this.flyoutPanel1.OptionsButtonPanel.Buttons["취소"] as PeekFormButton;
                this.flyoutPanel1.ButtonClick += FlyoutPanel1_ButtonClick;
                //btn.clik


                btnSearch.Click  += BtnSearch_Click;
                btnReset.Click   += BtnReset_Click;
                btnChart.Click   += BtnChart_Click;
                btnPreview.Click += BtnPreview_Click;
                //btnMoveWork.Click += BtnMoveWork_Click;
                //btnPanelMoveWork.Click += BtnMoveWork_Click;
                this.gridControl1.Click += GridControl1_Click;

                // https://enginhak.tistory.com/entry/XtraGridView-Column-Header-Checkbox-Add
                this.gridView2.CellValueChanging += GridView2_CellValueChanging;
                //this.gridView2.MouseUp += GridView2_MouseUp;
                this.panelComparence.Visible = false;
                //flowLayoutPanel1.MouseDown += FlowLayoutPanel1_MouseDown;
                //MyDevExpressFunctions.InitGridControl(this.gridView1, 0);
                //int iColumnCount = oHeaderText.Length;
                //DevExpress.XtraGrid.Columns.GridColumn[] cCols = new DevExpress.XtraGrid.Columns.GridColumn[iColumnCount];
                //for (int i = 0; i < iColumnCount; i++)
                //{
                //    cCols[i] = new DevExpress.XtraGrid.Columns.GridColumn() { FieldName = Enum.GetNames(typeof(DbColumnIndex))[i].ToString(), Name = Enum.GetNames(typeof(DbColumnIndex))[i], Caption = oHeaderText[i], Visible = true, Width = HeaderWidth[i] };
                //    this.gridView1.Columns.Add(cCols[i]);
                //    MyDevExpressFunctions.SetHeaderAlignmentGridView(this.gridView1, gridView1.Columns.Count - 1);
                //    MyDevExpressFunctions.SetCellAlignmentGridView(this.gridView1, gridView1.Columns.Count - 1);
                //}
                MyDevExpressFunctions.InitGridControl(this.gridView1, 0);

                int iColumnCount = oHeaderText2.Length;



                DevExpress.XtraGrid.Columns.GridColumn[] cCols = new DevExpress.XtraGrid.Columns.GridColumn[iColumnCount];
                for (int i = 0; i < iColumnCount; i++)
                {
                    cCols[i] = new DevExpress.XtraGrid.Columns.GridColumn()
                    {
                        FieldName = Enum.GetNames(typeof(DbColumnIndex2))[i].ToString(), Name = Enum.GetNames(typeof(DbColumnIndex2))[i], Caption = oHeaderText2[i], Visible = true, Width = HeaderWidth2[i]
                    };
                    if (oHeaderText2[i] == "생산순서")
                    {
                        cCols[i].Visible = false;
                    }
                    this.gridView1.Columns.Add(cCols[i]);
                    MyDevExpressFunctions.SetHeaderAlignmentGridView(this.gridView1, gridView1.Columns.Count - 1);
                    MyDevExpressFunctions.SetCellAlignmentGridView(this.gridView1, gridView1.Columns.Count - 1);
                }


                MyDevExpressFunctions.InitGridControl(this.gridView2, 0);
                this.gridView2.OptionsBehavior.Editable = true;
                iColumnCount = oHeaderText3.Length;

                cCols = new DevExpress.XtraGrid.Columns.GridColumn[iColumnCount];
                for (int i = 0; i < iColumnCount; i++)
                {
                    RepositoryItemCheckEdit repositoryItemCheckEdit = new RepositoryItemCheckEdit();
                    repositoryItemCheckEdit.ValueChecked    = "True";
                    repositoryItemCheckEdit.ValueUnchecked  = "False";
                    repositoryItemCheckEdit.CheckedChanged += RepositoryItemCheckEdit_CheckedChanged;
                    cCols[i] = new DevExpress.XtraGrid.Columns.GridColumn()
                    {
                        FieldName = Enum.GetNames(typeof(DbColumnIndex3))[i].ToString(), Name = Enum.GetNames(typeof(DbColumnIndex3))[i], Caption = oHeaderText3[i], Visible = true, Width = HeaderWidth3[i]
                    };
                    if (oHeaderText3[i] == "선택")
                    {
                        cCols[i].ColumnEdit = repositoryItemCheckEdit;
                    }
                    if (oHeaderText3[i] == "선택2")
                    {
                        cCols[i].ColumnEdit = repositoryItemCheckEdit;
                    }

                    this.gridView2.Columns.Add(cCols[i]);

                    MyDevExpressFunctions.SetHeaderAlignmentGridView(this.gridView2, gridView2.Columns.Count - 1);
                    MyDevExpressFunctions.SetCellAlignmentGridView(this.gridView2, gridView2.Columns.Count - 1);
                }
                this.gridView2.OptionsSelection.ShowCheckBoxSelectorInColumnHeader         = DevExpress.Utils.DefaultBoolean.True; // 체크박스 전체 선택가능 헤더만들지 여부
                this.gridView2.OptionsSelection.ResetSelectionClickOutsideCheckboxSelector = true;                                 // 셀밖에 값을 눌러도 체크박스 온오프만 적용됨
                //gridView2.OptionsSelection.MultiSelect = true;
                //gridView2.OptionsSelection.MultiSelectMode = DevExpress.XtraGrid.Views.Grid.GridMultiSelectMode.CheckBoxRowSelect;
                gridView2.VisibleColumns[2].OptionsColumn.ShowCaption = false;
                //this.gridView2.CustomDrawColumnHeader += GridView2_CustomDrawColumnHeader;



                MyDevExpressFunctions.InitGridControl(this.gridView3, 0);
                this.gridView3.OptionsBehavior.Editable = true;
                iColumnCount = oHeaderText3.Length;

                cCols = new DevExpress.XtraGrid.Columns.GridColumn[iColumnCount];
                for (int i = 0; i < iColumnCount; i++)
                {
                    cCols[i] = new DevExpress.XtraGrid.Columns.GridColumn()
                    {
                        FieldName = Enum.GetNames(typeof(DbColumnIndex3))[i].ToString(), Name = Enum.GetNames(typeof(DbColumnIndex3))[i], Caption = oHeaderText3[i], Visible = true, Width = HeaderWidth3[i]
                    };
                    if (oHeaderText3[i] == "선택")
                    {
                        cCols[i].Visible = false;
                    }
                    if (oHeaderText3[i] == "선택2")
                    {
                        cCols[i].Visible = false;
                    }
                    this.gridView3.Columns.Add(cCols[i]);

                    MyDevExpressFunctions.SetHeaderAlignmentGridView(this.gridView3, gridView3.Columns.Count - 1);
                    MyDevExpressFunctions.SetCellAlignmentGridView(this.gridView3, gridView3.Columns.Count - 1);
                }
                this.slueSelect.Text = "50000198";
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }