private void grid_DragDrop(object sender, System.Windows.Forms.DragEventArgs e) { DevExpress.XtraGrid.GridControl grid = sender as DevExpress.XtraGrid.GridControl; //if (grid.Name == "_gdMAIN") // return; DataTable table = grid.DataSource as DataTable; DataRow row = e.Data.GetData(typeof(DataRow)) as DataRow; if (row != null && table != null && row.Table != table) { if (row.ItemArray.Length < 7) { return; } //bool isChack = CoFAS_ConvertManager.DataTable_FindCount(table, String.Format("CONFIGURATION_CODE = '{0}'", row["CONFIGURATION_CODE"].ToString()), ""); //if (!isChack) //{ //table.ImportRow(row); _pScheduling_T50Entity.ORDER_ID = row["PRODUCTION_ORDER_ID"].ToString(); _pScheduling_T50Entity.ORDER_SEQ = row["PRODUCTION_ORDER_SEQ"].ToString(); _pScheduling_T50Entity.order_date = row["PRODUCTION_ORDER_DATE"].ToString(); DataTable dt = new Scheduling_T50Business().ucScheduling_T50_U10(_pScheduling_T50Entity); GetGrid(); OnPopup(this, new EventArgs()); //} } }
private void GetGrid() { DataTable dt = new Scheduling_T50Business().ucScheduling_T50_OrderList(_pScheduling_T50Entity); //if(dt.Rows.Count > 0) //{ _gdMAIN.DataSource = dt; _gdMAIN_VIEW.BestFitColumns(); //_gdMAIN_VIEW.Columns["production_order_id"].Caption = "작지번호"; //} }
private void OrderUpdate(string status) { DataRow dr = _gdMAIN_VIEW.GetFocusedDataRow(); if (dr == null) { return; } _pScheduling_T50Entity.ORDER_ID = dr["PRODUCTION_ORDER_ID"].ToString(); _pScheduling_T50Entity.ORDER_SEQ = dr["PRODUCTION_ORDER_SEQ"].ToString(); _pScheduling_T50Entity.order_date = dr["PRODUCTION_ORDER_DATE"].ToString(); _pScheduling_T50Entity.USER_SEQ = int.Parse(dr["ORDER_SEQ"].ToString()); _pScheduling_T50Entity.CRUD = status; DataTable dt = new Scheduling_T50Business().ucScheduling_T50_U11(_pScheduling_T50Entity); int [] rowf = _gdMAIN_VIEW.GetSelectedRows(); GetGrid(); if (rowf.Length > 0) { int nowrowseq = rowf[0]; switch (status) { case "UP": if (nowrowseq >= 1) { nowrowseq--; } break; case "DOWN": if (nowrowseq < _gdMAIN_VIEW.RowCount - 1) { nowrowseq++; } break; case "DELETE": break; } _gdMAIN_VIEW.FocusedRowHandle = nowrowseq; //_gdMAIN_VIEW.SelectRow(nowrowseq); } }
private void SetEqui() { tlpEmp.CellBorderStyle = TableLayoutPanelCellBorderStyle.None; tlpEmp.Controls.Clear(); //tlpCount = 0; tlpEmp.RowCount = 1; tlpEmp.ColumnCount = 1; // 선택한 설비 목록 가져오기. DataTable _dtEqui = new Scheduling_T50Business().Scheduling_T50_EquiList(_pScheduling_T50Entity); if (_dtEqui.Rows.Count > 0) { // 해당 설비의 모니터링 화면을 표시 한다. (225 * 266) //Monitor mot = new Monitor(SubP.Tag.ToString()); //mot.Margin = new Padding(publicMargin); //mot.Device_No = SubL.Tag.ToString(); // DeviceNo //mot.Device_Name = SubL.Text; //mot.Device_type = SubP.Tag.ToString(); //DeviceType //mot.OnClose += new Monitor.OnCloseEventHandler(UC_onClose); //mot.OnPopup += new Monitor.OnPopupEventHandler(UC_OnPopup); //mot.LChagne += new Monitor.LocationChangeEvent(CH_Popup); //mot.subChange += new Monitor.LocationChangeEvent2(CH_Popup2); for (int x = 0; x < _dtEqui.Rows.Count; x++) { UserControls.ucScheduling_T50 mot = new UserControls.ucScheduling_T50(_dtEqui.Rows[x], _pUSER_CODE, _pScheduling_T50Entity.order_date); mot.Tag = chkAll.Checked; mot.OnPopup += new UserControls.ucScheduling_T50.OnPopupEventHandler(UC_OnPopup); if (tlpCount < 1) { // 현재 모니터 해상도상 Width 값으로 Row당 표시할 컨트롤 갯수를 설정한다. // 화면내 채울수 있는 컬럼 갯수를 파악한다) tlpCount = (int)Math.Floor((decimal)Screen.PrimaryScreen.Bounds.Width / (mot.Width + (publicMargin * 2))); //tlpCount = (int)Math.Floor((decimal)tlpEmp.Width / (mot.Width + (publicMargin * 2))); } //mot.Left = // 최초 Rowcount 1개일때 2개 로우로 시작한다. (맨 아래 Row는 % 여백용) if (tlpEmp.RowCount - 1 < 1) { tlpEmp.RowCount = tlpEmp.RowCount + 1; tlpEmp.RowStyles.Clear(); tlpEmp.RowStyles.Add(new RowStyle(SizeType.Absolute, mot.Height + (publicMargin * 2))); tlpEmp.RowStyles.Add(new RowStyle(SizeType.Percent, 100)); } // 마지막 전 Row의 컬럼 갯수를 확인한다. 만약 컬럼갯수가 1개라면 채울수 있는 갯수 + 1 생성한다 (맨 끝 컬럼 % 여백용) if (tlpEmp.ColumnCount - 1 < 1) { //tlpEmp.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 235)); tlpEmp.ColumnCount = tlpEmp.ColumnCount + tlpCount; tlpEmp.ColumnStyles.Clear(); for (int i = 0; i < tlpCount; i++) { tlpEmp.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, mot.Width + (publicMargin * 2))); } tlpEmp.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100)); } // 마지막 로우 -1 의 컬럼들을 체크한다(해당 컬럼내에 Control이 있는지 확인..) for (int i = 0; i < tlpEmp.ColumnCount - 1; i++) { if (tlpEmp.GetControlFromPosition(i, tlpEmp.RowCount - 2) == null) { // 해당 위치에 컨트롤이 없으므로 해당 위치에 추가해 준다. tlpEmp.Controls.Add(mot, i, tlpEmp.RowCount - 2); // 컬럼, 로우 break; } // 마지막 컬럼까지 돌았는데 컨트롤 추가할 영역이 없다면 신규 Row를 생성하고 i 값 초기화 if (i == tlpEmp.ColumnCount - 2) { tlpEmp.RowCount = tlpEmp.RowCount + 1; tlpEmp.RowStyles.Clear(); for (int j = 0; j < tlpEmp.RowCount - 1; j++) { tlpEmp.RowStyles.Add(new RowStyle(SizeType.Absolute, mot.Height + (publicMargin * 2))); } tlpEmp.RowStyles.Add(new RowStyle(SizeType.Percent, 100)); i = -1; } } } } }