public List<int> GetProductsToFind(User userEntity)
        {
            List<int> productsToFind = new List<int>();
            if (ProductIdType == ProductIdType.AllUsersProducts)
            {
                var usersProductIds = from p in userEntity.Products2 select p.ProductNumber;
                productsToFind.AddRange(usersProductIds);
            }
            else
            {
                productsToFind.Add(ProductId);
            }

            return productsToFind;
        }
        public IEnumerable<int> GetStoreIds(DrinksEntities entities, User userEntity)
        {
            IEnumerable<int> storeids;
            if (StoreNumberType == StoreNumberType.AllStores)
            {
                storeids = from s in entities.StoreInformations select s.StoreNumber;
            }
            else
            {
                if (StoreNumberType == StoreNumberType.AllUsersStores)
                {
                    storeids = from s in userEntity.StoreInformations select s.StoreNumber;
                }
                else
                {
                    storeids = new int[] { StoreNumber };
                }
            }

            return storeids;
        }
Example #3
0
 /// <summary>
 /// Deprecated Method for adding a new object to the Users EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToUsers(User user)
 {
     base.AddObject("Users", user);
 }
Example #4
0
 /// <summary>
 /// Create a new User object.
 /// </summary>
 /// <param name="userName">Initial value of the UserName property.</param>
 public static User CreateUser(global::System.String userName)
 {
     User user = new User();
     user.UserName = userName;
     return user;
 }