70 lines
2.5 KiB
C#
70 lines
2.5 KiB
C#
using CPM;
|
|
using MLL;
|
|
using System.Drawing;
|
|
using System.Windows.Forms;
|
|
|
|
namespace UI
|
|
{
|
|
// Herdando do seu modelo abstrato
|
|
public class OrdensContatoPanel : FormularioModelo
|
|
{
|
|
private LV_TEXTBOX1 txtId, txtCodOrdem, txtQuem, txtDescricao, txtUsuario, txtData;
|
|
|
|
public OrdensContatoPanel()
|
|
{
|
|
this.Titulo = "HISTÓRICO DE CONTATOS DA O.S.";
|
|
MontarInterface();
|
|
}
|
|
|
|
private void MontarInterface()
|
|
{
|
|
// Criando uma seção usando seu método helper
|
|
var secaoInfo = CreateSectionHeader("Informações do Registro", 20);
|
|
content.Controls.Add(secaoInfo);
|
|
|
|
// Adicionando inputs usando seus helpers protegidos
|
|
txtId = AddInput(content, "ID CONTATO", 20, 55, 100, 28, true); // ReadOnly
|
|
txtCodOrdem = AddInput(content, "CÓDIGO O.S.", 130, 55, 120, 28, true);
|
|
txtData = AddInput(content, "DATA CADASTRO", 260, 55, 180, 28, true);
|
|
txtUsuario = AddInput(content, "USUÁRIO", 450, 55, 150, 28, true);
|
|
|
|
var secaoDetalhes = CreateSectionHeader("Detalhes do Acompanhamento", 120);
|
|
content.Controls.Add(secaoDetalhes);
|
|
|
|
txtQuem = AddInput(content, "QUEM FALOU / CONTATO", 20, 155, 300, 28);
|
|
|
|
// Para a descrição, podemos ajustar a altura manualmente após o helper
|
|
txtDescricao = AddInput(content, "DESCRIÇÃO DA OCORRÊNCIA", 20, 215, 600, 80);
|
|
// Se o seu LV_TEXTBOX1 suportar multiline:
|
|
// txtDescricao.Multiline = true;
|
|
}
|
|
|
|
// --- IMPLEMENTAÇÃO OBRIGATÓRIA DOS MÉTODOS DO PAI ---
|
|
|
|
protected override void OnNovo()
|
|
{
|
|
// Lógica para limpar campos e habilitar edição
|
|
txtQuem.Text = "";
|
|
txtDescricao.Text = "";
|
|
txtQuem.Focus();
|
|
}
|
|
|
|
protected override void OnSalvar()
|
|
{
|
|
// Aqui entra a sua BLL usando o ModeloOrdensContato
|
|
var contato = new ModeloOrdensContato
|
|
{
|
|
DESCRICAO = txtDescricao.Text,
|
|
QUEM = txtQuem.Text,
|
|
// ... outros campos
|
|
};
|
|
|
|
MessageBox.Show("Histórico salvo com sucesso!", "LevelOS", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
|
}
|
|
|
|
protected override void OnAlterar() { /* Implementar */ }
|
|
protected override void OnExcluir() { /* Implementar */ }
|
|
protected override void OnLocalizar() { /* Implementar */ }
|
|
protected override void OnCancelar() { /* Implementar */ }
|
|
}
|
|
} |