Ejemplo n.º 1
0
        private static string BuildBillingString(InvoiceObject obj)
        {
            var bill =
                $"PS|DA{Fdate()}|PTC|RN{obj.roomN}|P#{obj.ticket:0000}|TA{obj.price}|TI{Ftime()}|X1{obj.productName}|";

            return(bill);
        }
Ejemplo n.º 2
0
        public InvoiceObject ParceBilingString(string str2Parse)
        {
            InvoiceObject result = new InvoiceObject();
            Dictionary <string, string> parsedStr = (str2Parse.Split(new char[] { '|' }, StringSplitOptions.RemoveEmptyEntries)).Where(str => str.Length >= 2).ToDictionary(str => str.Substring(0, 2).ToUpper(), str => str.Substring(2).ToUpper());

            result.roomN       = parsedStr["RN"];
            result.productName = parsedStr["X1"];
            result.price       = parsedStr["TA"];
            result.group       = "1";
            result.qty         = "1";
            result.tva         = "0";
            result.ticket      = Convert.ToInt32(parsedStr["P#"]);

            return(result);
        }
Ejemplo n.º 3
0
 public abstract string MakeBillingString(InvoiceObject obj);
Ejemplo n.º 4
0
 public override string MakeBillingString(InvoiceObject obj)
 {
     return($"{STX}{BuildBillingString(obj)}{ETX}");
 }