public override void Engage(int keyValue) { //Check if employee role is authorized to this event if (!PosContext.Instance.Employee.RolesEventNames.Contains("ChangePrice")) { PosError posError = new PosError(PosErrorCode.INSUFFICIENT_USER_AUTHORITY); posError.Engage(0); return; } EjPriceOverride ejPriceOverride = new EjPriceOverride(); ejPriceOverride.States().PushState((int)EjPriceOverride.ENTER_LINE_NUMBER); PosEventStack.Instance.PushEvent(ejPriceOverride); PosEventStack.Instance.NextEvent(); }
public void Update(EjPriceOverride pEvent) { prompt = PosContext.Instance.PosPrompt; if (prompt != null) { prompt.PromptText = pEvent.PromptText; if (pEvent.States().PeekState() == EjPriceOverride.GET_LINE_NUMBER) { // prompt.InputText = PosContext.Instance.CurrentEjItem.LineNo.ToString(); // PosContext.Instance.InputLine = PosContext.Instance.CurrentEjItem.LineNo.ToString(); prompt.InputText = PosContext.Instance.Receipt.OperDisplay.GetCurrentLineNo.ToString(); // PosContext.Instance.CurrentEjItem.LineNo.ToString(); PosContext.Instance.InputLine = PosContext.Instance.Receipt.OperDisplay.GetCurrentLineNo.ToString(); //PosContext.Instance.CurrentEjItem.LineNo.ToString(); prompt.StartInputAnimation(); } } }
void invoiceListView_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (PosEventStack.Instance.CurrentEvent is ItemVoid) { ItemVoid itemVoid = PosEventStack.Instance.CurrentEvent as ItemVoid; if (itemVoid.States().PeekState() == ItemVoid.GET_LINE_NUMBER) { try { InvoiceLineInfo lineInfo = _colView.CurrentItem as InvoiceLineInfo; PosContext.Instance.ClearInput(); NumKey numKey = new NumKey(); numKey.Engage(lineInfo.LineNumber); } catch { } } } if (PosEventStack.Instance.CurrentEvent is EjPriceOverride) { EjPriceOverride ejPO = PosEventStack.Instance.CurrentEvent as EjPriceOverride; if (ejPO.States().PeekState() == EjPriceOverride.GET_LINE_NUMBER) { try { InvoiceLineInfo lineInfo = _colView.CurrentItem as InvoiceLineInfo; PosContext.Instance.ClearInput(); NumKey numKey = new NumKey(); numKey.Engage(lineInfo.LineNumber); } catch { } } } if (PosEventStack.Instance.CurrentEvent is ChangeQuantity) { ChangeQuantity chQty = PosEventStack.Instance.CurrentEvent as ChangeQuantity; if (chQty.States().PeekState() == ChangeQuantity.GET_LINE_NUMBER) { try { InvoiceLineInfo lineInfo = _colView.CurrentItem as InvoiceLineInfo; PosContext.Instance.ClearInput(); NumKey numKey = new NumKey(); numKey.Engage(lineInfo.LineNumber); } catch { } } } if (PosEventStack.Instance.CurrentEvent is RemoveSalesPerson) { RemoveSalesPerson rSalesPerson = PosEventStack.Instance.CurrentEvent as RemoveSalesPerson; if (rSalesPerson.States().PeekState() == RemoveSalesPerson.GET_SALES_PERSON) { try { InvoiceLineInfo lineInfo = _colView.CurrentItem as InvoiceLineInfo; PosContext.Instance.ClearInput(); PosContext.Instance.InputLine = lineInfo.Employee_no; PosEventStack.Instance.NextEvent(); } catch { } } } }