- Adicionado ContratoEquipamentosCadastroPanel - Adicionado ConfigBoletosCadastroPanel (Gestão de convênios) - Adicionado ConfigCartoesCadastroPanel (Taxas e operadoras) - Adicionado ConfigImpressaoCadastroPanel (Coordenadas X/Y) - Adicionado DespesasCadastroPanel e DespFixaCadastroPanel - Adicionado ConfigEcfCadastroPanel (Hardware Fiscal) - Adicionado EmpresaCadastroPanel (Emitente e Web3/Crypto) - Adicionado EquipamentosCadastroPanel (Ativos e Garantia) - Adicionado EsquemasTecnicosCadastroPanel (Biblioteca de Manuais) - Adicionado FluxoCaixaCadastroPanel (Tesouraria) - Adicionado FornecedorItemVinculoPanel (Logística de Suprimentos) Padronização de interface utilizando FormularioModelo e LV_TEXTBOX1."
118 lines
4.0 KiB
C#
118 lines
4.0 KiB
C#
using CPM;
|
|
using MLL;
|
|
using System;
|
|
using System.Drawing;
|
|
using System.Windows.Forms;
|
|
using UI;
|
|
|
|
namespace UI
|
|
{
|
|
public partial class FornecedorItemVinculoPanel : FormularioModelo
|
|
{
|
|
private ModeloFornecerDE _vinculo = new ModeloFornecerDE();
|
|
|
|
// Controles - Identificação
|
|
private LV_TEXTBOX1 txtId, txtCodigo;
|
|
|
|
// Controles - Fornecedor
|
|
private LV_TEXTBOX1 txtCodFor, txtNomeFornecedor;
|
|
private Button btnBuscaFornecedor;
|
|
|
|
// Controles - Item/Produto
|
|
private LV_TEXTBOX1 txtCodItem, txtNomeItem;
|
|
private Button btnBuscaItem;
|
|
|
|
// Controles - Histórico
|
|
private LV_TEXTBOX1 txtUltimaCompra;
|
|
|
|
public FornecedorItemVinculoPanel()
|
|
{
|
|
this.Titulo = "Vínculo de Fornecimento (Produto x Fornecedor)";
|
|
MontarInterface();
|
|
}
|
|
|
|
private void MontarInterface()
|
|
{
|
|
// --- SEÇÃO 1: Identificação do Registro ---
|
|
content.Controls.Add(CreateSectionHeader("DADOS DO REGISTRO", 20));
|
|
|
|
txtId = AddInput(content, "ID", 20, 50, 70, 30, true);
|
|
txtCodigo = AddInput(content, "CÓD. CONTROLE", 100, 50, 150, 30);
|
|
|
|
// --- SEÇÃO 2: Fornecedor ---
|
|
content.Controls.Add(CreateSectionHeader("FORNECEDOR", 110));
|
|
|
|
txtCodFor = AddInput(content, "CÓD. FORN.", 20, 140, 90, 30);
|
|
btnBuscaFornecedor = CriarBotaoLupa(115, 156, OnBuscaFornecedor);
|
|
txtNomeFornecedor = AddInput(content, "RAZÃO SOCIAL / FORNECEDOR", 155, 140, 450, 30, true);
|
|
|
|
// --- SEÇÃO 3: Produto / Item ---
|
|
content.Controls.Add(CreateSectionHeader("PRODUTO / ITEM VINCULADO", 205));
|
|
|
|
txtCodItem = AddInput(content, "CÓD. ITEM", 20, 235, 90, 30);
|
|
btnBuscaItem = CriarBotaoLupa(115, 251, OnBuscaItem);
|
|
txtNomeItem = AddInput(content, "DESCRIÇÃO DO PRODUTO", 155, 235, 450, 30, true);
|
|
|
|
// --- SEÇÃO 4: Informações de Compra ---
|
|
content.Controls.Add(CreateSectionHeader("ÚLTIMA MOVIMENTAÇÃO", 300));
|
|
|
|
// Aqui o campo 'ULTIMA' pode ser usado para Data ou Valor da última compra
|
|
txtUltimaCompra = AddInput(content, "DATA OU VALOR DA ÚLTIMA AQUISIÇÃO", 20, 330, 300, 30);
|
|
|
|
content.Height = 420;
|
|
}
|
|
|
|
private Button CriarBotaoLupa(int x, int y, EventHandler clickEvent)
|
|
{
|
|
var btn = new Button
|
|
{
|
|
Text = "🔍",
|
|
Location = new Point(x, y),
|
|
Size = new Size(32, 30),
|
|
BackColor = AccentBlue,
|
|
ForeColor = Color.White,
|
|
FlatStyle = FlatStyle.Flat,
|
|
Cursor = Cursors.Hand
|
|
};
|
|
btn.FlatAppearance.BorderSize = 0;
|
|
btn.Click += clickEvent;
|
|
content.Controls.Add(btn);
|
|
return btn;
|
|
}
|
|
|
|
private void OnBuscaFornecedor(object sender, EventArgs e) => MessageBox.Show("Busca de Fornecedores");
|
|
private void OnBuscaItem(object sender, EventArgs e) => MessageBox.Show("Busca de Produtos/Itens");
|
|
|
|
private void PreencherModel()
|
|
{
|
|
_vinculo.CODIGO = txtCodigo.Text;
|
|
_vinculo.COD_FOR = txtCodFor.Text;
|
|
_vinculo.COD_ITEM = txtCodItem.Text;
|
|
_vinculo.ULTIMA = txtUltimaCompra.Text;
|
|
}
|
|
|
|
protected override void OnNovo()
|
|
{
|
|
_vinculo = new ModeloFornecerDE();
|
|
txtCodFor.Focus();
|
|
}
|
|
|
|
protected override void OnSalvar()
|
|
{
|
|
try
|
|
{
|
|
PreencherModel();
|
|
MessageBox.Show("Associação salva com sucesso!", "Sucesso", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
MessageBox.Show("Erro: " + ex.Message);
|
|
}
|
|
}
|
|
|
|
protected override void OnAlterar() { }
|
|
protected override void OnExcluir() { }
|
|
protected override void OnLocalizar() { }
|
|
protected override void OnCancelar() { OnNovo(); }
|
|
}
|
|
} |