示例#1
0
        public override void Execute()
        {
            int max  = Ticket.Lines();
            int line = LimitedIntDialog.Instance().Read("Línea? ", max);

            Ticket.Add(new RepetitionLine(line));
        }
示例#2
0
        public override void Execute()
        {
            int id    = LimitedIntDialog.Instance().Read("Código", 1000);
            int units = LimitedIntDialog.Instance().Read("Unidades", 1000);

            Ticket.Add(new SaleLine(id, units));
        }
示例#3
0
        public virtual void Manage()
        {
            int option;

            do
            {
                this.ShowStore();
                option = this.ExecuteMenu();
                if (option != 3)
                {
                    int code   = LimitedIntDialog.Instance().Read("Código? ", 100);
                    int amount = LimitedIntDialog.Instance().Read("Cantidad? ", 100);
                    switch (option)
                    {
                    case 1:
                        store.Add(code, amount);
                        break;

                    case 2:
                        if (store.Exist(code, amount))
                        {
                            store.Remove(code, amount);
                        }
                        else
                        {
                            IO.Instance().Writeln("Error!!! No hay existencias");
                        }
                        break;
                    }
                }
            } while (option != 3);
        }
示例#4
0
        private int ExecuteMenu()
        {
            IO.Instance().Writeln("1. Alta de producto");
            IO.Instance().Writeln("2. Baja de producto");
            IO.Instance().Writeln("3. Salir");
            int option = LimitedIntDialog.Instance().Read("Opción? ", 3);

            return(option);
        }
示例#5
0
 private int GetOption()
 {
     return(LimitedIntDialog.Instance()
            .Read("Opción", 1, commands.Count()) - 1);
 }