public void Update(EjCustomer pEvent) { prompt = PosContext.Instance.PosPrompt; if (prompt != null) { prompt.PromptText = pEvent.PromptText; } }
private bool LoadEj(int transNo) { //PrintJobQueue.Instance.Clear(); Transaction trans = new Transaction(transNo); trans.Organization_no = PosSettings.Default.Organization; trans.Store_no = PosSettings.Default.Store; trans.Pos_no = PosSettings.Default.Station; // trans.State = (int)Transaction.Status.SUSPEND; trans.Load(); if (trans.Trans_no != 0) { // was this a suspended transaction? PosContext.Instance.CurrentEj = Ej.GetSuspendedEj(trans); PosContext.Instance.TransactionType = trans.Trans_type; PosContext.Instance.TableName = trans.Table_name; if (PosContext.Instance.CurrentEj.EjArrayList.Count > 0) { // finally make sure there are records PosContext.Instance.TableName = trans.Table_name; PosContext.Instance.TrxNo = trans.Trans_no; trans.State = (int)Transaction.Status.IN_PROGRESS; foreach (Object obj in PosContext.Instance.CurrentEj.EjArrayList) { EjLine line = (EjLine)obj; if (line is EjPromotion) { EjPromotion ejPromo = line as EjPromotion; if (ejPromo.LineType == (int)EjPromotionTypes.WHOLE_ORDER) { PosContext.Instance.SaleMode = ejPromo.Promotion; } } PosContext.Instance.Receipt.Update(line); } } if (trans.Customer_tax_id.Length > 0) { EclipsePos.Data.Customer cus = new EclipsePos.Data.Customer(); cus.Organization_no = PosSettings.Default.Organization; cus.Tax_id = trans.Customer_tax_id; cus.LoadByTaxID(); EjCustomer ejCus = new EjCustomer(cus); PosContext.Instance.Receipt.Update(ejCus); PosContext.Instance.EjCustomer = ejCus; } return(true); } else { return(false); } }
public override void Engage(int keyValue) { //Check if employee role is authorized to this event if (!PosContext.Instance.Employee.RolesEventNames.Contains("Recall")) { PosError posError = new PosError(PosErrorCode.INSUFFICIENT_USER_AUTHORITY); posError.Engage(0); return; } switch (this.States().PeekState()) { case RECALL: // Tried to recall in a middle of a dialog if (PosContext.Instance.CurrentEj != null && PosContext.Instance.CurrentEj.SeqNo > 0) { PosEventStack.Instance.PushEvent(new PosError(PosErrorCode.ERROR_EVENT)); PosEventStack.Instance.NextEvent(); return; } PosEventStack.Instance.LoadDialog("RecallEj"); this.PopState(); this.PushState(RecallEj.ENTER_TRANS_NO); PosEventStack.Instance.NextEvent(); break; case ENTER_TRANS_NO: PosContext.Instance.ClearInput(); this.PromptText = PosContext.Instance.Parameters.getParam("PromptTransNo"); PosContext.Instance.Operprompt.Update(this); this.PopState(); this.PushState(GET_TRANS_NO); break; case ENTER_POS_NO: PosContext.Instance.ClearInput(); this.PromptText = PosContext.Instance.Parameters.getParam("PromptPosNo"); PosContext.Instance.Operprompt.Update(this); this.PopState(); this.PushState(GET_POS_NO); break; case GET_TRANS_NO: this.trxno = PosContext.Instance.Input(); PosContext.Instance.ClearInput(); PosContext.Instance.Operprompt.Clear(); this.PopState(); PosEventStack.Instance.NextEvent(); break; case GET_POS_NO: this.PosNo = PosContext.Instance.Input(); PosContext.Instance.ClearInput(); this.PopState(); PosContext.Instance.Operprompt.Clear(); PosEventStack.Instance.NextEvent(); break; case COMPLETE_RECALL: PosContext.Instance.ClearInput(); trans = new Transaction(this.trxno); trans.Pos_no = this.PosNo; trans.Organization_no = PosSettings.Default.Organization; trans.Store_no = PosContext.Instance.RetailStore.Retail_store_no; trans.Load(); // if (trans.State == (int)Transaction.Status.SUSPEND) // { // was this a suspended transaction? PosContext.Instance.CurrentEj = Ej.GetSuspendedEj(trans); if (PosContext.Instance.CurrentEj.EjArrayList.Count > 0) { // finally make sure there are records if (trans.State == (int)Transaction.Status.SUSPEND) { trans.State = (int)Transaction.Status.IN_PROGRESS; } foreach (Object obj in PosContext.Instance.CurrentEj.EjArrayList) { EjLine line = (EjLine)obj; PosContext.Instance.Receipt.Update(line); } this.States().Clear(); } // } PosContext.Instance.TrxNo = this.TrxNo; /* ES01-26/11/08 */ this.PromptText = PosContext.Instance.Parameters.getParam("RegOpen"); PosContext.Instance.Operprompt.Update(this); PosContext.Instance.Receipt.Update(this); if (trans.Customer_tax_id.Length > 0) { EclipsePos.Data.Customer cus = new EclipsePos.Data.Customer(); cus.Organization_no = PosSettings.Default.Organization; cus.Tax_id = trans.Customer_tax_id; cus.LoadByTaxID(); EjCustomer ejCus = new EjCustomer(cus); PosContext.Instance.Receipt.Update(ejCus); PosContext.Instance.EjCustomer = ejCus; } this.States().Clear(); PosEventStack.Instance.ClearPending(); //Clear transaction if complete if (trans.State == (int)Transaction.Status.COMPLETE) { PosEventStack.Instance.PushEvent(new FinishTransaction()); } break; } }
public override void Engage(int keyValue) { //Check if employee role is authorized to this event if (!PosContext.Instance.Employee.RolesEventNames.Contains("MergeOrder")) { PosError posError = new PosError(PosErrorCode.INSUFFICIENT_USER_AUTHORITY); posError.Engage(0); return; } //Merger to current order if (PosContext.Instance.CurrentEj == null || PosContext.Instance.CurrentEj.SeqNo == 0) { PosError posError = new PosError(PosErrorCode.ERROR_EVENT); posError.Engage(0); return; } switch (this.States().PeekState()) { case MERGE: PosContext.Instance.CurrentPosDisplay.LoadOpenOrdersList(); this.PopState(); this.PushState(ENTER_TRANS_NO); PosEventStack.Instance.NextEvent(); break; case ENTER_TRANS_NO: PosContext.Instance.ClearInput(); this.PromptText = PosContext.Instance.Parameters.getParam("PromptTransNo"); PosContext.Instance.Operprompt.Update(this); this.PopState(); this.PushState(GET_TRANS_NO); break; case GET_TRANS_NO: this.trxno = PosContext.Instance.Input(); PosContext.Instance.ClearInput(); PosContext.Instance.Operprompt.Clear(); this.PopState(); this.PushState(COMPLETE_MERGE); PosEventStack.Instance.NextEvent(); break; case COMPLETE_MERGE: PosContext.Instance.ClearInput(); trans = new Transaction(this.trxno); trans.Pos_no = PosSettings.Default.Station; trans.Organization_no = PosSettings.Default.Organization; trans.Store_no = PosSettings.Default.Store; trans.Load(); if (trans.State == (int)Transaction.Status.SUSPEND) { // was this a suspended transaction? Ej ejFrom = Ej.GetSuspendedEj(trans); if (ejFrom.EjArrayList.Count > 0) { // finally make sure there are records // trans.State = (int)Transaction.Status.IN_PROGRESS; foreach (Object obj in ejFrom.EjArrayList) { EjLine line = (EjLine)obj; ProcessEjLine(line); } // context ().homeGuis (); // context ().eventStack ().setEvent (new FirstItem (context ())); this.States().Clear(); // PosEventStack.Instance.NextEvent(); } // ejFrom.Complete((int)Transaction.Status.VOIDED); this.VoidEj(ejFrom); } if (trans.Customer_tax_id.Length > 0) { EclipsePos.Data.Customer cus = new EclipsePos.Data.Customer(); cus.Organization_no = PosSettings.Default.Organization; cus.Tax_id = trans.Customer_tax_id; cus.LoadByTaxID(); EjCustomer ejCus = new EjCustomer(cus); PosContext.Instance.Receipt.Update(ejCus); PosContext.Instance.EjCustomer = ejCus; } this.States().Clear(); // PosEventStack.Instance.ClearPending(); PosContext.Instance.HomeGUI(); PosEventStack.Instance.NextEvent(); break; } }
public override void Engage(int keyValue) { //Check if employee role is authorized to this event if (!PosContext.Instance.Employee.RolesEventNames.Contains("Recall")) { PosError posError = new PosError(PosErrorCode.INSUFFICIENT_USER_AUTHORITY); posError.Engage(0); return; } try { if (PosContext.Instance.CurrentEj.SeqNo > 0) { PosError posError = new PosError(PosErrorCode.RECALL_FAILLED); posError.Engage(0); return; } } catch (Exception ex) { } PosContext.Instance.ClearInput(); trans = new Transaction(this.trxno); trans.Pos_no = this.PosNo; trans.Organization_no = PosSettings.Default.Organization; trans.Store_no = PosContext.Instance.RetailStore.Retail_store_no; trans.Load(); PosContext.Instance.CurrentEj = Ej.GetSuspendedEj(trans); if (PosContext.Instance.CurrentEj.EjArrayList.Count > 0) { // finally make sure there are records foreach (Object obj in PosContext.Instance.CurrentEj.EjArrayList) { EjLine line = (EjLine)obj; PosContext.Instance.Receipt.Update(line); } this.States().Clear(); } PosContext.Instance.TrxNo = this.TrxNo; /* ES01-26/11/08 */ this.PromptText = PosContext.Instance.Parameters.getParam("RegOpen"); //PosContext.Instance.Operprompt.Update(this); PosContext.Instance.Receipt.Update(this); if (trans.Customer_tax_id.Length > 0) { EclipsePos.Data.Customer cus = new EclipsePos.Data.Customer(); cus.Organization_no = PosSettings.Default.Organization; cus.Tax_id = trans.Customer_tax_id; cus.LoadByTaxID(); EjCustomer ejCus = new EjCustomer(cus); PosContext.Instance.Receipt.Update(ejCus); PosContext.Instance.EjCustomer = ejCus; } this.States().Clear(); PosEventStack.Instance.ClearPending(); //Clear transaction if complete if ((trans.State == (int)Transaction.Status.COMPLETE) || (trans.State == (int)Transaction.Status.VOIDED)) { PosEventStack.Instance.PushEvent(new FinishTransaction()); } }