Example #1
0
        public IActionResult Delete(int id)
        {
            IActionResult _result       = new ObjectResult(false);
            GenericResult _removeResult = null;

            try
            {
                Problem _problemToRemove = this._problemRepository.GetSingle(id);
                _problemRepository.Delete(_problemToRemove);
                _problemRepository.Commit();

                _removeResult = new GenericResult()
                {
                    Succeeded = true,
                    Message   = "Problem removed."
                };
            }
            catch (Exception ex)
            {
                _removeResult = new GenericResult()
                {
                    Succeeded = false,
                    Message   = ex.Message
                };

                _loggingRepository.Add(new Error()
                {
                    Message = ex.Message, StackTrace = ex.StackTrace, DateCreated = DateTime.Now
                });
                _loggingRepository.Commit();
            }

            _result = new ObjectResult(_removeResult);
            return(_result);
        }
 public void Delete(Guid id)
 {
     _problemRepository.Delete(id);
 }
Example #3
0
 public ActionResult Delete(int id)
 {
     repo.Delete(id);
     return(RedirectToAction("Index"));
 }
Example #4
0
 public void DeleteProblem(Problem selectedProblem)
 {
     //conn.DeleteProblem(selectedProblem);
     _problemRepository.Delete(selectedProblem);
 }
Example #5
0
 public IActionResult DeleteConfirmed(Guid problemId)
 {
     _problemRepository.Delete(problemId);
     _problemRepository.Save();
     return(View("Index"));
 }