public static MenuList CreateBarcodeMenu() { MenuList menuHeaders = new MenuList(); int index = 1; if (!cr.HasEJ) { return(menuHeaders); } if (cr.Printer.IsFiscal) { menuHeaders.Add(new MenuLabel(String.Format("BELGE BARKOD {0,2}\n{1}", index++, PosMessage.PRINT_RECEIPT_COPY))); } if (cr.IsDesktopWindows) { if (cr.IsAuthorisedFor(Authorizations.VoidDocument)) { menuHeaders.Add(new MenuLabel(String.Format("BELGE BARKOD {0,2}\n{1}", index++, PosMessage.RETURN_RECEIPT))); menuHeaders.Add(new MenuLabel(String.Format("BELGE BARKOD {0,2}\n{1}", index++, PosMessage.RETURN_PRODUCT))); } menuHeaders.Add(new MenuLabel(String.Format("BELGE BARKOD {0,2}\n{1}", index++, PosMessage.REPEAT_SALE))); } return(menuHeaders); }
private static IState EftPosMenu() { MenuList eftMenu = new MenuList(); string label = ""; int i = 1; string labelFormat = "{0}\t{1}\n{2}"; if (cr.IsAuthorisedFor(Authorizations.EFTVoidAndRefundAuth)) { label = String.Format(labelFormat, PosMessage.EFT_POS_OPERATIONS, i++, PosMessage.VOID); eftMenu.Add(new MenuLabel(label)); label = String.Format(labelFormat, PosMessage.EFT_POS_OPERATIONS, i++, PosMessage.RETURN_DOCUMENT_TR); eftMenu.Add(new MenuLabel(label)); } label = String.Format(labelFormat, PosMessage.EFT_POS_OPERATIONS, i++, PosMessage.EFT_SLIP_COPY); eftMenu.Add(new MenuLabel(label)); label = String.Format(labelFormat, PosMessage.EFT_POS_OPERATIONS, i++, PosMessage.LAST_OPERATION); eftMenu.Add(new MenuLabel(label)); return(List.Instance(eftMenu, EftOperation, Continue)); }
/// <summary> /// Instance of CustomerInfo. /// Like a command menu. /// Shows list of Customer menu istems. /// </summary> /// <returns>CustomerInfo state.</returns> public static new IState Instance() { cr.SecurityConnector.CustomerCaptured += new EventHandler(SecurityConnector_CustomerCaptured); MenuList menuHeaders = new MenuList(); if (cr.Document is Receipt) { menuHeaders.Add(new MenuLabel(PosMessage.ENTER_CADR_CODE)); } if (cr.Document is Invoice || cr.Document is EInvoice || cr.Document is EArchive || cr.Document is Advance || cr.Document is CurrentAccountDocument || cr.Document is SelfEmployementInvoice) { menuHeaders.Add(new MenuLabel(PosMessage.ENTER_TCKN_VKN_MENU)); } if (cr.DataConnector.CurrentSettings.GetProgramOption(Setting.CustomerSearch) == 0) { menuHeaders.Add(new MenuLabel(PosMessage.SEARCH_RECORD)); menuHeaders.Add(new MenuLabel(PosMessage.NEW_RECORD)); } menuHeaders.Add(new MenuLabel(PosMessage.RETURN_TO_SELLING)); List.Instance(menuHeaders); return(state); //Musteri ile ilgili yapilacak islemer menusunu gosterir }
public static IState EnterCustomerGroup(String customerGroup) { customerGroup = customerGroup.Trim(); if (customerGroup.Length > 0 && customerGroup.Length != 6) { AlertCashier.Instance(new Confirm("MÜÞTERÝ GRUBU\nALTI KARAKTER OLMALI", new StateInstance(ErrorCustomerGroup), new StateInstance(ErrorCustomerGroup))); } customerInput.Append(customerGroup.PadLeft(6, ' ')); MenuList docTypeList = new MenuList(); String label = ""; int i = 1; string labelFormat = "{0}\t{1}\n{2}"; label = String.Format(labelFormat, PosMessage.DEFAULT_DOCUMENT_TYPE, i++, PosMessage.RECEIPT_TR); docTypeList.Add(new MenuLabel(label)); label = String.Format(labelFormat, PosMessage.DEFAULT_DOCUMENT_TYPE, i++, PosMessage.INVOICE); docTypeList.Add(new MenuLabel(label)); label = String.Format(labelFormat, PosMessage.DEFAULT_DOCUMENT_TYPE, i++, PosMessage.E_ARCHIVE); docTypeList.Add(new MenuLabel(label)); label = String.Format(labelFormat, PosMessage.DEFAULT_DOCUMENT_TYPE, i++, PosMessage.E_INVOICE); docTypeList.Add(new MenuLabel(label)); return(States.List.Instance(docTypeList, EnterDefaultDocumentCode, SaveCustomerInput)); }
public override void Command() { MenuList commandMenu = new MenuList(); commandMenu.Clear(); int index = 1; if (cr.IsAuthorisedFor(Authorizations.VoidDocument) || !DisplayAdapter.Both.HasAttribute(DisplayAttribute.CashierKey)) { commandMenu.Add(CommandMenu.AddLabel(index++, PosMessage.VOID_DOCUMENT)); if (cr.Document is Receipt && cr.Printer.CanPrint(cr.Document)) { commandMenu.Add(CommandMenu.AddLabel(index++, PosMessage.SUSPEND_DOCUMENT)); } } if ((cr.Document is Receipt) && cr.Printer.CanPrint(new Invoice())) { commandMenu.Add(CommandMenu.AddLabel(index++, PosMessage.TRANSFER_DOCUMENT)); } if (cr.DataConnector.CurrentSettings.GetProgramOption(Setting.AssingCustomerInSelling) == PosConfiguration.ON) { commandMenu.Add(CommandMenu.AddLabel(index++, PosMessage.CUSTOMER_ENTRY)); } cr.State = CommandMenu.Instance(commandMenu); }
private static IState TransferDocument() { MenuList toTransferDocsMenu = new MenuList(); String label = ""; SalesDocument sDoc; int i = 1; string labelFormat = "{0}\n{1}-{2}"; label = String.Format(labelFormat, PosMessage.SELECT_DOCUMENT, i++, PosMessage.INVOICE); sDoc = new Invoice(cr.Document); toTransferDocsMenu.Add(new MenuLabel(label, sDoc)); label = String.Format(labelFormat, PosMessage.SELECT_DOCUMENT, i++, PosMessage.E_INVOICE); sDoc = new EInvoice(cr.Document); toTransferDocsMenu.Add(new MenuLabel(label, sDoc)); label = String.Format(labelFormat, PosMessage.SELECT_DOCUMENT, i++, PosMessage.E_ARCHIVE); sDoc = new EArchive(cr.Document); toTransferDocsMenu.Add(new MenuLabel(label, sDoc)); label = String.Format(labelFormat, PosMessage.SELECT_DOCUMENT, i++, PosMessage.MEAL_TICKET); sDoc = new MealTicket(cr.Document); toTransferDocsMenu.Add(new MenuLabel(label, sDoc)); return(List.Instance(toTransferDocsMenu, TransferToChoosenDoc, Continue)); }
public override void Command() { if (cr.Document.Payments.Count > 0) { throw new InvalidOperationException(); } else { MenuList commandMenu = new MenuList(); int index = 1; commandMenu.Clear(); { if (cr.IsAuthorisedFor(Authorizations.VoidDocument)) { commandMenu.Add(CommandMenu.AddLabel(index++, PosMessage.VOID_DOCUMENT)); if (cr.Document is Receipt && cr.Printer.CanPrint(cr.Document)) { commandMenu.Add(CommandMenu.AddLabel(index++, PosMessage.SUSPEND_DOCUMENT)); } } } cr.State = CommandMenu.Instance(commandMenu); } }
private Area Lights() { var list = new MenuList(renderer, Orientation.Vertical); list.ChildLayoutStyle = Area.AreaLayoutStyle.ExtendHorizontal; list.Add(new Slider(renderer, "Exposure", LightsUniforms.Exposure, 0, 0.0f, 10.0f, 0.0f, 10.0f)); float r = 0.02f; var bias_x = new Slider(renderer, "Bias x", LightsUniforms.Bias, 0, -r, r, -r, r); var bias_y = new Slider(renderer, "Bias y", LightsUniforms.Bias, 1, -r, r, -r, r); var bias_z = new Slider(renderer, "Bias z", LightsUniforms.Bias, 2, -r, r, -r, r); var bias_w = new Slider(renderer, "Bias w", LightsUniforms.Bias, 3, -r, r, -r, r); /*bias_x.IsLogarithmic = true; * bias_y.IsLogarithmic = true; * bias_z.IsLogarithmic = true; * bias_w.IsLogarithmic = true;*/ list.Add(bias_x); list.Add(bias_y); list.Add(bias_z); list.Add(bias_w); for (int i = 0; i < sceneManager.RenderGroup.Lights.Count; ++i) { list.Add( new Slider( renderer, "Radiance " + (i + 1).ToString(), LightsUniforms.Color, 4 * i + 3, 0.0f, 10.0f, 0.0f, 10.0f ) ); } list.Add(new Slider(renderer, "Ambient Red", LightsUniforms.AmbientLightColor, 0, 0.0f, 4.0f, 0.0f, 4.0f)); list.Add(new Slider(renderer, "Ambient Green", LightsUniforms.AmbientLightColor, 1, 0.0f, 4.0f, 0.0f, 4.0f)); list.Add(new Slider(renderer, "Ambient Blue", LightsUniforms.AmbientLightColor, 2, 0.0f, 4.0f, 0.0f, 4.0f)); if (Configuration.stereo) { Choice choice = new Choice(Orientation.Horizontal); choice.Name = "Config"; choice.Style = Style.NullPadding; var ao = choice.Add(new ChoiceItem(renderer, "AO")); var basic = choice.Add(new ChoiceItem(renderer, "Basic")); choice.Action = LightConfigAction; if (CurrentLightConfig == "AO") { choice.Selected = ao; } if (CurrentLightConfig == "Basic") { choice.Selected = basic; } list.Add(choice); } var expand = new Button(renderer, "lights", SetActive); expand.Link = list; return(expand); }
public override void Command() { MenuList commandMenu = new MenuList(); commandMenu.Clear(); int index = 1; if (cr.IsDesktopWindows) { commandMenu.Add(CommandMenu.AddLabel(index++, PosMessage.REPEAT_DOCUMENT)); } commandMenu.Add(CommandMenu.AddLabel(index++, PosMessage.RESUME_DOCUMENT)); commandMenu.Add(CommandMenu.AddLabel(index++, PosMessage.CUSTOMER_ENTRY)); commandMenu.Add(CommandMenu.AddLabel(index++, PosMessage.EFT_POS_OPERATIONS)); if (cr.IsDesktopWindows) { //commandMenu.Add(CommandMenu.AddLabel(index++, PosMessage.FAST_PAYMENT)); commandMenu.Add(CommandMenu.AddLabel(index++, PosMessage.TABLE_MANAGEMENT)); commandMenu.Add(CommandMenu.AddLabel(index++, PosMessage.ENTER_CASH)); commandMenu.Add(CommandMenu.AddLabel(index++, PosMessage.RECEIVE_CASH)); //commandMenu.Add(CommandMenu.AddLabel(index++, PosMessage.RECEIVE_CHECK)); //commandMenu.Add(CommandMenu.AddLabel(index++, PosMessage.RECEIVE_CREDIT)); commandMenu.Add(CommandMenu.AddLabel(index++, PosMessage.COMMAND_CALCULATOR)); commandMenu.Add(CommandMenu.AddLabel(index++, PosMessage.TALLYING)); } cr.State = CommandMenu.Instance(commandMenu); DisplayAdapter.Customer.Show(PosMessage.WELCOME); }
private void SetArea(string key) { try { MenuList.Clear(); for (int i = 0; i < 3; i++) { var menu = new MenuMap5FModel(); if (Convert.ToString(i) == key) { menu.ButtonShow = true; } else { menu.ButtonShow = false; } MenuList.Add(menu); } } catch (Exception e) { WriteLog.WriteLogger(e.ToString()); } }
private AssociationContextMenu() { mnuUnidirectional = new ToolStripMenuItem(Strings.MenuUnidirectional, Resources.Unidirectional, mnuUnidirectional_Click); mnuBidirectional = new ToolStripMenuItem(Strings.MenuBidirectional, Resources.Bidirectional, mnuBidirectional_Click); mnuDirection = new ToolStripMenuItem(Strings.MenuDirection, null, mnuUnidirectional, mnuBidirectional); mnuAssociation = new ToolStripMenuItem(Strings.MenuAssociation, Resources.Association, mnuAssociation_Click); mnuComposition = new ToolStripMenuItem(Strings.MenuComposition, Resources.Composition, mnuComposition_Click); mnuAggregation = new ToolStripMenuItem(Strings.MenuAggregation, Resources.Aggregation, mnuAggregation_Click); mnuType = new ToolStripMenuItem(Strings.MenuType, null, mnuAssociation, mnuComposition, mnuAggregation); mnuReverse = new ToolStripMenuItem(Strings.MenuReverse, null, mnuReverse_Click); mnuEdit = new ToolStripMenuItem(Strings.MenuEditAssociation, Resources.Property, mnuEdit_Click); MenuList.AddRange(ConnectionContextMenu.Default.MenuItems); MenuList.InsertRange(7, new ToolStripItem[] { mnuDirection, mnuType, mnuReverse, new ToolStripSeparator(), }); MenuList.Add(mnuEdit); UpdateTexts(); }
private async Task <ModuleAction> AddMenuAsync(string menuText) { MenuActionInfo menuInfo = await GetMenuActionAsync(menuText); menuText = menuInfo.MenuText; ModuleAction menuEntry = menuInfo.Action; ModuleAction parentAction = FindAction(_SiteMenu, menuText); if (parentAction != null) { if (parentAction.SubMenu == null) { parentAction.SubMenu = new SerializableList <ModuleAction>() { menuEntry } } ; else { parentAction.SubMenu.Add(menuEntry); } } else { _SiteMenu.Add(menuEntry); } return(menuEntry); }
private void LoadMenu() { MenuList.Add(new MenuItem() { Icon = "\uf0e4", Title = "Dashboard", PageName = MasterModule.GetMasterNavigationPage(PageRoutes.GetKey <DashBoardPage>()) }); MenuList.Add(new MenuItem() { Icon = "\uf073", Title = "Timesheet", PageName = MasterModule.GetMasterNavigationPage(PageRoutes.GetKey <TimesheetPage>()) }); MenuList.Add(new MenuItem() { Icon = "\uf06e", Title = "Review", PageName = MasterModule.GetMasterNavigationPage(PageRoutes.GetKey <ReviewPage>()) }); MenuList.Add(new MenuItem() { Icon = "\uf085", Title = "Configuration", PageName = MasterModule.GetMasterNavigationPage(PageRoutes.GetKey <ConfigurationPage>()) }); }
private static void LoadMenu() { MenuList menuHeaders = new MenuList(); int index = 1; displayingReport = cr.Printer.GetReports(ejOnly); foreach (IReport report in displayingReport.Subreports) { if (ejOnly || cr.CurrentCashier.AuthorizationLevel >= report.Authorization || cr.RegisterAuthorizationLevel >= report.Authorization) { menuHeaders.Add(new MenuLabel(String.Format("{0}\t{1,2}\n{2}", PosMessage.REPORT, index++, report.Name))); } } if (menuHeaders.IsEmpty) { if (displayingReport.Subreports.Count > 0) { throw new CashierAutorizeException(); } else { throw new Exception(PosMessage.NO_SUPPORTED_REPORT); } } List.Instance(menuHeaders); //:to do: think EJ_LIMIT_SETTING //menuHeaders.Add(new MenuLabel(String.Format("RAPOR {0,2}\n{1}", index++, PosMessage.EJ_LIMIT_SETTING))); }
private static IState OpenTables() { countToSellingState = 0; MenuList tableDocsMenu = new MenuList(); String label = ""; DisplayAdapter.Customer.ClearTableContent(); List <DocumentFileHelper> tableDocuments = new List <DocumentFileHelper>(DocumentFileHelper.GetOpenTables()); foreach (DocumentFileHelper helper in tableDocuments) { if (helper.FileInfo.Name.IndexOf("MASA10") > -1) { label = "{0}:{1:D3}\t{2:dd/MM/yy}\n{3}\t{4}"; label = String.Format(label, PosMessage.TABLE_NUMBER, helper.Id, helper.CreationTime, PosMessage.TOTAL, 0); } else { SalesDocument salesDocument = helper.LoadDocument(); label = "{0}:{1:D3}\t{2:dd/MM/yy}\n{3}\t{4}"; label = String.Format(label, PosMessage.TABLE_NUMBER, helper.Id, helper.CreationTime, PosMessage.TOTAL, salesDocument.TotalAmount); } tableDocsMenu.Add(new MenuLabel(label, helper)); } return(List.Instance(tableDocsMenu, ShowTableOnDisp, Continue)); }
private void InitMenuItems() { mnuAddNewElement = new ToolStripMenuItem(Strings.MenuNew, Resources.NewElement); mnuNewPackage = new ToolStripMenuItem(Strings.MenuPackage, Resources.Package, mnuNewPackage_Click); mnuNewClass = new ToolStripMenuItem(Strings.MenuClass, Resources.Class, mnuNewClass_Click); mnuNewStructure = new ToolStripMenuItem(Strings.MenuStruct, Resources.Structure, mnuNewStructure_Click); mnuNewInterface = new ToolStripMenuItem(Strings.MenuInterface, Resources.Interface32, mnuNewInterface_Click); mnuNewEnum = new ToolStripMenuItem(Strings.MenuEnum, Resources.Enum, mnuNewEnum_Click); mnuNewDelegate = new ToolStripMenuItem(Strings.MenuDelegate, Resources.Delegate, mnuNewDelegate_Click); mnuNewComment = new ToolStripMenuItem(Strings.MenuComment, Resources.Comment, mnuNewComment_Click); mnuAddNewElement.DropDownItems.AddRange(new ToolStripItem[] { mnuNewPackage, mnuNewClass, mnuNewStructure, mnuNewInterface, mnuNewEnum, mnuNewDelegate, mnuNewComment }); mnuEditPackage = new ToolStripMenuItem( Strings.MenuEditPackage, Resources.EditComment, mnuEditPackage_Click); MenuList.Add(mnuAddNewElement); MenuList.Add(new ToolStripSeparator()); MenuList.AddRange(ShapeContextMenu.Default.MenuItems); MenuList.AddRange(new ToolStripItem[] { new ToolStripSeparator(), mnuEditPackage, }); }
/// <summary> /// - repeats document printed before. /// </summary> /// <returns>State of List.cs</returns> public static IState ResumeDocument() { List <DocumentFileHelper> suspendedDocuments = new List <DocumentFileHelper>(); String format = "BEK" + (cr.PrinterLastZ + 1).ToString().PadLeft(4, '0') + "*." + cr.Id; String[] fileList = Dir.GetFiles(PosConfiguration.ArchivePath, format); foreach (String fileName in fileList) { int receiptId = 0; FileHelper suspendedFile = new FileHelper(fileName); DocumentFileHelper receipt = new DocumentFileHelper(suspendedFile); if (Parser.TryInt(suspendedFile.Name.Substring(7, 4), out receiptId) && suspendedFile.Name.Length > 14) { receipt.Id = receiptId; receipt.ResumedFromDocumentId = receiptId; suspendedDocuments.Add(receipt); } } MenuList suspendedDocsMenu = new MenuList(); foreach (DocumentFileHelper docFileHelper in suspendedDocuments) { suspendedDocsMenu.Add(docFileHelper); } return(List.Instance(suspendedDocsMenu, RepeatDocument)); }
private Menu.MenuItem GetSubMenu(MenuList parent, string[] paths) { if (paths != null && paths.Length > 0) { var subMenu = parent.Where(m => string.Equals(m.path, paths[0], StringComparison.OrdinalIgnoreCase)).FirstOrDefault(); if (subMenu == null) { subMenu = new Menu.MenuItem { path = paths[0] }; parent.Add(subMenu); } if (paths.Length > 2 /*&& !string.Equals(paths[1], "list", StringComparison.OrdinalIgnoreCase)*/) { return(GetSubMenu(subMenu.children, paths.Skip(1).ToArray())); } else { if (paths.Length > 1) { subMenu.path = string.Join("/", paths); } return(subMenu); } } return(null); }
//:to do: function is called by also other classes, so it is static but it may not be here public static void AddMenuLabel(MenuList docTypes, String message, SalesDocument document) { if (cr.Printer.CanPrint(document)) { docTypes.Add(new MenuLabel(message, document)); } }
public static IState OpenOrderByBarcode(string orderBarcode) { MenuList orderDocsMenu = new MenuList(); String label = ""; String cashierId = orderBarcode.Substring(0, 4); int orderId = int.Parse(orderBarcode.Substring(4, 4)); List <DocumentFileHelper> orderDocuments = new List <DocumentFileHelper>(DocumentFileHelper.GetOpenOrders("", true)); foreach (DocumentFileHelper helper in orderDocuments) { if (helper.Cashier.Id == cashierId && helper.Id == orderId) { //SalesDocument doc = helper.LoadDocument(); String cashiername = helper.Cashier.Name; cashiername = cashiername.Substring(0, Math.Min(14, cashiername.Length)); label = "SIP NO:{0:D4}\t{1:dd/MM/yy}\n{2}\t{1:HH:mm}"; label = String.Format(label, helper.Id, helper.CreationTime, cashiername); orderDocsMenu.Add(new MenuLabel(label, helper)); } } if (orderDocsMenu.Count == 0) { return(AlertCashier.Instance(new Confirm(PosMessage.NO_DOCUMENT_FOUND))); } else { return(List.Instance(orderDocsMenu, RepeatDocument)); } }
public static IState ChooseRepeatType() { MenuList searchTypeMenu = new MenuList(); String label = ""; int i = 1; string labelFormat = "{0}\t{1}\n{2}"; label = String.Format(labelFormat, PosMessage.REPEAT_DOCUMENT, i++, "BELGE NO ÝLE"); searchTypeMenu.Add(new MenuLabel(label)); label = String.Format(labelFormat, PosMessage.REPEAT_DOCUMENT, i++, "BARKOD ÝLE"); searchTypeMenu.Add(new MenuLabel(label)); return(List.Instance(searchTypeMenu, GetRepeatType, Continue)); }
private static IState SlipCopySearchType() { MenuList searchTypeMenu = new MenuList(); String label = ""; int i = 1; string labelFormat = "{0}\t{1}\n{2}"; label = String.Format(labelFormat, PosMessage.EFT_SLIP_COPY, i++, "Z NO - FÝÞ NO"); searchTypeMenu.Add(new MenuLabel(label)); label = String.Format(labelFormat, PosMessage.EFT_SLIP_COPY, i++, "BATCH NO - STAN NO"); searchTypeMenu.Add(new MenuLabel(label)); return(List.Instance(searchTypeMenu, GetAcquierId, Continue)); }
public override void Command() { if (cr.IsDesktopWindows) { MenuList menuHeaders = new MenuList(); int index = 1; menuHeaders.Add(new MenuLabel(String.Format("{0}\t{1,2}\n{2}", PosMessage.SYSTEM_MANAGER, index++, PosMessage.SHUTDOWN_POS))); menuHeaders.Add(new MenuLabel(String.Format("{0}\t{1,2}\n{2}", PosMessage.SYSTEM_MANAGER, index++, PosMessage.RESTART_POS))); menuHeaders.Add(new MenuLabel(String.Format("{0}\t{1,2}\n{2}", PosMessage.SYSTEM_MANAGER, index++, PosMessage.SHUTDOWN_SYSTEM))); menuHeaders.Add(new MenuLabel(String.Format("{0}\t{1,2}\n{2}", PosMessage.SYSTEM_MANAGER, index++, PosMessage.RESTART_SYSTEM))); menuHeaders.Add(new MenuLabel(String.Format("{0}\t{1,2}\n{2}", PosMessage.SYSTEM_MANAGER, index++, PosMessage.SOUND_SETTINGS))); menuHeaders.Add(new MenuLabel(String.Format("{0}\t{1,2}\n{2}", PosMessage.SYSTEM_MANAGER, index++, PosMessage.UPDATE_FOLDER))); menuHeaders.Add(new MenuLabel(String.Format("{0}\t{1,2}\n{2}", PosMessage.SYSTEM_MANAGER, index++, PosMessage.UPDATE_ONLINE))); cr.State = States.ListCommandMenu.Instance(menuHeaders, new ProcessSelectedItem <MenuLabel>(SelectSystemMenuAction), new StateInstance(Instance)); } else { cr.State = States.ConfirmCashier.Instance(new Confirm(PosMessage.CONFIRM_RESTART_PROGRAM, new StateInstance(Quit), new StateInstance(Instance))); } }
public void RegisterMenuInfo(IMenuInfo menuInfo) { MenuList.Add(menuInfo); if (menuInfo.IsStartPage) { ApplicationCommands.ChangeScreenCommand.Execute(menuInfo); } }
/// <summary> /// Each customer have some sub menu items. /// For example:Address,TaxNumber etc. /// If user searh customer, may be more than one customer can be found so /// use up and down key to select correct customer. After correct customer selected /// press Enter key to list sub menu items selected customer's. /// So this function used to list sub menu items of selected customer. /// </summary> /// <param name="c"> /// Selected customer. /// </param> /// <returns> /// CustomerInfo State. /// </returns> public static IState SetCardCustomer(ICustomer c) { cr.Document.Customer = c; cr.SecurityConnector.AcceptCustomer(c.Number); try { return(SetCustomerInfo(c)); } catch (MissingCardInfoException) { MenuList menuheaders = new MenuList(); menuheaders.Add(new MenuLabel(String.Format("{0}\n{1}", PosMessage.NAME_FIRM, c.Name))); menuheaders.Add(new MenuLabel(String.Format("{0}\n{1}", PosMessage.CUSTOMER_NUMBER, c.Number))); menuheaders.Add(new MenuLabel(String.Format("{0}\n{1}", PosMessage.CUSTOMER_CODE, c.Code))); List.Instance(menuheaders); return(state); } }
/// <summary> /// Command key function /// used only when FPU slip is active. /// used to void slip while slip is active /// </summary> public override void Command() { MenuList menuHeaders = new MenuList(); menuHeaders.Add(new MenuLabel(PosMessage.VOID_DOCUMENT)); cr.State = List.Instance(menuHeaders, new ProcessSelectedItem(SelectMenu), new StateInstance(Instance)); }
public override void LabelKey(int labelKey) { System.Collections.Generic.List <IProduct> sList = new System.Collections.Generic.List <IProduct>(); if (cr.DataConnector.CurrentSettings.GetProgramOption(Setting.DefineBarcodeLabelKeys) == PosConfiguration.ON) { sList = cr.DataConnector.SearchProductByBarcode(Label.GetLabel(labelKey)); } else { sList = cr.DataConnector.SearchProductByLabel(Label.GetLabel(labelKey)); } if (sList.Count == 0) { cr.State = AlertCashier.Instance(new Error(new ProductNotFoundException())); return; } // Check Printer Status before add label cr.Printer.CheckPrinterStatus(); MenuList itemList = new MenuList(); foreach (IProduct p in sList) { if (cr.Item is VoidItem) { cr.Item = new SalesItem(); } SalesItem si = (SalesItem)cr.Item.Clone(); si.Product = p; if (p.Status == ProductStatus.Weighable && cr.Scale != null) { try { si.Quantity = cr.Scale.GetWeight(p.UnitPrice); } catch (Exception) { } } itemList.Add(si); } if (itemList.Count == 1) { if (itemList.MoveNext()) { cr.Execute(((IDoubleEnumerator)itemList).Current); } } else { cr.State = ListLabel.Instance(itemList, new ProcessSelectedItem <IProduct>(cr.Execute), labelKey); } }
public static IState ShowTaxRatesMenu() { printerTaxRates = cr.Printer.TaxRates; MenuList menuHeaders = new MenuList(); int index = 1; for (index = 1; index <= printerTaxRates.Length; index++) { if (printerTaxRates[index - 1] == decimal.MinusOne) { menuHeaders.Add(new MenuLabel(String.Format("{0}\t{1,2}\n{2}", PosMessage.VAT_RATE, index, "TANIMSIZ"))); } else { menuHeaders.Add(new MenuLabel(String.Format("{0}\t{1,2}\n{2}", PosMessage.VAT_RATE, index, printerTaxRates[index - 1]))); } } // menuHeaders.Add(new MenuLabel(String.Format("{0}\t{1,2}\n{2}", // PosMessage.VAT_RATE, index++, printerTaxRates[index - 2]))); //menuHeaders.Add(new MenuLabel(String.Format("{0}\t{1,2}\n{2}", // PosMessage.VAT_RATE, index++, printerTaxRates[index - 2]))); //menuHeaders.Add(new MenuLabel(String.Format("{0}\t{1,2}\n{2}", // PosMessage.VAT_RATE, index++, printerTaxRates[index - 2]))); //menuHeaders.Add(new MenuLabel(String.Format("{0}\t{1,2}\n{2}", // PosMessage.VAT_RATE, index++, printerTaxRates[index - 2]))); //menuHeaders.Add(new MenuLabel(String.Format("{0}\t{1,2}\n{2}", // PosMessage.VAT_RATE, index++, printerTaxRates[index - 2]))); //menuHeaders.Add(new MenuLabel(String.Format("{0}\t{1,2}\n{2}", // PosMessage.VAT_RATE, index++, printerTaxRates[index - 2]))); //menuHeaders.Add(new MenuLabel(String.Format("{0}\t{1,2}\n{2}", // PosMessage.VAT_RATE, index++, printerTaxRates[index - 2]))); //menuHeaders.Add(new MenuLabel(String.Format("{0}\t{1,2}\n{2}", // PosMessage.VAT_RATE, index++, printerTaxRates[index - 2]))); //List.Instance(menuHeaders); return(ListCommandMenu.Instance(menuHeaders, new ProcessSelectedItem <MenuLabel>(TaxRatesMenuAction), ShowMenu)); //return state; }
public override void OnExit() { //Display knowes application exit from calculator states MenuList menuCalculator = new MenuList(); menuCalculator.Add(PosMessage.EXIT_CALCULATOR); menuCalculator.MoveFirst(); DisplayAdapter.Cashier.Show(menuCalculator); DisplayAdapter.Cashier.Show(null as MenuList); }
public static IState Instance(Number amount) { input = amount; MenuList list = new MenuList(); list.Add(new CheckPaymentInfo()); list.AddRange(CurrencyPaymentInfo.GetCurrencies()); list.AddRange(CreditPaymentInfo.GetCredits()); States.List.Instance(list); return(state); }
public void TestICollectionMembersOnMenuList() { MenuList list = new MenuList(); var item = new MenuItem(); list.Add(item); Assert.IsTrue(list.Contains(item)); list.Remove(item); Assert.IsFalse(list.Contains(item)); list.Add(item); Assert.AreEqual(1, list.Count); list.Clear(); Assert.AreEqual(0, list.Count); MenuItem[] array = new MenuItem[1]; list.Add(item); list.CopyTo(array, 0); Assert.AreEqual(item, array[0]); Assert.IsFalse(list.IsReadOnly); foreach (var menuItem in list) { Assert.AreEqual(item, menuItem); } }