Пример #1
0
        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));
        }
Пример #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));
        }
Пример #3
0
        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));
        }
Пример #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));
        }