79 lines
2.9 KiB
C#
79 lines
2.9 KiB
C#
using CPM;
|
|
using MLL;
|
|
using System;
|
|
using System.Drawing;
|
|
using System.Windows.Forms;
|
|
using UI;
|
|
|
|
namespace UI
|
|
{
|
|
public partial class NfeNumeroLoteCadastroPanel : FormularioModelo
|
|
{
|
|
private ModeloNFENumeroLote _lote = new ModeloNFENumeroLote();
|
|
|
|
// Controles - Identificação e Rastreio
|
|
private LV_TEXTBOX1 txtId, txtNumLote, txtNumNF, txtDataGerado;
|
|
|
|
// Controles - Resposta da SEFAZ
|
|
private LV_TEXTBOX1 txtRetorno;
|
|
|
|
public NfeNumeroLoteCadastroPanel()
|
|
{
|
|
this.Titulo = "Gerenciamento de Lotes de NF-e";
|
|
MontarInterface();
|
|
}
|
|
|
|
private void MontarInterface()
|
|
{
|
|
// --- SEÇÃO 1: Dados de Transmissão ---
|
|
content.Controls.Add(CreateSectionHeader("IDENTIFICAÇÃO DO LOTE", 20));
|
|
|
|
txtId = AddInput(content, "ID INTERNO", 20, 50, 90, 30, true);
|
|
txtNumLote = AddInput(content, "Nº DO LOTE (RECIBO)", 120, 50, 200, 30);
|
|
txtNumNF = AddInput(content, "Nº DA NOTA FISCAL", 330, 50, 150, 30);
|
|
txtDataGerado = AddInput(content, "DATA DE GERAÇÃO", 490, 50, 180, 30, true);
|
|
|
|
// --- SEÇÃO 2: Resposta do Processamento ---
|
|
content.Controls.Add(CreateSectionHeader("RETORNO DO WEBSERVICE (XML/JSON)", 115));
|
|
|
|
txtRetorno = AddInput(content, "STATUS E MENSAGEM DE RETORNO", 20, 145, 780, 100, true);
|
|
txtRetorno.Multiline = true;
|
|
//txtRetorno.ScrollBars = ScrollBars.Vertical;
|
|
|
|
// Ajuste visual para o campo de retorno
|
|
txtRetorno.Height = 120;
|
|
|
|
content.Height = 300;
|
|
}
|
|
|
|
public void CarregarDados(ModeloNFENumeroLote lote)
|
|
{
|
|
_lote = lote;
|
|
txtId.Text = _lote.ID_NFE_NUM_LOTE.ToString();
|
|
txtNumLote.Text = _lote.CODIGO;
|
|
txtNumNF.Text = _lote.NUM_NF;
|
|
txtDataGerado.Text = _lote.DATA_GERADO;
|
|
txtRetorno.Text = _lote.RETORNO;
|
|
|
|
// Destaque visual para o status de retorno
|
|
if (_lote.RETORNO.Contains("100")) // Autorizado
|
|
{
|
|
txtRetorno.BackColor = Color.FromArgb(230, 255, 230);
|
|
txtRetorno.ForeColor = Color.DarkGreen;
|
|
}
|
|
else if (_lote.RETORNO.Contains("Rejeição"))
|
|
{
|
|
txtRetorno.BackColor = Color.FromArgb(255, 230, 230);
|
|
txtRetorno.ForeColor = Color.Red;
|
|
}
|
|
}
|
|
|
|
protected override void OnNovo() { } // Lotes são gerados automaticamente pelo motor fiscal
|
|
protected override void OnSalvar() { } // Logs de lote são imutáveis após o retorno
|
|
protected override void OnExcluir() { } // Lotes não podem ser excluídos para manter histórico
|
|
protected override void OnAlterar() { }
|
|
protected override void OnLocalizar() { }
|
|
protected override void OnCancelar() { }
|
|
|
|
}
|
|
} |