//导出单条数据 private void ExportSingleDataToPath(string folderPath, string dataBaseName, WimsGridView wimsGridView) { Cursor.Current = Cursors.WaitCursor; if (Directory.Exists(folderPath)) { Directory.Delete(folderPath, true); } Directory.CreateDirectory(folderPath); switch (dataBaseName) { case "Command": Command Entity = wimsGridView.FindFirstSelect <Command>(); List <Command> commandList = new List <Command>(); commandList.Add(Entity); BackupDataBll <Command> .ExportSingleData(folderPath, commandList); break; case "Dut": Dut dutEntity = wimsGridView.FindFirstSelect <Dut>(); List <Dut> dutList = new List <Dut>(); dutList.Add(dutEntity); BackupDataBll <Dut> .ExportSingleData(folderPath, dutList); break; case "Project": Project projectEntity = wimsGridView.FindFirstSelect <Project>(); List <Project> projectList = new List <Project>(); projectList.Add(projectEntity); BackupDataBll <Project> .ExportSingleData(folderPath, projectList); break; case "TestCase": TestCase testCaseEntity = wimsGridView.FindFirstSelect <TestCase>(); List <TestCase> testCaseList = new List <TestCase>(); testCaseList.Add(testCaseEntity); BackupDataBll <TestCase> .ExportSingleData(folderPath, testCaseList); break; case "TestDevice": TestDevice testDeviceEntity = wimsGridView.FindFirstSelect <TestDevice>(); List <TestDevice> testDeviceList = new List <TestDevice>(); testDeviceList.Add(testDeviceEntity); BackupDataBll <TestDevice> .ExportSingleData(folderPath, testDeviceList); break; case "TestParams": TestParams testParamsEntity = wimsGridView.FindFirstSelect <TestParams>(); List <TestParams> testParamsList = new List <TestParams>(); testParamsList.Add(testParamsEntity); BackupDataBll <TestParams> .ExportSingleData(folderPath, testParamsList); break; } Cursor.Current = Cursors.Default; }
/// <summary> /// 导出 /// </summary> /// <param name="folderPath"></param> private void ExportDataToPath(string folderPath) { Cursor.Current = Cursors.WaitCursor; if (Directory.Exists(folderPath)) { Directory.Delete(folderPath, true); } Directory.CreateDirectory(folderPath); //Command BackupDataBll <Command> .ExportData(folderPath); //Dut BackupDataBll <Dut> .ExportData(folderPath); //Project BackupDataBll <Project> .ExportData(folderPath); //Step BackupDataBll <Step> .ExportData(folderPath); //TestCase BackupDataBll <TestCase> .ExportData(folderPath); //TestDevice BackupDataBll <TestDevice> .ExportData(folderPath); //TestParams BackupDataBll <TestParams> .ExportData(folderPath); Cursor.Current = Cursors.Default; }
//导出 private void ExportDataToPath(string folderPath, string dataBaseName) { Cursor.Current = Cursors.WaitCursor; if (Directory.Exists(folderPath)) { Directory.Delete(folderPath, true); } Directory.CreateDirectory(folderPath); switch (dataBaseName) { case "Command": BackupDataBll <Command> .ExportData(folderPath); break; case "Dut": BackupDataBll <Dut> .ExportData(folderPath); break; case "Project": BackupDataBll <Project> .ExportData(folderPath); break; case "TestCase": BackupDataBll <TestCase> .ExportData(folderPath); break; case "TestDevice": BackupDataBll <TestDevice> .ExportData(folderPath); break; case "TestParams": BackupDataBll <TestParams> .ExportData(folderPath); break; } Cursor.Current = Cursors.Default; }