private void MontarDocumento(Database_Class.Classes.Cliente cliente, Database_Class.Classes.Processo processo, List <Database_Class.Classes.Movimentacao> movimentacoes) { CriarDocumento(); CabecalhoDocumento(); CorpoDocumento(cliente, processo, movimentacoes); RodapeDocumento(); FecharDocumento(); }
public void GerarRelPrintDocument(Database_Class.Classes.Cliente clienteByProcesso,Database_Class.Classes.Processo processo,List<Database_Class.Classes.Movimentacao> movimentoacoesByProcesso) { this.clienteByProcesso = clienteByProcesso; this.processo = processo; this.movimentoacoesByProcesso = movimentoacoesByProcesso; System.Drawing.Printing.PrintDocument pd = new System.Drawing.Printing.PrintDocument(); pd.DocumentName = "Movimentacoes_do_Processo"; pd.PrintPage += imprimir; PrintPreviewDialog ppd = new PrintPreviewDialog(); ppd.Document = pd; ppd.WindowState = FormWindowState.Maximized; ppd.PrintPreviewControl.Zoom = 1; ppd.ShowDialog(); }
private void LerDados() { Database_Class.Classes.Cliente dtoCliente = (Database_Class.Classes.Cliente)cbCliente.SelectedItem; Database_Class.Classes.Comarca dtoComarca = (Database_Class.Classes.Comarca)cbComarca.SelectedItem; Database_Class.Classes.Advogado dtoAdvogado = (Database_Class.Classes.Advogado)cbAdvogacia.SelectedItem; if (dtoCliente == null || dtoComarca == null || dtoAdvogado == null) { return; } processo.Numero = txtNumero.Text; processo.IdCliente = dtoCliente.Id; processo.NomeCliente = dtoCliente.Nome; processo.IdComarca = dtoComarca.Id; processo.NomeComarca = dtoComarca.Nome; processo.IdAdvogado = dtoAdvogado.Id; processo.NomeAdvogado = dtoAdvogado.Nome; }
private async void Incluir() { Enabled(false); try { cliente = new Database_Class.Classes.Cliente(); LerDados(); await bdCliente.Insert(cliente); if (cliente.Id != 0) { MetroMessageBox.Show(this, "Cliente cadatrado com sucesso", "Confirmado", MessageBoxButtons.OK, MessageBoxIcon.Information, this.Height); gravou = true; Close(); } else { var result = MetroMessageBox.Show(this, "Não foi possivel cadastrar Cliente, Deseja tentar novamente?", "Erro", MessageBoxButtons.YesNo, MessageBoxIcon.Question, this.Height); if (result == DialogResult.Yes) { Incluir(); } else { OriginalObjeto(copiaCliente, cliente); gravou = false; Close(); } } } catch (Exception e) { OriginalObjeto(copiaCliente, cliente); MetroMessageBox.Show(this, e.Message, "Erro", MessageBoxButtons.OK, MessageBoxIcon.Information, this.Height); gravou = false; } Enabled(true); }
public FormCadastroCliente(Database_Class.Classes.Cliente cliente) { this.cliente = cliente; CopiaObjeto(this.cliente, ref copiaCliente); InitializeComponent(); }
private void CorpoDocumento(Database_Class.Classes.Cliente cliente, Database_Class.Classes.Processo processo, List <Database_Class.Classes.Movimentacao> movimentacoes) { PdfPTable table = new PdfPTable(5); iTextSharp.text.Font font = new iTextSharp.text.Font(iTextSharp.text.Font.TIMES_ROMAN, 8, iTextSharp.text.Font.NORMAL, Color.BLACK); iTextSharp.text.Font titulo = new iTextSharp.text.Font(iTextSharp.text.Font.TIMES_ROMAN, 8, iTextSharp.text.Font.BOLD, Color.BLACK); float[] colsW = { 10, 10, 10, 10, 10 }; table.SetWidths(colsW); table.HeaderRows = 1; table.WidthPercentage = 100f; table.DefaultCell.Border = PdfPCell.BOTTOM_BORDER; table.DefaultCell.BorderColor = Color.BLACK; table.DefaultCell.BorderColorBottom = Color.BLACK; table.DefaultCell.Padding = 10; var cell = getNewCell("Informações Gerais Sobre o Processo", titulo, Element.ALIGN_LEFT, 10, PdfPCell.BOTTOM_BORDER); cell.Colspan = 5; cell.HorizontalAlignment = Element.ALIGN_CENTER; table.AddCell(cell); table.AddCell(getNewCell("Número", titulo, Element.ALIGN_LEFT, 10, PdfPCell.BOTTOM_BORDER, Color.BLACK, Color.WHITE)); table.AddCell(getNewCell("Comarca", titulo, Element.ALIGN_LEFT, 10, PdfPCell.BOTTOM_BORDER, Color.BLACK, Color.WHITE)); table.AddCell(getNewCell("Cliente", titulo, Element.ALIGN_LEFT, 10, PdfPCell.BOTTOM_BORDER, Color.BLACK, Color.WHITE)); table.AddCell(getNewCell("Telefone", titulo, Element.ALIGN_RIGHT, 10, PdfPCell.BOTTOM_BORDER, Color.BLACK, Color.WHITE)); table.AddCell(getNewCell("Cpf", titulo, Element.ALIGN_RIGHT, 10, PdfPCell.BOTTOM_BORDER, Color.BLACK, Color.WHITE)); table.AddCell(getNewCell(processo.Numero, font, Element.ALIGN_LEFT, 5, PdfPCell.BOTTOM_BORDER)); table.AddCell(getNewCell(processo.NomeComarca, font, Element.ALIGN_LEFT, 5, PdfPCell.BOTTOM_BORDER)); table.AddCell(getNewCell(cliente.Nome, font, Element.ALIGN_LEFT, 5, PdfPCell.BOTTOM_BORDER)); table.AddCell(getNewCell(cliente.Telefone, font, Element.ALIGN_RIGHT, 5, PdfPCell.BOTTOM_BORDER)); table.AddCell(getNewCell(cliente.Cpf, font, Element.ALIGN_RIGHT, 5, PdfPCell.BOTTOM_BORDER)); doc.Add(table); //----------------------------------------------------------------------------------------------------------------- table = new PdfPTable(3); font = new iTextSharp.text.Font(iTextSharp.text.Font.TIMES_ROMAN, 8, iTextSharp.text.Font.NORMAL, Color.BLACK); titulo = new iTextSharp.text.Font(iTextSharp.text.Font.TIMES_ROMAN, 8, iTextSharp.text.Font.BOLD, Color.BLACK); float[] colsM = { 10, 10, 10 }; table.SetWidths(colsM); table.HeaderRows = 1; table.WidthPercentage = 100f; table.DefaultCell.Border = PdfPCell.BOTTOM_BORDER; table.DefaultCell.BorderColor = Color.BLACK; table.DefaultCell.BorderColorBottom = Color.BLACK; table.DefaultCell.Padding = 10; cell = getNewCell("Movimentações do Processo", titulo, Element.ALIGN_LEFT, 10, PdfPCell.BOTTOM_BORDER); cell.Colspan = 3; cell.HorizontalAlignment = Element.ALIGN_CENTER; table.AddCell(cell); table.AddCell(getNewCell("Data", titulo, Element.ALIGN_LEFT, 10, PdfPCell.BOTTOM_BORDER, Color.BLACK, Color.WHITE)); table.AddCell(getNewCell("Situacao", titulo, Element.ALIGN_LEFT, 10, PdfPCell.BOTTOM_BORDER, Color.BLACK, Color.WHITE)); table.AddCell(getNewCell("Observacao", titulo, Element.ALIGN_LEFT, 10, PdfPCell.BOTTOM_BORDER, Color.BLACK, Color.WHITE)); foreach (var movimentacao in movimentacoes) { table.AddCell(getNewCell(movimentacao.Data.ToLongDateString(), font, Element.ALIGN_LEFT, 5, PdfPCell.BOTTOM_BORDER)); table.AddCell(getNewCell(movimentacao.SituacaoAndamentoProcessual, font, Element.ALIGN_LEFT, 5, PdfPCell.BOTTOM_BORDER)); table.AddCell(getNewCell(movimentacao.Observacao, font, Element.ALIGN_LEFT, 5, PdfPCell.BOTTOM_BORDER)); } doc.Add(table); writer.Flush(); }