//private void AddCurrentRowStationInfo(GridViewRowInfo rowInfo, List<MesService.TestLogResultHistory> historyList,string processName,string pid,string sid) //{ // var stationInDate_burn = rowInfo.Cells[5].Value.ToString(); // var stationInDate_sen = rowInfo.Cells[15].Value.ToString(); // var stationInDate_shell = rowInfo.Cells[27].Value.ToString(); // var stationInDate_air = rowInfo.Cells[41].Value.ToString(); // var stationInDate_stent = rowInfo.Cells[46].Value.ToString(); // var stationInDate_product = rowInfo.Cells[55].Value.ToString(); // if (!string.IsNullOrEmpty(stationInDate_burn)) // { // MesService.TestLogResultHistory history = new MesService.TestLogResultHistory(); // history.ProcessName = processName; // history.PcbaSN = pid; // history.ProductSN = sid; // history.StationName = "烧录工站"; // history.StationInDate = stationInDate_burn; // historyList.Add(history); // } // if (!string.IsNullOrEmpty(stationInDate_sen)) // { // MesService.TestLogResultHistory history = new MesService.TestLogResultHistory(); // history.ProcessName = processName; // history.PcbaSN = pid; // history.ProductSN = sid; // history.StationName = "灵敏度测试工站"; // history.StationInDate = stationInDate_sen; // historyList.Add(history); // } // if (!string.IsNullOrEmpty(stationInDate_shell)) // { // MesService.TestLogResultHistory history = new MesService.TestLogResultHistory(); // history.ProcessName = processName; // history.PcbaSN = pid; // history.ProductSN = sid; // history.StationName = "外壳装配工站"; // history.StationInDate = stationInDate_shell; // historyList.Add(history); // } // if (!string.IsNullOrEmpty(stationInDate_air)) // { // MesService.TestLogResultHistory history = new MesService.TestLogResultHistory(); // history.ProcessName = processName; // history.PcbaSN = pid; // history.ProductSN = sid; // history.StationName = "气密测试工站"; // history.StationInDate = stationInDate_air; // historyList.Add(history); // } // if (!string.IsNullOrEmpty(stationInDate_stent)) // { // MesService.TestLogResultHistory history = new MesService.TestLogResultHistory(); // history.ProcessName = processName; // history.PcbaSN = pid; // history.ProductSN = sid; // history.StationName = "支架装配工站"; // history.StationInDate = stationInDate_stent; // historyList.Add(history); // } // if (!string.IsNullOrEmpty(stationInDate_product)) // { // MesService.TestLogResultHistory history = new MesService.TestLogResultHistory(); // history.ProcessName = processName; // history.PcbaSN = pid; // history.ProductSN = sid; // history.StationName = "成品测试工站"; // history.StationInDate = stationInDate_product; // historyList.Add(history); // } //} #endregion private string ExportDesFilePath(GridViewExport.ExportFormat exportFormat) { var filter = "Excel (*.xls)|*.xls"; var path = ""; if (exportFormat == GridViewExport.ExportFormat.EXCEL) { filter = "Excel (*.xls)|*.xls"; path = FileSelect.SaveAs(filter, "C:\\"); } else if (exportFormat == GridViewExport.ExportFormat.HTML) { filter = "Html File (*.htm)|*.htm"; path = FileSelect.SaveAs(filter, "C:\\"); } else if (exportFormat == GridViewExport.ExportFormat.PDF) { filter = "PDF file (*.pdf)|*.pdf"; path = FileSelect.SaveAs(filter, "C:\\"); } else if (exportFormat == GridViewExport.ExportFormat.CSV) { filter = "CSV file (*.csv)|*.csv"; path = FileSelect.SaveAs(filter, "C:\\"); } return(path); }
private async void ExportGridViewData() { GridViewExport.ExportFormat exportFormat = GridViewExport.ExportFormat.EXCEL; Enum.TryParse(tool_exportCondition.Text, out exportFormat); var desPath = ExportDesFilePath(exportFormat); this.tool_export.Enabled = false; DataTable dt = null; if (this.radDock1.ActiveWindow == this.tool_logData) { //GridViewExport.ExportGridViewData(exportFormat, this.radGridView1); await Task.Run(() => { dt = QueryAllLogdetail(); }); } else if (this.radDock1.ActiveWindow == this.tool_specCfg) { //GridViewExport.ExportGridViewData(exportFormat, this.gridSpec); await Task.Run(() => { dt = QueryAllLimitConfig(); }); } else if (this.radDock1.ActiveWindow == this.tool_programv) { //GridViewExport.ExportGridViewData(exportFormat, this.gridProgrameVersion); await Task.Run(() => { dt = QueryAllTestPramVersion(); }); } if (!GridViewExport.ImportToCSV(dt, desPath)) { return; } //export data complete MessageBox.Show("导出完成!", "提示", MessageBoxButtons.OK); this.tool_export.Enabled = true; }
private void Tool_sn_export_Click(object sender, EventArgs e) { GridViewExport.ExportFormat exportFormat = GridViewExport.ExportFormat.EXCEL; Enum.TryParse(this.tool_exportFilter.Text, out exportFormat); GridViewExport.ExportGridViewData(exportFormat, this.radGridView1); }
private void Menu_export_Click(object sender, EventArgs e) { GridViewExport.ExportFormat exportFormat = GridViewExport.ExportFormat.EXCEL; Enum.TryParse(this.menu_exportCondition.Text, out exportFormat); GridViewExport.ExportGridViewData(exportFormat, this.radGridView1); }
private void Tool_package_export_Click(object sender, EventArgs e) { GridViewExport.ExportFormat exportFormat = GridViewExport.ExportFormat.EXCEL; Enum.TryParse(tool_package_exportFilter.Text, out exportFormat); GridViewExport.ExportGridViewData(exportFormat, radGridViewPackage); }
private void ExportGridViewData(string exportCondition, RadGridView radGridView) { GridViewExport.ExportFormat exportFormat = GridViewExport.ExportFormat.EXCEL; Enum.TryParse(exportCondition, out exportFormat); GridViewExport.ExportGridViewData(exportFormat, radGridView); }
private void ExportGridViewData() { GridViewExport.ExportFormat exportFormat = GridViewExport.ExportFormat.EXCEL; //Enum.TryParse(tool_package_exportFilter.Text, out exportFormat); //GridViewExport.ExportGridViewData(exportFormat, this.radGridView1); }