Base De Datos
Enviado por aleceselmejor • 18 de Junio de 2013 • 680 Palabras (3 Páginas) • 356 Visitas
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Dominio;
using Dominio.Observer;
using System.Globalization;
using System.Reflection;
namespace Interfaz
{
public partial class VentanaEditarPieza : Form, IObservador
{
private Stock stock;
private BindingSource bindingSource;
private Parte pieza;
public VentanaEditarPieza()
{
InitializeComponent();
comboBoxMedio.DataSource = Enum.GetValues(typeof(Constantes.Medio));
stock = Stock.ObtenerInstancia();
stock.AgregarObservador(this);
bindingSource = new BindingSource();
bindingSource.DataSource = stock.ModelosPiezas;
comboBoxModelos.DataSource = bindingSource;
}
public void Actualizar(Observable observable)
{
bindingSource.ResetBindings(false);
}
private void buttonGuardar_Click(object sender, EventArgs e)
{
if (!MetodosComunesInterfaz.ValidateFields(this.Controls))
{
MessageBox.Show(Constantes.competarTodosLosCampos);
return;
}
if (MessageBox.Show(Constantes.borrarPiezasConfirmation, "Confirm delete", MessageBoxButtons.YesNo)
...