#pragma warning disable 1591
//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//     Runtime Version:4.0.30319.1
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

namespace LINQ_to_SQL
{
	using System.Data.Linq;
	using System.Data.Linq.Mapping;
	using System.Data;
	using System.Collections.Generic;
	using System.Reflection;
	using System.Linq;
	using System.Linq.Expressions;
	using System.ComponentModel;
	using System;
	
	
	[global::System.Data.Linq.Mapping.DatabaseAttribute(Name="Telefony")]
	public partial class TelefonyDataContext : System.Data.Linq.DataContext
	{
		
		private static System.Data.Linq.Mapping.MappingSource mappingSource = new AttributeMappingSource();
		
    #region Extensibility Method Definitions
    partial void OnCreated();
    partial void InsertListaOsob(ListaOsob instance);
    partial void UpdateListaOsob(ListaOsob instance);
    partial void DeleteListaOsob(ListaOsob instance);
    partial void InsertRozmowy(Rozmowy instance);
    partial void UpdateRozmowy(Rozmowy instance);
    partial void DeleteRozmowy(Rozmowy instance);
    #endregion
		
		public TelefonyDataContext() : 
				base(global::LINQ_to_SQL.Properties.Settings.Default.TelefonyConnectionString, mappingSource)
		{
			OnCreated();
		}
		
		public TelefonyDataContext(string connection) : 
				base(connection, mappingSource)
		{
			OnCreated();
		}
		
		public TelefonyDataContext(System.Data.IDbConnection connection) : 
				base(connection, mappingSource)
		{
			OnCreated();
		}
		
		public TelefonyDataContext(string connection, System.Data.Linq.Mapping.MappingSource mappingSource) : 
				base(connection, mappingSource)
		{
			OnCreated();
		}
		
		public TelefonyDataContext(System.Data.IDbConnection connection, System.Data.Linq.Mapping.MappingSource mappingSource) : 
				base(connection, mappingSource)
		{
			OnCreated();
		}
		
		public System.Data.Linq.Table<ListaOsob> ListaOsobs
		{
			get
			{
				return this.GetTable<ListaOsob>();
			}
		}
		
		public System.Data.Linq.Table<Rozmowy> Rozmowies
		{
			get
			{
				return this.GetTable<Rozmowy>();
			}
		}
		
		[global::System.Data.Linq.Mapping.FunctionAttribute(Name="dbo.ListaOsobPelnoletnich")]
		public ISingleResult<ListaOsobPelnoletnichResult> ListaOsobPelnoletnich()
		{
			IExecuteResult result = this.ExecuteMethodCall(this, ((MethodInfo)(MethodInfo.GetCurrentMethod())));
			return ((ISingleResult<ListaOsobPelnoletnichResult>)(result.ReturnValue));
		}
		
		[global::System.Data.Linq.Mapping.FunctionAttribute(Name="dbo.AktualizujWiek")]
		public int AktualizujWiek()
		{
			IExecuteResult result = this.ExecuteMethodCall(this, ((MethodInfo)(MethodInfo.GetCurrentMethod())));
			return ((int)(result.ReturnValue));
		}
	}
	
