public ShoppingCart AddCart(int CartValidationHours)
        {
            Dictionary <string, object> parameters = new Dictionary <string, object>();

            parameters.Add("CartValidationHours", CartValidationHours);
            return(_dataLayer.AddItem <ShoppingCart>("sp_OnlineShop_AddCart", parameters));
        }
Exemple #2
0
        private Log AddLog(string sessionId, LogEvents eventId, string logMessage, LogTypes logType)
        {
            Dictionary <string, object> parameters = new Dictionary <string, object>();

            parameters.Add("EventId", eventId);
            parameters.Add("SessionId", sessionId);
            parameters.Add("Message", logMessage);
            parameters.Add("LogTypeId", logType);
            return(_dataLayer.AddItem <Log>("sp_OnlineShop_Log", parameters));
        }
        public int AddProduct(Product product)
        {
            Dictionary <string, object> parameters = new Dictionary <string, object>();

            foreach (var prop in product.GetType().GetProperties())
            {
                if (prop.Name != "Id")
                {
                    parameters.Add(prop.Name, prop.GetValue(product));
                }
            }
            return(_dataLayer.AddItem <int>("sp_OnlineShop_AddProduct", parameters));
        }
Exemple #4
0
        public string SignUp(User user)
        {
            Dictionary <string, object> parameters = new Dictionary <string, object>();

            foreach (var prop in user.GetType().GetProperties())
            {
                if (prop.Name != "Id")
                {
                    parameters.Add(prop.Name, prop.GetValue(user));
                }
            }
            return(_dataLayer.AddItem <string>("sp_OnlineShop_AddNewUser", parameters));
        }