public ActionResult Delete(int id, RemoteCommandModel remoteCommandModel) { try { RemoteCommandMockRepository.Singleton.DeleteRemoteCommandById(id); return(RedirectToAction(nameof(Index))); } catch { return(View()); } }
public ActionResult Edit(int id, RemoteCommandModel remoteCommandModel) { try { var remoteCommand = RemoteCommandMockRepository.Singleton.GetRemoteCommandById(id); remoteCommand.Name = remoteCommandModel.Name; remoteCommand.SignalCode = remoteCommandModel.SignalCode; RemoteCommandMockRepository.Singleton.UpdateRemoteCommand(remoteCommand); return(RedirectToAction(nameof(Index))); } catch { return(View(remoteCommandModel)); } }
public ActionResult Create(RemoteCommandModel remoteCommandModel) { try { var remoteCommand = new RemoteCommand { Name = remoteCommandModel.Name, SignalCode = remoteCommandModel.SignalCode }; RemoteCommandMockRepository.Singleton.InsertRemoteCommand(remoteCommand); return(RedirectToAction(nameof(Index))); } catch { return(View(remoteCommandModel)); } }