public string Inserir(Ocorrencia model)
 {
     try
     {
         OCORRENCIA ocr = new OCORRENCIA();
         ocr.CODE_CATEGORIA = model.Categoria.Code;
         ocr.CODE_STATUS = model.Status.Code;
         ocr.LATITUDE = model.Latitude;
         ocr.LONGITUDE = model.Longitude;
         ocr.ENDERECO = model.Endereco;
         ocr.DATA_CADASTRO = DateTime.Now;
         ocr.OUTRO = model.Outro;
         ocr.RESOLVIDO = false;
         _context.OCORRENCIAs.InsertOnSubmit(ocr);
         _context.SubmitChanges();
         return ("Ocorrência " + ocr.CODE + "adicionada com sucesso.");
     }
     catch (Exception ex)
     {
         throw new Exception("Erro ao inserir ocorrência. Por favor tente novamente.");
     }
 }
 public string Registra_Ocorrencia(Ocorrencia ocorrencia)
 {
     try
     {
         var retorno = _repOcorrencia.Inserir(ocorrencia);
         return retorno;
     }
     catch(Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }
        public string Registra_Ocorrencia(string categoria, string endereco, string latitude, string longitude, string outro, string status)
        {
            try
            {
                Ocorrencia acr = new Ocorrencia();
                acr.Categoria = new Categoria();
                acr.Status = new Status();

                acr.Categoria.Code = int.Parse(categoria);
                acr.Endereco = endereco;
                acr.Latitude = latitude;
                acr.Longitude = longitude;
                acr.Outro = outro;
                acr.Status.Code = int.Parse(status);
                return _services.Registra_Ocorrencia(acr);
            }
            catch (Exception ex)
            {
                return ex.Message;
            }
        }