コード例 #1
0
        private void show_option()
        {
            System.Console.WriteLine("Enter option id");
            IOption option = null;

            while (option == null)
            {
                string line = System.Console.ReadLine();
                try
                {
                    option = optionBLL.GetById(int.Parse(line));
                }
                catch (Exception e)
                {
                    System.Console.WriteLine(e.Message);
                }
                if (option != null)
                {
                    string res = "option : " + option.GetName() + "(" + option.GetOptionId() + ")" +
                                 "\nPrice : " + option.GetPrice() + "€" +
                                 "\nLimits : \n    minute : " + option.GetMinuteLimit() +
                                 "\n    sms : " + option.GetSMSLimit();
                    if (option.GetIsAvailable())
                    {
                        res += "\nIs available";
                    }
                    else
                    {
                        res += "\nIsn't available";
                    }
                    System.Console.WriteLine(res);
                }
            }
        }
コード例 #2
0
ファイル: PCBuilder.cs プロジェクト: Fectorez/ComposePC
 private IPCBuilder AddOption(IOption option)
 {
     Options.Add(option);
     OptionsPrice += option.GetPrice();
     return(this);
 }