52 lines
1.3 KiB
C#
52 lines
1.3 KiB
C#
using compabetov2.database;
|
|
using compabetov2.database.modelos;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel;
|
|
using System.Data;
|
|
using System.Drawing;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using System.Windows.Forms;
|
|
|
|
namespace compabetov2
|
|
{
|
|
public partial class ActualizarMerma : Form
|
|
{
|
|
private Merma merma;
|
|
private mermas ventanaPadre;
|
|
public ActualizarMerma(Merma merma, mermas ventanaPadre)
|
|
{
|
|
InitializeComponent();
|
|
this.merma = merma;
|
|
this.ventanaPadre = ventanaPadre;
|
|
llenarCampos();
|
|
}
|
|
|
|
private void llenarCampos()
|
|
{
|
|
txtDescripcion.Text = merma.razon;
|
|
txtResponsable.Text = merma.responsable;
|
|
dtFecha.Text = merma.fecha;
|
|
}
|
|
|
|
private void btnAgregar_Click(object sender, EventArgs e)
|
|
{
|
|
Merma nuevaMerma = new Merma(merma.idMerma,dtFecha.Text,txtResponsable.Text,txtDescripcion.Text);
|
|
if (service.actualizarMerma(nuevaMerma))
|
|
{
|
|
MessageBox.Show("Merma actualizada");
|
|
ventanaPadre.llenarPanel();
|
|
Close();
|
|
}
|
|
|
|
}
|
|
|
|
private void txtDescripcion_TextChanged(object sender, EventArgs e)
|
|
{
|
|
|
|
}
|
|
}
|
|
}
|