Exemplo n.º 1
0
        private static string AddStoreToShop(MobilePhoneShop iphoneShop)
        {
            MobilePhoneStore mobilePhoneStore = CreateMobilePhoneStoreFromInput();

            iphoneShop.AddStore(mobilePhoneStore);
            return($"=> Shop '{mobilePhoneStore.GetDescription()}' successfully created.");
        }
Exemplo n.º 2
0
        private static string AddPhoneToStore(MobilePhoneShop iphoneShop)
        {
            if (!IsAnyMobilePhoneStoreAvailable(iphoneShop))
            {
                return($"=> in {iphoneShop.GetDescription()} no real stores are available. Please add any real store before add a phone.");
            }
            MobilePhoneStore store               = GetMobilePhoneStoreFromInput(iphoneShop);
            MobilePhone      mobilePhone         = CreatePhoneFromInput();
            bool             isPhoneAddedToStore = iphoneShop.AddPhoneToStore(mobilePhone, store.Address);
            string           resultMessage       = isPhoneAddedToStore ? "successfully added" : "was not added";

            return($"=> Phone with {mobilePhone.GetDescription()} {resultMessage} to store '{store.GetDescription()}'.");
        }