Ejemplo n.º 1
0
        public IHttpActionResult Reset(Guid id)
        {
            var screen = _screenRepository.GetById(id);

            screen.Update();

            return(Ok(id));
        }
Ejemplo n.º 2
0
        public ActionResult Edit(Guid id)
        {
            try
            {
                var screen = _screenRepository.GetById(id);

                var groupList = _screenGroupRepository.List().OrderBy(x => x.Title);
                var groups    = new List <SelectListItem>();
                foreach (var group in groupList)
                {
                    groups.Add(new SelectListItem()
                    {
                        Value = group.Id.ToString(),
                        Text  = group.Title
                    });
                }

                var model = new ScreenViewModel()
                {
                    Id                                                = screen.Id,
                    Title                                             = screen.Title,
                    Location                                          = screen.Location,
                    HostName                                          = screen.HostName,
                    GroupId                                           = screen.Group != null?screen.Group.Id.ToString() : "",
                                                       Groups         = groups,
                                                       RefreshHours   = screen.RefreshTime.Hours,
                                                       RefreshMinutes = screen.RefreshTime.Minutes,
                                                       RefreshSeconds = screen.RefreshTime.Seconds
                };

                return(View(model));
            }
            catch (Exception e)
            {
                Request.Flash("error", Resources.Resources.SevereError + ": " + e.Message);

                return(RedirectToAction("Index"));
            }
        }