private static object SendOpsCommandCallback(object[] data_) { OpsCommand opsCmd = (OpsCommand)data_[0]; mOpsContext.ProcessCommand(opsCmd); return(null); }
private void AddTender(long tnObjNum_, decimal?amount_ = null, string reference = null) { //LAB ARG {es-AR}: para los medios de pago se utiliza la de sistema (",") NumberFormatInfo nfi = System.Globalization.CultureInfo.CurrentCulture.NumberFormat; if (ConfigMgr.Instance.UseSimphonyDecimalSeparatorForTenders) { nfi = new NumberFormatInfo() { CurrencyDecimalSeparator = OpsContext.CurrentDecimalSeparator, CurrencyGroupSeparator = "", CurrencyGroupSizes = new int[] { 0 }, NumberDecimalSeparator = OpsContext.CurrentDecimalSeparator, NumberGroupSeparator = "", NumberGroupSizes = new int[] { 0 }, }; } List <OpsCommand> addTenderMacro = new List <OpsCommand>(); if (amount_ != null) { addTenderMacro.Add(new OpsCommand(OpsCommandType.Payment) { Number = tnObjNum_, Arguments = "Cash:Cash $ " + ((decimal)amount_).ToString("N", nfi) }); } else { addTenderMacro.Add(new OpsCommand(OpsCommandType.Payment) { Number = tnObjNum_, Arguments = "Cash:Cash * " }); } if (reference != null) { addTenderMacro.Add(new OpsCommand(OpsCommandType.AsciiData) { Text = reference }); addTenderMacro.Add(new OpsCommand(OpsCommandType.EnterKey)); } OpsCommand opsCmd = new OpsCommand(OpsCommandType.Macro) { Data = addTenderMacro }; OpsCommandMgr.SendOpsCommand(OpsContext, opsCmd, () => { return(OpsContext.CheckIsOpen); }); Thread.Sleep(100); }
public static void SendOpsCommand(OpsContext opsContext_, OpsCommand cmd_, Func <bool> waitCondition_) { mOpsContext = opsContext_; new Thread(() => SendOpsCommandThread(new object[] { cmd_ }, waitCondition_)) { Name = "SEND OPS COMMAND THREAD" }.Start(); /* * we use lambda notation because in .NETCF there is no ParametrizedThreadStart support. * This way we can pass any arguments in a similar way */ }
private void TransactionCancel() { List <OpsCommand> transactionCancelMacro = new List <OpsCommand>() { new OpsCommand(OpsCommandType.TransactionCancel) { }, new OpsCommand(OpsCommandType.EnterKey), }; OpsCommand opsCmd = new OpsCommand(OpsCommandType.Macro) { Data = transactionCancelMacro }; OpsCommandMgr.SendOpsCommand(OpsContext, opsCmd, () => { return(true); }); }