LaneOut - Add Printer.
This commit is contained in:
parent
315d2fd03a
commit
44ee429ae6
|
@ -20,6 +20,7 @@ namespace AIParkingApplication
|
||||||
private bool isRetryMode;
|
private bool isRetryMode;
|
||||||
private IDoorControlAccess doorControlAccess;
|
private IDoorControlAccess doorControlAccess;
|
||||||
private ApiController apiController;
|
private ApiController apiController;
|
||||||
|
private Printer printer;
|
||||||
|
|
||||||
public LaneOut(int doorId,
|
public LaneOut(int doorId,
|
||||||
string plateStream,
|
string plateStream,
|
||||||
|
@ -43,6 +44,7 @@ namespace AIParkingApplication
|
||||||
this.apiController = apiController;
|
this.apiController = apiController;
|
||||||
this.doorControlAccess = doorControlAccess;
|
this.doorControlAccess = doorControlAccess;
|
||||||
this.doorControlAccess.OnNewCardReceived += C3Device_OnNewCardReceived;
|
this.doorControlAccess.OnNewCardReceived += C3Device_OnNewCardReceived;
|
||||||
|
printer = new Printer();
|
||||||
|
|
||||||
plateCamera.OnVideoFrameReceived += PlateCameraOnVideoFrameReceived;
|
plateCamera.OnVideoFrameReceived += PlateCameraOnVideoFrameReceived;
|
||||||
plateCamera.OnOpenVideoStreamFailed += PlateCamera_OnOpenVideoStreamFailed;
|
plateCamera.OnOpenVideoStreamFailed += PlateCamera_OnOpenVideoStreamFailed;
|
||||||
|
@ -103,6 +105,14 @@ namespace AIParkingApplication
|
||||||
{
|
{
|
||||||
OpenDoor(doorId);
|
OpenDoor(doorId);
|
||||||
}
|
}
|
||||||
|
PrinterData printerData = new PrinterData
|
||||||
|
{
|
||||||
|
PlateString = result.PlateString,
|
||||||
|
MoneyAmount = saveLogResult.Cost,
|
||||||
|
TimeParkingIn = cardInformation.TimeIn,
|
||||||
|
TimeParkingOut = DateTime.Now.GetTimeFormatted()
|
||||||
|
};
|
||||||
|
printer.DoPrint(printerData);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -7,15 +7,14 @@ namespace AIParkingApplication
|
||||||
{
|
{
|
||||||
public class Printer
|
public class Printer
|
||||||
{
|
{
|
||||||
private WebBrowser webBrowser;
|
|
||||||
public Printer()
|
public Printer()
|
||||||
{
|
{
|
||||||
webBrowser = new WebBrowser();
|
|
||||||
SetupPrinterPageSetting();
|
SetupPrinterPageSetting();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void DoPrint(PrinterData printData)
|
public void DoPrint(PrinterData printData)
|
||||||
{
|
{
|
||||||
|
WebBrowser webBrowser = new WebBrowser();
|
||||||
webBrowser.Left = 0;
|
webBrowser.Left = 0;
|
||||||
string documentText = ProcessingString("PrinterForm.html", printData);
|
string documentText = ProcessingString("PrinterForm.html", printData);
|
||||||
if (!string.IsNullOrEmpty(documentText))
|
if (!string.IsNullOrEmpty(documentText))
|
||||||
|
@ -38,7 +37,7 @@ namespace AIParkingApplication
|
||||||
htmlStr = htmlStr.Replace("{PLATE_STRING}", printerField.PlateString)
|
htmlStr = htmlStr.Replace("{PLATE_STRING}", printerField.PlateString)
|
||||||
.Replace("{TIME_PARKING_IN}", printerField.TimeParkingIn)
|
.Replace("{TIME_PARKING_IN}", printerField.TimeParkingIn)
|
||||||
.Replace("{TIME_PARKING_OUT}", printerField.TimeParkingOut)
|
.Replace("{TIME_PARKING_OUT}", printerField.TimeParkingOut)
|
||||||
.Replace("{MONEY_AMOUNT}", printerField.MoneyAmount.ToString());
|
.Replace("{MONEY_AMOUNT}", printerField.MoneyAmount);
|
||||||
return htmlStr;
|
return htmlStr;
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
|
@ -67,6 +66,6 @@ namespace AIParkingApplication
|
||||||
public string PlateString { get; set; }
|
public string PlateString { get; set; }
|
||||||
public string TimeParkingIn { get; set; }
|
public string TimeParkingIn { get; set; }
|
||||||
public string TimeParkingOut { get; set; }
|
public string TimeParkingOut { get; set; }
|
||||||
public int MoneyAmount { get; set; }
|
public string MoneyAmount { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user