public void testeListaDocumento() { DocumentoService documentoService = new DocumentoService(); string guidUsuarioTest = "AVB5ECC8-0854-44C9-B2AF-AC71192E4F0B"; List <Documento> documentoLista = documentoService.CarregarDocumentos(guidUsuarioTest); }
public DocumentosController(DocumentoService documentoservice, IFileStorage almacenadorDeDocs, ExpedienteService expedienteservice, EscriturasPublicasService escrituraspublicasservice, BandejaService bandejaService, AsistenteService asistenteService) { _documentoservice = documentoservice; _almacenadorDeDocs = almacenadorDeDocs; _expedienteservice = expedienteservice; _escrituraspublicasservice = escrituraspublicasservice; _bandejaService = bandejaService; this.asistenteService = asistenteService; }
private void btnValidar_Click(object sender, EventArgs e) { if (txtValor.Text.IsNullOrEmpty()) { MessageBox.Show("Preencha o campo e tente novamente.", "Validador de Documento", MessageBoxButtons.OK, MessageBoxIcon.Warning); txtValor.SelectAll(); txtValor.Focus(); return; } var documento = new Documento(txtValor.Text); txtValor.Text = documento.Numero; try { var service = new DocumentoService(); service.InserirRegistro( documento.Numero, documento.Valido, documento.Valido ? "Documento válido!" : documento.MensagemRetorno); } catch (Exception ex) { MessageBox.Show($"Erro: {ex.Message}\r\n\r\nVerifique e tente novamente", "Erro na execução do sistema"); return; } if (!documento.Valido) { MessageBox.Show(documento.MensagemRetorno, "Validador de documento", MessageBoxButtons.OK, MessageBoxIcon.Warning); txtValor.SelectAll(); txtValor.Focus(); return; } txtValor.Text = documento.FormatarNumero(); MessageBox.Show("Documento válido!", "Validador de documento", MessageBoxButtons.OK, MessageBoxIcon.Information); txtValor.SelectAll(); txtValor.Focus(); }
public ActionResult <Produto> StoreProductImage(string id) { DocumentoService documentoService = new DocumentoService(); var image = Request.Form.Files.First(); string filePath = string.Empty; if (image.Length <= 0) { return(NotFound()); } using (var target = new MemoryStream()) { image.CopyTo(target); byte[] imageBytes = target.ToArray(); using (var fs = new FileStream(image.FileName, FileMode.Create, FileAccess.Write)) { fs.Write(imageBytes, 0, imageBytes.Length); filePath = fs.Name; } } string public_url = documentoService.CarregarImagem(filePath); if (filePath != string.Empty) { System.IO.File.Delete(filePath); } var product = _produtoRepository.BuscarProduto(id); product.url_imagem = public_url; var prod = _produtoRepository.AtualizarProduto(product.User, product.Id, product); if (prod != null) { return(prod); } return(NotFound()); }
static void Main(string[] args) { ImpresionService2 ServicioImpresion2 = new ImpresionService2(); Console.WriteLine(ServicioImpresion2.Imprimir()); Console.ReadKey(); ImpresionService ServicioImpresion = new ImpresionService(); Console.WriteLine(ServicioImpresion.Imprimir()); Console.ReadKey(); DocumentoPDFService FormatoPdf = new DocumentoPDFService(); DocumentoService DocumentoConstruido = new DocumentoService(); ImpresionService3 ServicioImpresion3 = new ImpresionService3(DocumentoConstruido, FormatoPdf); Console.WriteLine(ServicioImpresion3.Imprimir()); Console.ReadKey(); IFormatoDocumento Formatopdf = new DocumentoPDFService(); IFormatoDocumento FormatoExcel = new DocumentoExcelService(); DocumentoService DocumentoConstruido2 = new DocumentoService(); ImpresionService4 ServicioImpresion4 = new ImpresionService4(DocumentoConstruido2, Formatopdf); ImpresionService4 ServicioImpresion5 = new ImpresionService4(DocumentoConstruido2, FormatoExcel); Console.WriteLine(ServicioImpresion4.Imprimir()); Console.WriteLine(ServicioImpresion5.Imprimir()); Console.ReadKey(); }
public StatisticsController(DocumentoService documentoservice, ExpedienteService expedienteservice) { _documentoservice = documentoservice; _expedienteservice = expedienteservice; }