Initial commit
Initial commit til Git. V2 er deployed
This commit is contained in:
44
PointOfSale/Pos.Ui/EpsonPrinter/Services/PrintString.cs
Normal file
44
PointOfSale/Pos.Ui/EpsonPrinter/Services/PrintString.cs
Normal file
@@ -0,0 +1,44 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace EpsonPrinter.Services
|
||||
{
|
||||
public class PrintString
|
||||
{
|
||||
/// <summary>
|
||||
/// An appropriate interval is converted into the length of
|
||||
/// the tab about two texts. And make a printing data.
|
||||
/// </summary>
|
||||
/// <param name="iLineChars">
|
||||
/// The width of the territory which it prints on is converted into the number of
|
||||
/// characters, and that value is specified.
|
||||
/// </param>
|
||||
/// <param name="strBuf">
|
||||
/// It is necessary as an information for deciding the interval of the text.
|
||||
/// </param>
|
||||
/// <param name="strPrice">
|
||||
/// It is necessary as an information for deciding the interval of the text, too.
|
||||
/// </param>
|
||||
/// <returns>printing data.
|
||||
/// </returns>
|
||||
public String MakePrintString(int iLineChars, String strBuf, String strPrice)
|
||||
{
|
||||
int iSpaces = 0;
|
||||
String tab = "";
|
||||
try
|
||||
{
|
||||
iSpaces = iLineChars - (strBuf.Length + strPrice.Length);
|
||||
for (int j = 0; j < iSpaces; j++)
|
||||
{
|
||||
tab += " ";
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
}
|
||||
return strBuf + tab + strPrice;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user