Thiết lập gần hết giấy cho in tối đa 20 lần

This commit is contained in:
Nguyen Dinh Thuan
2024-09-26 13:11:35 +07:00
parent 055c6b6343
commit f9f9ba3d49
2 changed files with 124 additions and 4 deletions
+5 -3
View File
@@ -451,7 +451,7 @@ namespace SafeBagDE70
var strPrinterMessage = "";
if (status != null)
{
if (status.StsNOPAPER)
if (status.StsNOPAPER|| AppData.IsStopPrinting())
{
AppData.DeviceStatus.PrinterStatus = (int)PrinterStatusCode.PAPEROUT;
StopTimers();
@@ -461,6 +461,7 @@ namespace SafeBagDE70
}
else if (status.StsNEARENDPAP)
{
AppData.UpdatePrinterStatus(true);
strPrinterMessage = "MÁY IN: GẦN HẾT GIẤY";
AppData.DeviceStatus.PrinterStatus = (int)PrinterStatusCode.NEARPAPEROUT;
AppData.ADMINDEVICESTATUS.PrinterStatus = strPrinterMessage;
@@ -473,6 +474,8 @@ namespace SafeBagDE70
}
else
{
AppData.UpdatePrinterStatus(false);
strPrinterMessage = "MÁY IN: OK";
AppData.DeviceStatus.PrinterStatus = (int)PrinterStatusCode.NORMAL;
AppData.ADMINDEVICESTATUS.PrinterStatus = strPrinterMessage;
@@ -1471,8 +1474,7 @@ namespace SafeBagDE70
// or for more complex scenarios, directly manipulate the byte stream sent to the printer.
};
printDocument.Print();
AppData.UpdatePrintingCountToStatusFile();
}
private void UserControl_Unloaded(object sender, RoutedEventArgs e)