	[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.ListaOsob")]
	public partial class ListaOsob : INotifyPropertyChanging, INotifyPropertyChanged
	{
		
		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
		
		private int _Id;
		
		private string _Imię;
		
		private string _Nazwisko;
		
		private System.Nullable<int> _NumerTelefonu;
		
		private System.Nullable<int> _Wiek;
		
		private EntitySet<Rozmowy> _Rozmowies;
		
    #region Extensibility Method Definitions
    partial void OnLoaded();
    partial void OnValidate(System.Data.Linq.ChangeAction action);
    partial void OnCreated();
    partial void OnIdChanging(int value);
    partial void OnIdChanged();
    partial void OnImięChanging(string value);
    partial void OnImięChanged();
    partial void OnNazwiskoChanging(string value);
    partial void OnNazwiskoChanged();
    partial void OnNumerTelefonuChanging(System.Nullable<int> value);
    partial void OnNumerTelefonuChanged();
    partial void OnWiekChanging(System.Nullable<int> value);
    partial void OnWiekChanged();
    #endregion
		
		public ListaOsob()
		{
			this._Rozmowies = new EntitySet<Rozmowy>(new Action<Rozmowy>(this.attach_Rozmowies), new Action<Rozmowy>(this.detach_Rozmowies));
			OnCreated();
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Id", DbType="Int NOT NULL", IsPrimaryKey=true)]
		public int Id
		{
			get
			{
				return this._Id;
			}
			set
			{
				if ((this._Id != value))
				{
					this.OnIdChanging(value);
					this.SendPropertyChanging();
					this._Id = value;
					this.SendPropertyChanged("Id");
					this.OnIdChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Imię", DbType="NVarChar(MAX)")]
		public string Imię
		{
			get
			{
				return this._Imię;
			}
			set
			{
				if ((this._Imię != value))
				{
					this.OnImięChanging(value);
					this.SendPropertyChanging();
					this._Imię = value;
					this.SendPropertyChanged("Imię");
					this.OnImięChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Nazwisko", DbType="NVarChar(MAX)")]
		public string Nazwisko
		{
			get
			{
				return this._Nazwisko;
			}
			set
			{
				if ((this._Nazwisko != value))
				{
					this.OnNazwiskoChanging(value);
					this.SendPropertyChanging();
					this._Nazwisko = value;
					this.SendPropertyChanged("Nazwisko");
					this.OnNazwiskoChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_NumerTelefonu", DbType="Int")]
		public System.Nullable<int> NumerTelefonu
		{
			get
			{
				return this._NumerTelefonu;
			}
			set
			{
				if ((this._NumerTelefonu != value))
				{
					this.OnNumerTelefonuChanging(value);
					this.SendPropertyChanging();
					this._NumerTelefonu = value;
					this.SendPropertyChanged("NumerTelefonu");
					this.OnNumerTelefonuChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Wiek", DbType="Int")]
		public System.Nullable<int> Wiek
		{
			get
			{
				return this._Wiek;
			}
			set
			{
				if ((this._Wiek != value))
				{
					this.OnWiekChanging(value);
					this.SendPropertyChanging();
					this._Wiek = value;
					this.SendPropertyChanged("Wiek");
					this.OnWiekChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="ListaOsob_Rozmowy", Storage="_Rozmowies", ThisKey="Id", OtherKey="Id")]
		public EntitySet<Rozmowy> Rozmowies
		{
			get
			{
				return this._Rozmowies;
			}
			set
			{
				this._Rozmowies.Assign(value);
			}
		}
		
		public event PropertyChangingEventHandler PropertyChanging;
		
		public event PropertyChangedEventHandler PropertyChanged;
		
		protected virtual void SendPropertyChanging()
		{
			if ((this.PropertyChanging != null))
			{
				this.PropertyChanging(this, emptyChangingEventArgs);
			}
		}
		
		protected virtual void SendPropertyChanged(String propertyName)
		{
			if ((this.PropertyChanged != null))
			{
				this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
			}
		}
		
		private void attach_Rozmowies(Rozmowy entity)
		{
			this.SendPropertyChanging();
			entity.ListaOsob = this;
		}
		
		private void detach_Rozmowies(Rozmowy entity)
		{
			this.SendPropertyChanging();
			entity.ListaOsob = null;
		}
	}
	
	[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.Rozmowy")]
	public partial class Rozmowy : INotifyPropertyChanging, INotifyPropertyChanged
	{
		
		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
		
		private int _Id;
		
		private string _Rozmowca;
		
		private System.DateTime _Data;
		
		private int _CzasTrwania;
		
		private EntityRef<ListaOsob> _ListaOsob;
		
    #region Extensibility Method Definitions
    partial void OnLoaded();
    partial void OnValidate(System.Data.Linq.ChangeAction action);
    partial void OnCreated();
    partial void OnIdChanging(int value);
    partial void OnIdChanged();
    partial void OnRozmowcaChanging(string value);
    partial void OnRozmowcaChanged();
    partial void OnDataChanging(System.DateTime value);
    partial void OnDataChanged();
    partial void OnCzasTrwaniaChanging(int value);
    partial void OnCzasTrwaniaChanged();
    #endregion
		
		public Rozmowy()
		{
			this._ListaOsob = default(EntityRef<ListaOsob>);
			OnCreated();
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Id", DbType="Int NOT NULL")]
		public int Id
		{
			get
			{
				return this._Id;
			}
			set
			{
				if ((this._Id != value))
				{
					if (this._ListaOsob.HasLoadedOrAssignedValue)
					{
						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
					}
					this.OnIdChanging(value);
					this.SendPropertyChanging();
					this._Id = value;
					this.SendPropertyChanged("Id");
					this.OnIdChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Rozmowca", DbType="NVarChar(MAX) NOT NULL", CanBeNull=false)]
		public string Rozmowca
		{
			get
			{
				return this._Rozmowca;
			}
			set
			{
				if ((this._Rozmowca != value))
				{
					this.OnRozmowcaChanging(value);
					this.SendPropertyChanging();
					this._Rozmowca = value;
					this.SendPropertyChanged("Rozmowca");
					this.OnRozmowcaChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Data", DbType="DateTime NOT NULL", IsPrimaryKey=true)]
		public System.DateTime Data
		{
			get
			{
				return this._Data;
			}
			set
			{
				if ((this._Data != value))
				{
					this.OnDataChanging(value);
					this.SendPropertyChanging();
					this._Data = value;
					this.SendPropertyChanged("Data");
					this.OnDataChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CzasTrwania", DbType="Int NOT NULL")]
		public int CzasTrwania
		{
			get
			{
				return this._CzasTrwania;
			}
			set
			{
				if ((this._CzasTrwania != value))
				{
					this.OnCzasTrwaniaChanging(value);
					this.SendPropertyChanging();
					this._CzasTrwania = value;
					this.SendPropertyChanged("CzasTrwania");
					this.OnCzasTrwaniaChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="ListaOsob_Rozmowy", Storage="_ListaOsob", ThisKey="Id", OtherKey="Id", IsForeignKey=true)]
		public ListaOsob ListaOsob
		{
			get
			{
				return this._ListaOsob.Entity;
			}
			set
			{
				ListaOsob previousValue = this._ListaOsob.Entity;
				if (((previousValue != value) 
							|| (this._ListaOsob.HasLoadedOrAssignedValue == false)))
				{
					this.SendPropertyChanging();
					if ((previousValue != null))
					{
						this._ListaOsob.Entity = null;
						previousValue.Rozmowies.Remove(this);
					}
					this._ListaOsob.Entity = value;
					if ((value != null))
					{
						value.Rozmowies.Add(this);
						this._Id = value.Id;
					}
					else
					{
						this._Id = default(int);
					}
					this.SendPropertyChanged("ListaOsob");
				}
			}
		}
		
		public event PropertyChangingEventHandler PropertyChanging;
		
		public event PropertyChangedEventHandler PropertyChanged;
		
		protected virtual void SendPropertyChanging()
		{
			if ((this.PropertyChanging != null))
			{
				this.PropertyChanging(this, emptyChangingEventArgs);
			}
		}
		
		protected virtual void SendPropertyChanged(String propertyName)
		{
			if ((this.PropertyChanged != null))
			{
				this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
			}
		}
	}
	
	public partial class ListaOsobPelnoletnichResult
	{
		
		private int _Id;
		
		private string _Imię;
		
		private string _Nazwisko;
		
		private System.Nullable<int> _NumerTelefonu;
		
		private System.Nullable<int> _Wiek;
		
		public ListaOsobPelnoletnichResult()
		{
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Id", DbType="Int NOT NULL")]
		public int Id
		{
			get
			{
				return this._Id;
			}
			set
			{
				if ((this._Id != value))
				{
					this._Id = value;
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Imię", DbType="NVarChar(MAX)")]
		public string Imię
		{
			get
			{
				return this._Imię;
			}
			set
			{
				if ((this._Imię != value))
				{
					this._Imię = value;
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Nazwisko", DbType="NVarChar(MAX)")]
		public string Nazwisko
		{
			get
			{
				return this._Nazwisko;
			}
			set
			{
				if ((this._Nazwisko != value))
				{
					this._Nazwisko = value;
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_NumerTelefonu", DbType="Int")]
		public System.Nullable<int> NumerTelefonu
		{
			get
			{
				return this._NumerTelefonu;
			}
			set
			{
				if ((this._NumerTelefonu != value))
				{
					this._NumerTelefonu = value;
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Wiek", DbType="Int")]
		public System.Nullable<int> Wiek
		{
			get
			{
				return this._Wiek;
			}
			set
			{
				if ((this._Wiek != value))
				{
					this._Wiek = value;
				}
			}
		}
	}
}
#pragma warning restore 1591
