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

            if (index >= 0)
            {
                GetAll()[index] = obj;
            }
            return(obj);
        }
Ejemplo n.º 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($"-------------------");
     }
 }
Ejemplo n.º 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;
 }
Ejemplo n.º 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()}");
         }
     }
 }
Ejemplo n.º 6
0
 public ProductsController(IProduct product, IProducent producent, ICategory category)
 {
     _product = product;
     _producent = producent;
     _category = category;
 }
Ejemplo n.º 7
0
 public void SaveProducent(IProducent producent, int indeks)
 {
     _producenci[indeks] = producent;
 }
Ejemplo n.º 8
0
 public void SaveProducent(IProducent producent)
 {
     _producenci.Add(producent);
 }
Ejemplo n.º 9
0
 public void SaveProducent(IProducent producent, int indeks)
 {
     DAO.SaveProducent(producent, indeks);
 }
Ejemplo n.º 10
0
 public void SaveProducent(IProducent producent)
 {
     DAO.SaveProducent(producent);
 }
Ejemplo n.º 11
0
 public bool Add(IProducent obj)
 {
     GetAll().Add(obj);
     return(true);
 }
Ejemplo n.º 12
0
 public void AddNewProducent(IProducent producent)
 {
     //adding producent to database
     //    producents.Add(producent);
 }