private void fpView_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar == '\r') { if (shtView.Rows.Count == 0) { return; } if (shtView.ActiveRowIndex < 0) { return; } int activeRow = shtView.ActiveRowIndex; IsSelected = true; int rowModel = shtView.GetModelRowFromViewRow(activeRow); if (shtView.DataSource != null) { DataTable dt = (DataTable)shtView.DataSource; SelectedItem = DTOUtility.ConvertDataRowToDTO <CustomerDTO>(dt.Rows[rowModel]); } Close(); } }
private void fpView_CellDoubleClick(object sender, FarPoint.Win.Spread.CellClickEventArgs e) { if (shtView.Rows.Count == 0) { return; } if (shtView.ActiveRowIndex < 0) { return; } int activeRow = shtView.ActiveRowIndex; IsSelected = true; int rowModel = shtView.GetModelRowFromViewRow(activeRow); if (shtView.DataSource != null) { DataTable dt = (DataTable)shtView.DataSource; SelectedItem = DTOUtility.ConvertDataRowToDTO <CustomerDTO>(dt.Rows[rowModel]); } Close(); }
private void fpItemView_CellDoubleClick(object sender, FarPoint.Win.Spread.CellClickEventArgs e) { //EditItem(); if (shtItemView.Rows.Count == 0) { return; } if (shtItemView.ActiveRowIndex < 0) { return; } int activeRow = shtItemView.ActiveRowIndex; IsSelected = true; int rowModel = shtItemView.GetModelRowFromViewRow(activeRow); if (shtItemView.DataSource != null) { DataTable dt = (DataTable)shtItemView.DataSource; SelectedItem = DTOUtility.ConvertDataRowToDTO <ItemUIDM>(dt.Rows[rowModel]); } //SelectedItem.ITEM_CD.Value = shtItemView.Cells[activeRow, (int)eColView.ITEM_CD].Text; //SelectedItem.ITEM_DESC.Value = shtItemView.Cells[activeRow, (int)eColView.ITEM_DESC].Text; //SelectedItem.ITEM_TYPE.Value = shtItemView.Cells[activeRow, (int)eColView.ITEM_CLS].Value; //SelectedItem.LOT_CONTROL_CLS.Value = shtItemView.Cells[activeRow, (int)eColView.LOT_CONTROL_CLS].Value; //SelectedItem.ORDER_LOC_CD.Value = shtItemView.Cells[activeRow, (int)eColView.ORDER_LOC_CD].Text; //SelectedItem.STORE_LOC_CD.Value = shtItemView.Cells[activeRow, (int)eColView.STORE_LOC_CD].Text; this.Close(); //SelectedItem.CRT_BY.Value = shtItemView.Cells[activeRow, (int)eColView.CRT_BY].Text; //SelectedItem.CRT_DATE.Value = shtItemView.Cells[activeRow, (int)eColView.CRT_DATE].Text; //SelectedItem.CRT_MACHINE.Value = shtItemView.Cells[activeRow, (int)eColView.CRT_MACHINE].Text; //SelectedItem.UPD_BY.Value = shtItemView.Cells[activeRow, (int)eColView.UPD_BY].Text; //SelectedItem.UPD_DATE.Value = shtItemView.Cells[activeRow, (int)eColView.UPD_DATE].Text; //SelectedItem.UPD_MACHINE.Value = shtItemView.Cells[activeRow, (int)eColView.UPD_MACHINE].Text; }
private void fpQueryList_SelectionChanged(object sender, FarPoint.Win.Spread.SelectionChangedEventArgs e) { this.shtView.DataSource = null; this.shtView.RowCount = 0; this.shtView.ColumnCount = 0; this.m_dtAllData = null; if (m_dtQueryList != null) { object o = shtQueryList.Cells[e.Range.Row, (int)eColQueryList.ID].Value; if (o != null) { string strID = Convert.ToString(o); DataRow[] dr = m_dtQueryList.Select(eColQueryList.ID.ToString() + "='" + strID + "'"); //DataView dv = m_dtQueryList.DefaultView; //dv.RowFilter = eColQueryList.ID.ToString() + "='" + strID + "'"; if (dr.Length > 0) { QueryLunchDTO dto = DTOUtility.ConvertDataRowToDTO <QueryLunchDTO>(dr[0]); this.txtSearch.Text = dto.SQLCommand; this.txtStartRow.Text = Convert.ToString(dto.StartRow); this.txtStartColumn.Text = Convert.ToString(dto.StartColumn); this.txtTemplate.Text = dto.ExcelTemplate; //this.txtSearch.Text = dr[0]["SQLCommand"].ToString();//dto.SQLCommand; //this.txtStartRow.Text = dr[0]["StartRow"].ToString();//Convert.ToString(dto.StartRow); //this.txtStartColumn.Text = dr[0]["StartColumn"].ToString();//Convert.ToString(dto.StartColumn); //this.txtTemplate.Text = dr[0]["ExcelTemplate"].ToString();//dto.ExcelTemplate; } } } }