public IActionResult Delete(Guid id)
        {
            Evaluation evaluation = _evaluationRepository.GetEvaluationByID(id);

            _evaluationRepository.DeleteEvaluation(id);
            return(new OkResult());
        }
 public ActionResult DeleteConfirmed(Guid id)
 {
     _evaluationRepository.DeleteEvaluation(id);
     _evaluationRepository.Save();
     //db.Evaluations.Remove(evaluations);
     //db.SaveChanges();
     return(RedirectToAction("Index"));
 }
Пример #3
0
        public async Task <IActionResult> DeleteEvaluation([FromRoute] int pEvaluationID)
        {
            var     userId = Convert.ToInt32(this.User.FindFirstValue(ClaimTypes.NameIdentifier));
            Boolean result = await _evaluationRepository.DeleteEvaluation(pEvaluationID, userId);

            if (result)
            {
                return(Ok());
            }
            return(BadRequest("Not Deleted Record"));
        }
        public async override Task <EvaluationMessageResponse> DeleteEvaluation(EvaluationAddId request, ServerCallContext context)
        {
            try
            {
                var response = await _evaluation.DeleteEvaluation(request.Id);

                if (!response)
                {
                    throw new Exception("Ne moze da obrise evaluaciju");
                }
                return(new EvaluationMessageResponse()
                {
                    Signal = true
                });
            }
            catch (Exception e)
            {
                _logger.LogError(e, "ERROR");
                return(new EvaluationMessageResponse()
                {
                    Signal = false
                });
            }
        }