Esempio n. 1
0
        public IScreen AddScreen(string link, string image)
        {
            ScreenDAO screen = new ScreenDAO();

            screen.Link    = link;
            screen.Content = image;
            IScreen result = db.Screens.Add(screen);

            db.SaveChanges();

            return(result);
        }
Esempio n. 2
0
        public IScreen GetScreenById(string id)
        {
            ScreenDAO screenDao = new ScreenDAO();
            var       allId     = db.Screens;
            string    link      = "http://localhost:4200/viewimage/" + id;

            foreach (IScreen screen in allId)
            {
                if (screen.Link == link)
                {
                    screenDao.Id      = screen.Id;
                    screenDao.Link    = screen.Link;
                    screenDao.Content = screen.Content;
                }
            }
            return(screenDao);
        }