예제 #1
0
        public static ConnectionPlan getPlanByName(string planName)
        {
            if (!planName.Equals(" ") && Regex.IsMatch(planName, "[a-zA-Z]"))
            {
                switch (planName.ToLower())
                {
                case "platinum":
                    PREMIUM = new ConnectionPlan("PREMIUM", 500, 500, 1500, 269);
                    return(PREMIUM);

                case "gold":
                    STANDARD = new ConnectionPlan("STANDARD", 60, 100, 500, 169);
                    return(STANDARD);

                case "silver":
                    BASIC = new ConnectionPlan("BASIC", 20, 50, 500, 80);
                    return(BASIC);

                default:
                    throw new ArgumentException("Warning# invaid plan name");
                }
            }
            ConnectionPlan INVALID_PLAN = new ConnectionPlan();

            INVALID_PLAN.setName("_Invalid_Plan_");
            return(INVALID_PLAN);
        }
예제 #2
0
파일: Customer.cs 프로젝트: M4NJIND3R/TDMS
 public void setConnectionPlan(string planName)
 {
     this.plan = ConnectionPlan.getPlanByName(planName);
 }