private void GetExpressPrintConfig() { ExpressPrintConfig = CommonService.GetBarTenderPrintConfigXX(User.ID, 3, HostName); if (ExpressPrintConfig != null) { //ExpressTemplateSelectedItem = ExpressPrintConfig.ExpressTemplateSelectedItem; //验证打印机和模板路径是否存在 if (!File.Exists(ExpressPrintConfig.TemplateSelectedItem.TemplateFullName)) { MessageBox.Show(" 模板路径不存在,请手动选择模板目录 \r\n"); ExpressPrintConfig.TemplateSelectedItem = null; return; } if (!ComputerPrinters.Contains(ExpressPrintConfig.PrinterName)) { MessageBox.Show("打印机错误或不存在,请手动选择 打印机 \r\n"); ExpressPrintConfig.PrinterName = null; return; } ExpressTemplates = CommonService.GetTenderPrintTemplates(ExpressPrintConfig.TemplateSelectedItem.TemplateFolderPath); } else { ExpressPrintConfig = new BarTenderPrintConfigModelXX(); } }
private void GetOilSamplePrintConfig() { OilSampleTemplateSelectedItem = new BarTenderTemplateModel(); OilSamplePrintConfig = CommonService.GetBarTenderPrintConfig(User.ID, 2, HostName); if (OilSamplePrintConfig != null) { OilSampleTemplates = CommonService.GetTenderPrintTemplates(OilSamplePrintConfig.TemplateFolderPath); //验证打印机和模板路径是否存在 if (!File.Exists(OilSamplePrintConfig.TemplateFullName)) { MessageBox.Show(" 模板路径不存在,请手动选择模板目录 \r\n"); OilSampleTemplateSelectedItem = null; OilSamplePrintConfig.TemplateFullName = null; OilSamplePrintConfig.TemplateFileName = null; OilSamplePrintConfig.TemplateFolderPath = null; OilSamplePrintConfig.TemplatePerPage = 0; return; } if (!ComputerPrinters.Contains(OilSamplePrintConfig.PrinterName)) { MessageBox.Show("打印机错误或不存在,请手动选择 打印机 \r\n"); OilSamplePrintConfig.PrinterName = null; return; } OilSampleTemplateSelectedItem.TemplatePerPage = OilSamplePrintConfig.TemplatePerPage; OilSampleTemplateSelectedItem.TemplateFileName = OilSamplePrintConfig.TemplateFileName; OilSampleTemplateSelectedItem.TemplateFullName = OilSamplePrintConfig.TemplateFullName; OilSampleTemplateSelectedItem.TemplateFolderPath = OilSamplePrintConfig.TemplateFolderPath; } else { OilSamplePrintConfig = new BarTenderPrintConfigModel(); } }