예제 #1
0
        public SendResult Send()
        {
            int month = WideStringToInt(m.TextBoxes[(int)InputControlTextBox.Month]);
            int day   = WideStringToInt(m.TextBoxes[(int)InputControlTextBox.Day]);

            CustomersInfo customer = new CustomersInfo(
                WideStringToInt(m.TextBoxes[(int)InputControlTextBox.Adult]),
                0,
                WideStringToInt(m.TextBoxes[(int)InputControlTextBox.Child]),
                0);

            SendResult result = Connector.SendPlatformTicket(month, day, customer, Pay.Cash());

            return(result);
        }
예제 #2
0
        public SendResult Send()
        {
            string value = m.TextBoxes[(int)InputControlTextBox.Service];
            Game   game  = value switch
            {
                "トレインシミュレーター" => Game.TrainSimulator,
                "模型体験運転" => Game.ModelTrainDriving,
                _ => (Game)WideStringToInt(value),
            };

            int timeCode = WideStringToInt(m.TextBoxes[(int)InputControlTextBox.Number]);

            CustomersInfo customer = new CustomersInfo(
                WideStringToInt(m.TextBoxes[(int)InputControlTextBox.Adult]),
                WideStringToInt(m.TextBoxes[(int)InputControlTextBox.Student]),
                WideStringToInt(m.TextBoxes[(int)InputControlTextBox.Child]),
                WideStringToInt(m.TextBoxes[(int)InputControlTextBox.Preschooler]));

            Discount discount = m.Options.Any(p => p is Discount) ? (Discount)m.Options.First(p => p is Discount) : Discount.None;

            SendResult result = Connector.Reserve(game, timeCode, customer, Pay.Cash(), discount, m.Options.Where(p => p is Option).Select(p => (Option)p));

            return(result);
        }