Beispiel #1
0
        public ActionResult Create(FormCollection collection)
        {
            try
            {
                var group  = _screenGroupRepository.GetById(new Guid(collection["GroupId"]));
                var screen = Screen.Create(collection["Title"], collection["Location"], group);
                screen.CreatedBy   = GetCurrentUser().User.ToString();
                screen.ModifiedBy  = screen.CreatedBy;
                screen.HostName    = collection["HostName"];
                screen.RefreshTime = new RefreshTime(Convert.ToInt32(collection["RefreshHours"]), Convert.ToInt32(collection["RefreshMinutes"]), Convert.ToInt32(collection["RefreshSeconds"]));

                _screenRepository.Insert(screen);

                Request.Flash("success", Resources.Resources.Screen + " " + Resources.Resources.Saved);

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

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