Exemple #1
0
 public void ToAllGroceries(List <GroceryDetails> details)
 {
     foreach (var grocery in details)
     {
         Grocery newGrocery = new Grocery(grocery.Name, Grocery.ParseEnum <Unit>(grocery.Unit), Grocery.ParseEnum <Category>(grocery.Category), 0);
         Groceries.Add(newGrocery);
     }
 }
Exemple #2
0
 public void ToAvailableGroceries(List <AvailableGroceriesDetails> details)
 {
     foreach (var grocery in details)
     {
         Grocery newGrocery = new Grocery(grocery.Grocery.Name, Grocery.ParseEnum <Unit>(grocery.Grocery.Unit), Grocery.ParseEnum <Category>(grocery.Grocery.Category), grocery.Amount);
         this.AddToList(newGrocery);
     }
 }
Exemple #3
0
        public void ToRecipe(RecipeDetails details)
        {
            Name        = details.Name;
            Id          = details.ID;
            Description = details.Description;
            Image       = details.Image;
            var list = ChamberOfSecrets.Proxy.dbGetContains(Id, true).ToList();

            foreach (var item in list)
            {
                var grocery = new Grocery(item.Grocery.Name, Grocery.ParseEnum <Unit>(item.Grocery.Unit), Grocery.ParseEnum <Category>(item.Grocery.Category), item.Amount);
                Groceries.Add(grocery);
            }
        }
Exemple #4
0
 public void ToUser(UserDetails user)
 {
     if (user != null)
     {
         this.UserName = user.UserName;
         Password      = user.Password;
         Name          = user.Name;
         SurName       = user.Surname;
         Email         = user.Email;
         UserStatus    = Grocery.ParseEnum <Status>(user.Status);
         MyOptions     = new Option();
         MyGroup       = user.MyGroup;
         Image         = ChamberOfSecrets.Proxy.dbGetUserImage(UserName);
     }
 }
Exemple #5
0
 public void ToShoppingCart(List <ShoppingCartDetails> details)
 {
     if (details.Count != 0)
     {
         foreach (var grocery in details)
         {
             Grocery newGrocery = new Grocery(grocery.Grocery.Name, Grocery.ParseEnum <Unit>(grocery.Grocery.Unit), Grocery.ParseEnum <Category>(grocery.Grocery.Category), grocery.Amount);
             Groceries.AddToList(newGrocery);
         }
     }
     else
     {
         Groceries = new AvailableGroceries();
     }
 }