Пример #1
0
        protected void videosControl_OnEditItem(object sender, GenericEventArgs <Guid> e)
        {
            var entity = DataContext.LP_Videos.FirstOrDefault(n => n.ID == e.Value);

            if (entity == null)
            {
                return;
            }

            var converter = new VideoEntityModelConverter(DataContext);
            var model     = converter.Convert(entity);

            videoControl.Model = model;
            mpeAddEdit.Show();
        }
Пример #2
0
        private void FillDataGrid()
        {
            var entities = (from n in DataContext.LP_Videos
                            where n.DateDeleted == null
                            orderby n.DateCreated descending
                            select n).ToList();

            var converter = new VideoEntityModelConverter(DataContext);

            var models = (from n in entities
                          let m = converter.Convert(n)
                                  select m).ToList();

            var model = new VideosModel();

            model.List = models;

            videosControl.Model = model;
        }