public ProducerViewModel(IProducent producer)
 {
     _id      = producer.Id;
     _name    = producer.Name;
     _address = producer.Address;
     _country = producer.Country;
 }
Beispiel #2
0
        public IProducent Update(IProducent obj)
        {
            int index = GetAll().FindIndex(el => el.Id == obj.Id);

            if (index >= 0)
            {
                GetAll()[index] = obj;
            }
            return(obj);
        }
Beispiel #3
0
 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($"-------------------");
     }
 }
Beispiel #4
0
 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;
 }
Beispiel #5
0
 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;
 }
Beispiel #7
0
 public void SaveProducent(IProducent producent, int indeks)
 {
     _producenci[indeks] = producent;
 }
Beispiel #8
0
 public void SaveProducent(IProducent producent)
 {
     _producenci.Add(producent);
 }
Beispiel #9
0
 public void SaveProducent(IProducent producent, int indeks)
 {
     DAO.SaveProducent(producent, indeks);
 }
Beispiel #10
0
 public void SaveProducent(IProducent producent)
 {
     DAO.SaveProducent(producent);
 }
Beispiel #11
0
 public bool Add(IProducent obj)
 {
     GetAll().Add(obj);
     return(true);
 }
Beispiel #12
0
 public void AddNewProducent(IProducent producent)
 {
     //adding producent to database
     //    producents.Add(producent);
 }