private void spreadsheetControl1_CellValueChanged(object sender, DevExpress.XtraSpreadsheet.SpreadsheetCellEventArgs e) { IWorkbook workbook2 = spreadsheetControl1.Document; Worksheet sheet2_0 = workbook2.Worksheets[0]; if (sheet2_0.Cells[2, 0].Value.ToString() == null || sheet2_0.Cells[2, 0].Value.ToString() == "") { CoFAS_DevExpressManager.ShowInformationMessage("엑셀 시트를 불러와주시기 바랍니다."); return; } int click_col = 0; int click_row = 0; click_col = spreadsheetControl1.ActiveWorksheet[spreadsheetControl1.ActiveCell.GetReferenceA1()].RightColumnIndex; click_row = spreadsheetControl1.ActiveWorksheet[spreadsheetControl1.ActiveCell.GetReferenceA1()].TopRowIndex; if (click_col == 2 && click_row < 178) { lock (this) { showMsg method = delegate { string str = sheet2_0.Cells[click_row, click_col].Value.ToString(); sheet2_0.Cells[click_row, click_col].SetValue(str); // sheet2_0. bool check; check = str.Contains(sheet2_0.Cells[click_row, 0].Value.ToString()); if (check) { sheet2_0.Cells[click_row, click_col + 1].SetValue("Y"); sheet2_0.Cells[click_row, click_col + 1].Font.Color = Color.White; sheet2_0.Cells[click_row, click_col + 1].Fill.BackgroundColor = Color.Green; } else { sheet2_0.Cells[click_row, click_col + 1].SetValue("N"); sheet2_0.Cells[click_row, click_col + 1].Font.Color = Color.White; sheet2_0.Cells[click_row, click_col + 1].Fill.BackgroundColor = Color.Red; } //sheet2_0.SelectedCell = sheet2_0.Cells[click_row + 1, click_col]; }; this.BeginInvoke(method); } } else { CoFAS_DevExpressManager.ShowInformationMessage("해당하는 Barcode에 마우스를 클릭해주시기 바랍니다."); return; } }
public void generater() { DelegateShowMsg = new showMsg(showmessage); getNowDbSchemas(); if (mNowSchemas == null || mNowSchemas.Count <= 0) { return; } getHostoryDbSchemas(); if (mHostoryDbSchemas != null && mHostoryDbSchemas.Count > 0) { //except identical mHostoryDbSchemas.Distinct(); mNowSchemas.Distinct(); exceptIdentical(); } else { needThreadGeneraters = mNowSchemas; } generaterCode(needThreadGeneraters); // save the new to History ; saveDbSchemasToFile(); }
private void Serial_Data(byte[] data) { try { IWorkbook workbook2 = spreadsheetControl1.Document; Worksheet sheet2_0 = workbook2.Worksheets[0]; if (sheet2_0.Cells[2, 0].Value.ToString() == null || sheet2_0.Cells[2, 0].Value.ToString() == "") { CoFAS_DevExpressManager.ShowInformationMessage("엑셀 시트를 불러와주시기 바랍니다."); return; } int click_col = 0; int click_row = 0; click_col = spreadsheetControl1.ActiveWorksheet[spreadsheetControl1.ActiveCell.GetReferenceA1()].RightColumnIndex; click_row = spreadsheetControl1.ActiveWorksheet[spreadsheetControl1.ActiveCell.GetReferenceA1()].TopRowIndex; if (click_col == 2 && click_row < 178) { lock (this) { showMsg method = delegate { string str = Encoding.Default.GetString(data); sheet2_0.Cells[click_row, click_col].SetValue(str); // sheet2_0. bool check; check = str.Contains(sheet2_0.Cells[click_row, 0].Value.ToString()); if (check) { sheet2_0.Cells[click_row, click_col + 1].SetValue("Y"); sheet2_0.Cells[click_row, click_col + 1].Font.Color = Color.White; sheet2_0.Cells[click_row, click_col + 1].Fill.BackgroundColor = Color.Green; } else { sheet2_0.Cells[click_row, click_col + 1].SetValue("N"); sheet2_0.Cells[click_row, click_col + 1].Font.Color = Color.White; sheet2_0.Cells[click_row, click_col + 1].Fill.BackgroundColor = Color.Red; } sheet2_0.SelectedCell = sheet2_0.Cells[click_row + 1, click_col]; }; this.BeginInvoke(method); } } else { CoFAS_DevExpressManager.ShowInformationMessage("해당하는 Barcode에 마우스를 클릭해주시기 바랍니다."); return; } } catch (Exception ex) { CoFAS_DevExpressManager.ShowInformationMessage("연결상태를 확인해주시기 바랍니다."); } }