public IActionResult OnGet(Guid?id) { if (id == null) { return(NotFound()); } Statuses = new List <SelectListItem> { new SelectListItem { Text = "Active", Value = "0" }, new SelectListItem { Text = "Draft", Value = "2" }, new SelectListItem { Text = "Disabled", Value = "2" } }; try { TimedMessage = _repository.Single(DataItemPolicy <Core.Data.TimedMessage> .ById(id.Value)); } catch (Exception ex) { Log.Error($"TimedMessage.Details.OnGet(): {ex.Message} - {ex.StackTrace}"); } if (TimedMessage == null) { return(NotFound()); } return(Page()); }
public IActionResult OnGet(Guid?id) { if (id == null) { return(NotFound()); } try { TimedMessage = _repository.Single <Core.Data.TimedMessage>(DataItemPolicy <Core.Data.TimedMessage> .ById(id.Value)); } catch (Exception ex) { Log.Error($"TimedMessage.Delete.OnGet(): {ex.Message} - {ex.StackTrace}"); } if (TimedMessage == null) { return(NotFound()); } return(Page()); }
public IActionResult OnPost(Guid?id) { if (id == null) { return(NotFound()); } try { TimedMessage = _repository.Single <Core.Data.TimedMessage>(DataItemPolicy <Core.Data.TimedMessage> .ById(id.Value)); if (TimedMessage != null) { _repository.Remove(TimedMessage); } } catch (Exception ex) { Log.Error($"TimedMessage.Delete.OnPost(): {ex.Message} - {ex.StackTrace}"); } return(RedirectToPage("/Index")); }