public int DeleteObjective(int id)
        {
            SqlObject.CommandText = StoredProcedures.Objectives.DeleteObjective;
            SqlObject.Parameters  = new object[] { id };
            int result = _repository.Delete(id);

            return(result);
        }
Exemplo n.º 2
0
        protected async void FormSubmit(EditContext editContext)
        {
            if (!editContext.Validate())
            {
                return;
            }
            await ObjectiveRepository.Delete(Id);

            NavigationManager.NavigateTo("objective");
        }
Exemplo n.º 3
0
 // DELETE: api/Objectives/Delete/1
 public IHttpActionResult DeleteObjective(int id)
 {
     if (Repository.FindById(id) == null)
     {
         return(NotFound());
     }
     else
     {
         try
         {
             Repository.Delete(id);
             return(Ok());
         }
         catch (Exception ex)
         {
             return(BadRequest(ex.ToString()));
         }
     }
 }