public void DeleteOrder(FormDataCollection form) { var key = Convert.ToInt32(form.Get("key")); var usuario = User.Identity.GetUsuario(); var empresa = User.Identity.GetEmpresa(); VisitaViewModel.Delete(key, empresa, usuario); }
public HttpResponseMessage Delete(int id, string usuario, string empresa, FormDataCollection form) { try { VisitaViewModel.Delete(id, empresa, usuario); return(Request.CreateResponse(HttpStatusCode.OK)); } catch (Exception e) { return(Request.CreateResponse(HttpStatusCode.BadRequest, $"Não foi possível delete a visita \n{e.Message}")); } }