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); }
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); }
public abstract string MakeBillingString(InvoiceObject obj);
public override string MakeBillingString(InvoiceObject obj) { return($"{STX}{BuildBillingString(obj)}{ETX}"); }