//private void BtnMoveWork_Click(object sender, EventArgs e) //{ // //MyUserControl02 test = this.ActiveControl as MyUserControl02; // //GridControl testControl = test.ActiveControl as GridControl; // //GridView testView = testControl.MainView as GridView; // //ProcessComparenceDialog dialog = new ProcessComparenceDialog(testView.GetRowCellValue(testView.FocusedRowHandle, "PART_NUMBER").ToString()); // //dialog.Width = 1300; // //dialog.Height = 350; // //dialog.ShowDialog(); //} //private void FlowLayoutPanel1_MouseDown(object sender, MouseEventArgs e) //{ // flyoutPanel1.OwnerControl = this.flowLayoutPanel1; // flyoutPanel1.Size = new Size(200, 400); // //flyoutPanel.ShowBeakForm(); // if (flyoutPanel1.FlyoutPanelState.IsActive) flyoutPanel1.HidePopup(); // else flyoutPanel1.ShowPopup(); //} private void UserControl_Click(object sender, EventArgs e) { try { MyUserControl02 selectedUserControl = sender as MyUserControl02; //this.gridControl1.DataSource = new MyDatabaseConnect01().connection7(selectedUserControl.eqpId, selectedUserControl.workCenter); this.gridControl1.DataSource = DashboardDAO.SelectOrderOfEquipmentList(new DashboardDTO() { EQP_ID = selectedUserControl.eqpId, WORK_CENTER = selectedUserControl.workCenter }); this.labelControl2.Text = selectedUserControl.eqpDesc; flyoutPanel1.OwnerControl = this; flyoutPanel1.Size = new Size(600, 350); //flyoutPanel.ShowBeakForm(); if (flyoutPanel1.FlyoutPanelState.IsActive) { flyoutPanel1.HidePopup(); this.panelComparence.Visible = false; this.flyoutPanel1.OptionsButtonPanel.ShowButtonPanel = false; this.gridControl3.Visible = false; this.gridControl3.DataSource = null; } else { flyoutPanel1.ShowPopup(); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void Button1_Click(object sender, EventArgs e) { //1 DashboardDTO tempDTO = new DashboardDTO(); if (!String.IsNullOrWhiteSpace(textBox4.Text)) { tempDTO.NAME = textBox4.Text; } IList <DashboardDTO> resultList = DashboardDAO.SelectList(tempDTO); // 2 //IList<DashboardDTO> resultList2 = DashboardDAO.SelectList(new DashboardDTO() { NAME = textBox4.Text }); //MessageBox.Show(resultList[0].NAME); //textBox1.Text = resultList[0].NAME; //textBox2.Text = resultList[0].AGE; //textBox3.Text = resultList[0].DEPT; dataGridView1.DataSource = resultList; }
private void Button2_Click(object sender, EventArgs e) { DashboardDTO tempDTO = new DashboardDTO(); tempDTO.NAME = textBox1.Text; tempDTO.AGE = textBox2.Text; tempDTO.DEPT = textBox3.Text; DashboardDTO resultDTO = DashboardDAO.InsertCompany(tempDTO); MessageBox.Show(resultDTO.isSuccess.ToString()); }
public List <Dashboard> getDashboard(int taskStatus) { try { User requester = UserDAO.instanceByAlias(HttpContext.Current.Request.LogonUserIdentity.Name); Log log = new Log("getDashboard", "GET", requester, DateTime.Now, taskStatus.ToString(), "", ""); LogDAO.insert(log); return(DashboardDAO.select(requester, taskStatus)); } catch (Exception ex) { throw new Exception(string.Format("Ops! An error has ocurred: {0}", ex.Message)); } }
private void GridControl1_Click(object sender, EventArgs e) { try { this.panelComparence.Visible = true; this.gridControl3.Visible = true; GridView testView = gridView1 as GridView; //this.gridControl2.DataSource = new MyDatabaseConnect01().connectionProcessComaparence(testView.GetRowCellValue(testView.FocusedRowHandle, "PART_NUMBER").ToString()); this.gridControl2.DataSource = DashboardDAO.SelectEquipmentComparenceList(new DashboardDTO() { PART_NUMBER = testView.GetRowCellValue(testView.FocusedRowHandle, "PART_NUMBER").ToString() });; //flyoutPanel1.Size = new Size(1200, 350); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void BtnSearch_Click(object sender, EventArgs e) { try { BtnReset_Click(null, null); //List<DataThreeVo> resultList = new MyDatabaseConnect01().connection3(this.slueSelect.EditValue.ToString()); IList <DashboardDTO> resultList = DashboardDAO.SelectEquipmentList(new DashboardDTO() { DEPT_CODE = this.slueSelect.EditValue.ToString() }); //flowLayoutPanel.Size = new Size(3000, 2000); //flowLayoutPanel.WrapContents = false; // https://www.dotnetperls.com/flowlayoutpanel // https://www.c-sharpcorner.com/forums/getting-control-from-flowlayoutpanel // https://stackoverflow.com/questions/40279918/flowlayoutpanel-scrollbar-doesnt-disapear-properly-sometimes flowLayoutPanel1.HorizontalScroll.Maximum = 0; flowLayoutPanel1.AutoScroll = false; flowLayoutPanel1.VerticalScroll.Visible = false; flowLayoutPanel1.AutoScroll = true; MyUserControl02 userControl; int _rowIndex = 0; for (int x = 0; x < resultList.Count; x++) { userControl = new MyUserControl02(resultList[x].EQP_DESC.ToString(), resultList[x].EQP_ID.ToString(), resultList[x].WORK_CENTER.ToString(), resultList[x].STATE.ToString()); userControl.Click += UserControl_Click; flowLayoutPanel1.Controls.Add(userControl); } //this.groupControl2.Focus(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
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); } }
public MyDialog01(string _eqpId, string _processSeq, string _prodOrderNumber) { InitializeComponent(); try { // 시간 이벤트 timer1.Tick += new EventHandler(timer1_Tick); timer1.Interval = 1000; timer1.Enabled = true; //List<DashboardDTO> resultList = new MyDatabaseConnect01().connection9(_prodOrderNumber, ""); IList <DashboardDTO> resultList = DashboardDAO.SelectProcessOfEquipmentList(new DashboardDTO() { PROD_ORDER_NUMBER = _prodOrderNumber }); if (resultList.Count > 1 && resultList.Count <= 5) { tableLayoutPanel1.RowStyles[1].SizeType = SizeType.Absolute; tableLayoutPanel1.RowStyles[1].Height = 100; this.Width = 770; this.Height = 400; } else if (resultList.Count > 5 && resultList.Count <= 10) { tableLayoutPanel1.RowStyles[1].SizeType = SizeType.Absolute; tableLayoutPanel1.RowStyles[1].Height = 200; this.Width = 770; this.Height = 500; this.Update(); } else { tableLayoutPanel1.RowStyles[1].SizeType = SizeType.Absolute; tableLayoutPanel1.RowStyles[1].Height = 300; this.Width = 770; this.Height = 600; } for (int x = 0; x < resultList.Count; x++) { SimpleButton simpleButton1 = new SimpleButton(); simpleButton1.Appearance.Font = new System.Drawing.Font("맑은 고딕", 7F); simpleButton1.Appearance.Options.UseFont = true; simpleButton1.Appearance.Options.UseTextOptions = true; simpleButton1.Appearance.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Near; simpleButton1.Appearance.TextOptions.VAlignment = DevExpress.Utils.VertAlignment.Top; simpleButton1.ButtonStyle = DevExpress.XtraEditors.Controls.BorderStyles.NoBorder; //if (resultList[x].PROCESS_SEQ.ToString() == _processSeq) simpleButton1.ImageOptions.AllowGlyphSkinning = DevExpress.Utils.DefaultBoolean.False; //else simpleButton1.ImageOptions.AllowGlyphSkinning = DevExpress.Utils.DefaultBoolean.True; simpleButton1.Appearance.BackColor = Color.DimGray; simpleButton1.Appearance.ForeColor = System.Drawing.Color.White; if (resultList[x].PROCESS_SEQ.ToString() == _processSeq) { simpleButton1.Appearance.BackColor = Color.Blue; simpleButton1.ButtonStyle = DevExpress.XtraEditors.Controls.BorderStyles.NoBorder; simpleButton1.ImageOptions.ImageUri.Uri = "Apply;Size32x32;Office2013"; simpleButton1.Appearance.ForeColor = System.Drawing.Color.White; simpleButton1.ImageOptions.AllowGlyphSkinning = DevExpress.Utils.DefaultBoolean.True; currentButton = simpleButton1; } simpleButton1.ImageOptions.ImageToTextAlignment = DevExpress.XtraEditors.ImageAlignToText.BottomRight; simpleButton1.ImageOptions.ImageToTextIndent = 5; //simpleButton1.ImageOptions.ImageUri.Uri = "Apply;Size32x32;Office2013"; simpleButton1.ImageOptions.Location = DevExpress.XtraEditors.ImageLocation.BottomRight; //simpleButton1.Name = "simpleButton1"; simpleButton1.Size = new System.Drawing.Size(89, 60); simpleButton1.Text = string.Format("{1}{0}{2}", Environment.NewLine, resultList[x].PROCESS_SEQ.ToString(), resultList[x].PROCESS_DESC.ToString()); SimpleButton simpleButton2 = new SimpleButton(); simpleButton2.ButtonStyle = DevExpress.XtraEditors.Controls.BorderStyles.NoBorder; simpleButton2.ImageOptions.ImageUri.Uri = "Forward;GrayScaled"; simpleButton2.Location = new System.Drawing.Point(252, 176); //simpleButton2.Name = "simpleButton1"; simpleButton2.Size = new System.Drawing.Size(45, 60); this.flowLayoutPanel1.Controls.Add(simpleButton1); if (x + 1 != resultList.Count) { this.flowLayoutPanel1.Controls.Add(simpleButton2); } } timer1.Start(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
public ActionResult _Grafico(EnumTipoGrafico tipoGrafico, EnumTipoReporteGrafico tipoReporteGrafico) { DashboardDAO dao = new DashboardDAO(); Notificacion <Grafico> grafico = new Notificacion <Grafico>(); if ((tipoGrafico == EnumTipoGrafico.EntradasPorFecha) || (tipoGrafico == EnumTipoGrafico.SalidasPorFecha)) { //Notificacion<List<Estacion>> estaciones = dao.ObtenerVentasEstacion(); Notificacion <List <Categoria> > categorias = dao.ObtenerEntradasSalidasPorFecha(tipoReporteGrafico, tipoGrafico); grafico.Estatus = categorias.Estatus; grafico.Mensaje = categorias.Mensaje; List <Data> dataProductos = new List <Data>(); List <seriesDrilldown> SeriesDrilldown = new List <seriesDrilldown>(); if (categorias.Estatus == 200) { foreach (Categoria categoria in categorias.Modelo) { Data data = new Data(); data.name = categoria.categoria; data.y = categoria.total; Notificacion <List <Categoria> > productos = dao.ObtenerEntradasSalidasPorProducto(categoria.fechaIni, categoria.fechaFin, tipoReporteGrafico, tipoGrafico); if (productos.Estatus == 200) { List <List <Object> > DataDrilldown = new List <List <Object> >(); foreach (Categoria e in productos.Modelo) { DataDrilldown.Add(new List <Object>() { e.categoria.ToString(), e.total }); } SeriesDrilldown.Add(new seriesDrilldown() { id = categoria.id + "_" + categoria.categoria, name = categoria.categoria, data = DataDrilldown }); } data.drilldown = categoria.id + "_" + categoria.categoria; dataProductos.Add(data); } grafico.Modelo = new Grafico(); if (dataProductos.Count > 0) { grafico.Estatus = 200; grafico.Modelo.data = dataProductos; grafico.Modelo.seriesDrilldowns = SeriesDrilldown; } else { grafico.Estatus = -1; grafico.Mensaje = "No existe información para mostrar"; } } } if (tipoGrafico == EnumTipoGrafico.TopTenProductosEntrantes || tipoGrafico == EnumTipoGrafico.TopTenProductosSalientes) { Notificacion <List <Categoria> > categorias = dao.ObtenerTopTen(tipoReporteGrafico, tipoGrafico); grafico.Estatus = categorias.Estatus; grafico.Mensaje = categorias.Mensaje; if (categorias.Estatus == 200) { grafico.Modelo = new Grafico(); grafico.Modelo.data = new List <Data>(); //grafico.Modelo.categorias = categorias.Modelo; foreach (Categoria categoria in categorias.Modelo) { Data data = new Data(); data.name = categoria.categoria; data.y = categoria.total; grafico.Modelo.data.Add(data); } } } ViewBag.tipoGrafico = tipoGrafico; ViewBag.tipoReporteGrafico = tipoReporteGrafico; return(PartialView(grafico)); }
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); } }