Beispiel #1
0
        public StoryRatingModel GetStoryRatingModelByID(decimal SEQ_ID)
        {
            StoryRatingModel model = new StoryRatingModel();

            using (LBCData context = new LBCData(ConnectionHelper.getConnectionString()))
            {
                var lst = from ev in context.LBC_STORY_RATING
                          where ev.SEQ_ID == SEQ_ID
                          select new StoryRatingModel
                {
                    SEQ_ID      = ev.SEQ_ID,
                    RATING_NAME = ev.RATING_NAME,
                };

                model = lst.SingleOrDefault();
            }
            return(model);
        }
            public StoryRatingListProvider(string defaultText = null)
            {
                if (!string.IsNullOrEmpty(defaultText))
                {
                    Add(string.Empty, defaultText);
                }

                StoryRatingBL _storerating = new StoryRatingBL();

                List <StoryRatingModel> lst = _storerating.GetAll();

                for (int i = 0; i < lst.Count; i++)
                {
                    StoryRatingModel item = new StoryRatingModel()
                    {
                        SEQ_ID      = lst.ElementAt(i).SEQ_ID,
                        RATING_NAME = lst.ElementAt(i).RATING_NAME
                    };
                    Add(item.SEQ_ID.ToString(), item.RATING_NAME);
                }
            }
Beispiel #3
0
        /// <summary>
        /// Update the event count to check the max;
        /// </summary>
        /// <param name="model"></param>
        public void UpdateEventCount(StoryRatingModel model)
        {
            // LBC_STORY_RATING _event = new LBC_STORY_RATING();
            // bool flag = false;
            try
            {
                using (LBCData context = new LBCData(ConnectionHelper.getConnectionString()))
                {
                    var _event = (from p in context.LBC_STORY_RATING
                                  where p.SEQ_ID == model.SEQ_ID
                                  select p).FirstOrDefault();

                    _event.RATING_NAME = model.RATING_NAME;
                    context.SaveChanges();
                }
            }

            catch (Exception ex)
            {
                throw ex;
            }
        }