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;

namespace SQLServer
{
    public partial class Formularz : Form
    {
        public Formularz()
        {
            InitializeComponent();
        }

        private void Formularz_Load(object sender, EventArgs e)
        {
            // TODO: This line of code loads data into the 'adresyDataSet.Osoby' table. You can move, or remove it, as needed.
            this.osobyTableAdapter.Fill(this.adresyDataSet.Osoby);

        }

        private void osobyBindingSource_CurrentItemChanged(object sender, EventArgs e)
        {
            AdresyDataSet.OsobyRow rekord = (osobyBindingSource.Current as DataRowView).Row as AdresyDataSet.OsobyRow;
            Text = rekord.Imię + " " + rekord.Nazwisko;
            try { int numerDomu = rekord.NumerDomu; }
            catch { numericUpDown1.Value = 0; }
            try { int numerMieszkania = rekord.NumerMieszkania; }
            catch { numericUpDown2.Value = 0; }
        }
    }
}
