예제 #1
0
        public void AddKeyword(string keyword)
        {
            KeywordHistory keywordHistory = new KeywordHistory();

            keywordHistory.DateModified = DateTime.Now;
            keywordHistory.Keyword      = keyword;
            keywordHistory.ProductId    = _ProductVM.Product.ProductId;

            SessionDataContext.KeywordHistories.Add(keywordHistory);
            SessionDataContext.SaveChanges();
        }
예제 #2
0
        public void AddInitialKeywordHistoryRecord(string keyword)
        {
            var keywordHistories = SessionDataContext
                                   .KeywordHistories
                                   .Where(x => x.ProductId == _ProductVM.Product.ProductId);

            if (keywordHistories.Count() != 0)
            {
                return;
            }

            KeywordHistory keywordHistory = new KeywordHistory();

            keywordHistory.DateModified = DateTime.Now;
            keywordHistory.Keyword      = keyword;
            keywordHistory.ProductId    = _ProductVM.Product.ProductId;

            SessionDataContext.KeywordHistories.Add(keywordHistory);
            SessionDataContext.SaveChanges();
        }