Exemplo n.º 1
0
        public void LogCustomerSatisfaction(string feedback)
        {
            if (_FeatureManager.CustomerSatisfaction == false)
            {
                return;
            }

            var entry = GetPopulatedLogEntry();

            entry.LogType     = "CustomerSatisfaction";
            entry.FeatureName = String.Empty;
            entry.Message     = feedback;

            _DatabaseContext.LogEntries.Add(entry);
            _DatabaseContext.SaveChanges();
        }
        public void AddSubscription(string username, string subscriptionType)
        {
            var sub =
                (from temp in _Context.Subscriptions
                 where temp.Username == username
                 select temp).FirstOrDefault();

            if (sub == null)
            {
                sub = new Subscription();

                sub.Username = username;

                sub.SubscriptionLevel = subscriptionType;

                _Context.Subscriptions.Add(sub);
            }
            else
            {
                sub.SubscriptionLevel = subscriptionType;
            }

            _Context.SaveChanges();
        }