public void updateDocumentPrinterName(string name) { POSData printer_data = new POSData() { ReciptPrinterName = readReciptPrinterName(), DocumentSavePath = readDocumentSavePath(), DocumentPrinterName = name }; try { XMLFile.ToXmlFile(printer_data, Paths.PROGRAME_DATA_FILE); logger.log("Recipt printer name successfully updated!"); } catch (Exception ex) { logger.log($"Failed to update printer name: {ex}", Logger.LogLevel.LEVEL_ERROR); } }
public void updateDocumentSavePath(string path) { POSData document_data = new POSData() { ReciptPrinterName = readReciptPrinterName(), DocumentSavePath = path, DocumentPrinterName = readDocumentPrinterName() }; try { XMLFile.ToXmlFile(document_data, Paths.PROGRAME_DATA_FILE); logger.log("Document save path successfully updated!"); } catch (Exception ex) { logger.log($"Failed to update document save path: {ex}", Logger.LogLevel.LEVEL_ERROR); } }
public string readDocumentSavePath() { try { POSData document_data = XMLFile.FromXmlFile <POSData>(Paths.PROGRAME_DATA_FILE); logger.log("Document save path successfully read!"); return(document_data.DocumentSavePath); } catch (Exception ex) { logger.log($"Failed to read document save path: {ex}", Logger.LogLevel.LEVEL_ERROR); return(Paths.DOCUMENT_SAVE_PATH); } }
public string readReciptPrinterName() { try { POSData printer = XMLFile.FromXmlFile <POSData>(Paths.PROGRAME_DATA_FILE); logger.log("Recipt printer name successfully read!"); return(printer.ReciptPrinterName); } catch (Exception ex) { logger.log($"Failed to read printer name: {ex}", Logger.LogLevel.LEVEL_ERROR); return(""); } }