public ProducerViewModel(IProducent producer) { _id = producer.Id; _name = producer.Name; _address = producer.Address; _country = producer.Country; }
public IProducent Update(IProducent obj) { int index = GetAll().FindIndex(el => el.Id == obj.Id); if (index >= 0) { GetAll()[index] = obj; } return(obj); }
private static void printAllProducents(List <IProducent> producents) { for (int i = 0; i < producents.Count; i++) { IProducent producent = producents[i]; Console.WriteLine($"Producent number {i + 1}:"); Console.WriteLine($"Producent's name: {producent.Name}\nTown: {producent.Town}\nStreet: {producent.Street}\nStreet number: {producent.StreetNumber}"); Console.WriteLine($"-------------------"); } }
public Beer(Race _race, Speciality _speciality, IProducent _producent, Double _alcoholPercent, int _IBU, int _EBC, int _servingTemperature, Double _BLG, DateTime _bestBefore, String _seaStory, String _ingredients) { Race = _race; Speciality = _speciality; Producent = _producent; AlcoholPercent = _alcoholPercent; IBU = _IBU; EBC = _EBC; ServingTemperature = _servingTemperature; BLG = _BLG; BestBefore = _bestBefore; SeaStory = _seaStory; Ingredients = _ingredients; }
private void makeDetailsOfSelectedBeer(object obj) { BeerDetailsView.Clear(); foreach (PropertyDescriptor descriptor in TypeDescriptor.GetProperties(obj)) { String name = descriptor.Name; object value = descriptor.GetValue(obj); if (name == "Producent") { IProducent producent = (IProducent)descriptor.GetValue(obj); BeerDetailsView.Add($"{name}: {producent.Name}"); } else { BeerDetailsView.Add($"{name}: {value.ToString()}"); } } }
public ProductsController(IProduct product, IProducent producent, ICategory category) { _product = product; _producent = producent; _category = category; }
public void SaveProducent(IProducent producent, int indeks) { _producenci[indeks] = producent; }
public void SaveProducent(IProducent producent) { _producenci.Add(producent); }
public void SaveProducent(IProducent producent, int indeks) { DAO.SaveProducent(producent, indeks); }
public void SaveProducent(IProducent producent) { DAO.SaveProducent(producent); }
public bool Add(IProducent obj) { GetAll().Add(obj); return(true); }
public void AddNewProducent(IProducent producent) { //adding producent to database // producents.Add(producent); }