예제 #1
0
        public StoryCategoryModel GetStoryCategoryModelByID(decimal SEQ_ID)
        {
            StoryCategoryModel model = new StoryCategoryModel();

            using (LBCData context = new LBCData(ConnectionHelper.getConnectionString()))
            {
                var lst = from ev in context.LBC_STORY_CATEGORY
                          where ev.SEQ_ID == SEQ_ID
                          select new StoryCategoryModel
                {
                    SEQ_ID     = ev.SEQ_ID,
                    CATEG_NAME = ev.CATEG_NAME,
                };

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

                StoryCategoryBL _storecategory = new StoryCategoryBL();

                List <StoryCategoryModel> lst = _storecategory.GetAll();

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

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

            catch (Exception ex)
            {
                throw ex;
            }
        }