public void ChangeAnimalPrice(Guid input) { var Query = from search in humaneSocietyDataBase.Animals where search.animalID == input select search; foreach (Animal item in Query) { decimal newName = UserUI.GetDecimalInput(item.name + "'s adoption price is $" + item.price + ". What would you like to change " + item.name + "'s price to? Enter new price:"); item.price = newName; humaneSocietyDataBase.SubmitChanges(); } }
public void WhichSearchToExicute() { string input = UserUI.GetStringInput("what would you like to search by? 'animal name','species','breed','personality','price', or 'all available'"); switch (input) { case "animal name": string name = UserUI.GetStringInput("What is the name of the animal you are looking for?"); SearchByName(name); break; case "species": string species = UserUI.GetStringInput("What species of animal are you are looking for?"); SearchBySpecies(species); break; case "breed": string breed = UserUI.GetStringInput("What breed of animal you are looking for?"); SearchByBreed(breed); break; case "personality": string personality = UserUI.GetStringInput("What is the name of the animal you are lookiing for?"); SearchByPersonality(personality); break; case "price": decimal priceChoice = UserUI.GetDecimalInput("What is the name of the animal you are lookiing for?"); SearchByPrice(priceChoice); break; case "all available": ShowAllAvailable(); break; default: UserUI.DisplayMessage("Oops! You entered a wrong message! try again."); Console.ReadLine(); Console.Clear(); WhichSearchToExicute(); break; } }