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

namespace Platnosci.Core.Linq
{
	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.Runtime.Serialization;
	using System.ComponentModel;
	using System;
    using Platnosci.Core.Interface;
	
	[System.Data.Linq.Mapping.DatabaseAttribute(Name="BAZA_REKLAM_TEST")]
	public partial class PlatnosciDataContext : System.Data.Linq.DataContext
	{
        private static System.Data.Linq.Mapping.MappingSource mappingSource = new AttributeMappingSource();
		
    #region Extensibility Method Definitions
    partial void OnCreated();
    partial void InsertPlatnosciEcard(PlatnosciEcard instance);
    partial void UpdatePlatnosciEcard(PlatnosciEcard instance);
    partial void DeletePlatnosciEcard(PlatnosciEcard instance);
    partial void InsertPotwierdzeniaEcard(PotwierdzeniaEcard instance);
    partial void UpdatePotwierdzeniaEcard(PotwierdzeniaEcard instance);
    partial void DeletePotwierdzeniaEcard(PotwierdzeniaEcard instance);
    partial void InsertFAKTURA_DETAIL(FAKTURA_DETAIL instance);
    partial void UpdateFAKTURA_DETAIL(FAKTURA_DETAIL instance);
    partial void DeleteFAKTURA_DETAIL(FAKTURA_DETAIL instance);
    partial void InsertFAKTURY(FAKTURY instance);
    partial void UpdateFAKTURY(FAKTURY instance);
    partial void DeleteFAKTURY(FAKTURY instance);
    partial void InsertvPlatnosciEcard(vPlatnosciEcard instance);
    partial void UpdatevPlatnosciEcard(vPlatnosciEcard instance);
    partial void DeletevPlatnosciEcard(vPlatnosciEcard instance);
    #endregion
       public PlatnosciDataContext() :base(global::Platnosci.Core.Properties.Settings.Default.BAZA_REKLAM_TESTConnectionString, mappingSource)
		{
           OnCreated();
		}
		
		public PlatnosciDataContext(string connection) : base(connection, mappingSource)
		{
            OnCreated();
		}
		
		public PlatnosciDataContext(System.Data.IDbConnection connection) : base(connection, mappingSource)
		{
            OnCreated();
		}
		
		public PlatnosciDataContext(string connection, System.Data.Linq.Mapping.MappingSource mappingSource) :base(connection, mappingSource)
		{
            OnCreated();
		}
		
		public PlatnosciDataContext(System.Data.IDbConnection connection, System.Data.Linq.Mapping.MappingSource mappingSource) :base(connection, mappingSource)
		{
            OnCreated();
		}
		public System.Data.Linq.Table<PlatnosciEcard> PlatnosciEcards
		{
			get
			{
				return this.GetTable<PlatnosciEcard>();
			}
		}
		
		public System.Data.Linq.Table<PotwierdzeniaEcard> PotwierdzeniaEcards
		{
			get
			{
				return this.GetTable<PotwierdzeniaEcard>();
			}
		}
		
		public System.Data.Linq.Table<FAKTURA_DETAIL> FAKTURA_DETAILs
		{
			get
			{
				return this.GetTable<FAKTURA_DETAIL>();
			}
		}
		
		public System.Data.Linq.Table<FAKTURY> FAKTURies
		{
			get
			{
				return this.GetTable<FAKTURY>();
			}
		}
		
		public System.Data.Linq.Table<vPlatnosciEcard> vPlatnosciEcards
		{
			get
			{
				return this.GetTable<vPlatnosciEcard>();
			}
		}
	}
	
	[Table(Name="dbo.PlatnosciEcard")]
	[DataContract()]
	public partial class PlatnosciEcard : INotifyPropertyChanging, INotifyPropertyChanged
	{
		
		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
		
		private int _ORDERNUMBER;
		
		private System.Nullable<int> _IDFaktury;
		
		private string _ORDERDESCRIPTION;
		
		private string _nip;
		
		private string _nrZlecenia;
		
		private System.Nullable<int> _AMOUNT;
		
		private string _CURRENCY;
		
		private string _SESSIONID;
		
		private string _NAME;
		
		private string _SURNAME;
		
		private System.Nullable<bool> _AUTODEPOSIT;
		
		private string _LANGUAGE;
		
		private string _CHARSET;
		
		private string _COUNTRY;
		
		private System.Nullable<bool> _JS;
		
		private string _PAYMENTTYPE;
		
		private System.Nullable<System.DateTime> _Data;
		
		private System.Nullable<bool> _Status;
		
		private System.Nullable<System.DateTime> _Status_data;
		
		private EntitySet<PotwierdzeniaEcard> _PotwierdzeniaEcards;
		
		private EntityRef<FAKTURY> _FAKTURY;
		
		private bool serializing;
		
    #region Extensibility Method Definitions
    partial void OnLoaded();
    partial void OnValidate(System.Data.Linq.ChangeAction action);
    partial void OnCreated();
    partial void OnORDERNUMBERChanging(int value);
    partial void OnORDERNUMBERChanged();
    partial void OnIDFakturyChanging(System.Nullable<int> value);
    partial void OnIDFakturyChanged();
    partial void OnORDERDESCRIPTIONChanging(string value);
    partial void OnORDERDESCRIPTIONChanged();
    partial void OnnipChanging(string value);
    partial void OnnipChanged();
    partial void OnnrZleceniaChanging(string value);
    partial void OnnrZleceniaChanged();
    partial void OnAMOUNTChanging(System.Nullable<int> value);
    partial void OnAMOUNTChanged();
    partial void OnCURRENCYChanging(string value);
    partial void OnCURRENCYChanged();
    partial void OnSESSIONIDChanging(string value);
    partial void OnSESSIONIDChanged();
    partial void OnNAMEChanging(string value);
    partial void OnNAMEChanged();
    partial void OnSURNAMEChanging(string value);
    partial void OnSURNAMEChanged();
    partial void OnAUTODEPOSITChanging(System.Nullable<bool> value);
    partial void OnAUTODEPOSITChanged();
    partial void OnLANGUAGEChanging(string value);
    partial void OnLANGUAGEChanged();
    partial void OnCHARSETChanging(string value);
    partial void OnCHARSETChanged();
    partial void OnCOUNTRYChanging(string value);
    partial void OnCOUNTRYChanged();
    partial void OnJSChanging(System.Nullable<bool> value);
    partial void OnJSChanged();
    partial void OnPAYMENTTYPEChanging(string value);
    partial void OnPAYMENTTYPEChanged();
    partial void OnDataChanging(System.Nullable<System.DateTime> value);
    partial void OnDataChanged();
    partial void OnStatusChanging(System.Nullable<bool> value);
    partial void OnStatusChanged();
    partial void OnStatus_dataChanging(System.Nullable<System.DateTime> value);
    partial void OnStatus_dataChanged();
    #endregion
		
		public PlatnosciEcard()
		{
			this.Initialize();
		}
		
		[Column(Storage="_ORDERNUMBER", AutoSync=AutoSync.OnInsert, DbType="Int NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)]
		[DataMember(Order=1)]
		public int ORDERNUMBER
		{
			get
			{
				return this._ORDERNUMBER;
			}
			set
			{
				if ((this._ORDERNUMBER != value))
				{
					this.OnORDERNUMBERChanging(value);
					this.SendPropertyChanging();
					this._ORDERNUMBER = value;
					this.SendPropertyChanged("ORDERNUMBER");
					this.OnORDERNUMBERChanged();
				}
			}
		}
		
		[Column(Storage="_IDFaktury", DbType="Int")]
		[DataMember(Order=2)]
        public System.Nullable<int> IDFaktury   
		{
			get
			{
				return this._IDFaktury;
			}
			set
			{
				if ((this._IDFaktury != value))
				{
					if (this._FAKTURY.HasLoadedOrAssignedValue)
					{
						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
					}
					this.OnIDFakturyChanging(value);
					this.SendPropertyChanging();
					this._IDFaktury = value;
					this.SendPropertyChanged("IDFaktury");
					this.OnIDFakturyChanged();
				}
			}
		}
		
		[Column(Storage="_ORDERDESCRIPTION", DbType="VarChar(30)")]
		[DataMember(Order=3)]
		public string ORDERDESCRIPTION
		{
			get
			{
				return this._ORDERDESCRIPTION;
			}
			set
			{
				if ((this._ORDERDESCRIPTION != value))
				{
					this.OnORDERDESCRIPTIONChanging(value);
					this.SendPropertyChanging();
					this._ORDERDESCRIPTION = value;
					this.SendPropertyChanged("ORDERDESCRIPTION");
					this.OnORDERDESCRIPTIONChanged();
				}
			}
		}
		
		[Column(Storage="_nip", DbType="VarChar(20)")]
		[DataMember(Order=4)]
		public string nip
		{
			get
			{
				return this._nip;
			}
			set
			{
				if ((this._nip != value))
				{
					this.OnnipChanging(value);
					this.SendPropertyChanging();
					this._nip = value;
					this.SendPropertyChanged("nip");
					this.OnnipChanged();
				}
			}
		}
		
		[Column(Storage="_nrZlecenia", DbType="VarChar(50)")]
		[DataMember(Order=5)]
		public string nrZlecenia
		{
			get
			{
				return this._nrZlecenia;
			}
			set
			{
				if ((this._nrZlecenia != value))
				{
					this.OnnrZleceniaChanging(value);
					this.SendPropertyChanging();
					this._nrZlecenia = value;
					this.SendPropertyChanged("nrZlecenia");
					this.OnnrZleceniaChanged();
				}
			}
		}
		
		[Column(Storage="_AMOUNT", DbType="Int")]
		[DataMember(Order=6)]
		public System.Nullable<int> AMOUNT
		{
			get
			{
				return this._AMOUNT;
			}
			set
			{
				if ((this._AMOUNT != value))
				{
					this.OnAMOUNTChanging(value);
					this.SendPropertyChanging();
					this._AMOUNT = value;
					this.SendPropertyChanged("AMOUNT");
					this.OnAMOUNTChanged();
				}
			}
		}
		
		[Column(Storage="_CURRENCY", DbType="Char(3)")]
		[DataMember(Order=7)]
		public string CURRENCY
		{
			get
			{
				return this._CURRENCY;
			}
			set
			{
				if ((this._CURRENCY != value))
				{
					this.OnCURRENCYChanging(value);
					this.SendPropertyChanging();
					this._CURRENCY = value;
					this.SendPropertyChanged("CURRENCY");
					this.OnCURRENCYChanged();
				}
			}
		}
		
		[Column(Storage="_SESSIONID", DbType="VarChar(120)")]
		[DataMember(Order=8)]
		public string SESSIONID
		{
			get
			{
				return this._SESSIONID;
			}
			set
			{
				if ((this._SESSIONID != value))
				{
					this.OnSESSIONIDChanging(value);
					this.SendPropertyChanging();
					this._SESSIONID = value;
					this.SendPropertyChanged("SESSIONID");
					this.OnSESSIONIDChanged();
				}
			}
		}
		
		[Column(Storage="_NAME", DbType="VarChar(25)")]
		[DataMember(Order=9)]
		public string NAME
		{
			get
			{
				return this._NAME;
			}
			set
			{
				if ((this._NAME != value))
				{
					this.OnNAMEChanging(value);
					this.SendPropertyChanging();
					this._NAME = value;
					this.SendPropertyChanged("NAME");
					this.OnNAMEChanged();
				}
			}
		}
		
		[Column(Storage="_SURNAME", DbType="VarChar(30)")]
		[DataMember(Order=10)]
		public string SURNAME
		{
			get
			{
				return this._SURNAME;
			}
			set
			{
				if ((this._SURNAME != value))
				{
					this.OnSURNAMEChanging(value);
					this.SendPropertyChanging();
					this._SURNAME = value;
					this.SendPropertyChanged("SURNAME");
					this.OnSURNAMEChanged();
				}
			}
		}
		
		[Column(Storage="_AUTODEPOSIT", DbType="Bit")]
		[DataMember(Order=11)]
		public System.Nullable<bool> AUTODEPOSIT
		{
			get
			{
				return this._AUTODEPOSIT;
			}
			set
			{
				if ((this._AUTODEPOSIT != value))
				{
					this.OnAUTODEPOSITChanging(value);
					this.SendPropertyChanging();
					this._AUTODEPOSIT = value;
					this.SendPropertyChanged("AUTODEPOSIT");
					this.OnAUTODEPOSITChanged();
				}
			}
		}
		
		[Column(Storage="_LANGUAGE", DbType="Char(2)")]
		[DataMember(Order=12)]
		public string LANGUAGE
		{
			get
			{
				return this._LANGUAGE;
			}
			set
			{
				if ((this._LANGUAGE != value))
				{
					this.OnLANGUAGEChanging(value);
					this.SendPropertyChanging();
					this._LANGUAGE = value;
					this.SendPropertyChanged("LANGUAGE");
					this.OnLANGUAGEChanged();
				}
			}
		}
		
		[Column(Storage="_CHARSET", DbType="VarChar(20)")]
		[DataMember(Order=13)]
		public string CHARSET
		{
			get
			{
				return this._CHARSET;
			}
			set
			{
				if ((this._CHARSET != value))
				{
					this.OnCHARSETChanging(value);
					this.SendPropertyChanging();
					this._CHARSET = value;
					this.SendPropertyChanged("CHARSET");
					this.OnCHARSETChanged();
				}
			}
		}
		
		[Column(Storage="_COUNTRY", DbType="Char(3)")]
		[DataMember(Order=14)]
		public string COUNTRY
		{
			get
			{
				return this._COUNTRY;
			}
			set
			{
				if ((this._COUNTRY != value))
				{
					this.OnCOUNTRYChanging(value);
					this.SendPropertyChanging();
					this._COUNTRY = value;
					this.SendPropertyChanged("COUNTRY");
					this.OnCOUNTRYChanged();
				}
			}
		}
		
		[Column(Storage="_JS", DbType="Bit")]
		[DataMember(Order=15)]
		public System.Nullable<bool> JS
		{
			get
			{
				return this._JS;
			}
			set
			{
				if ((this._JS != value))
				{
					this.OnJSChanging(value);
					this.SendPropertyChanging();
					this._JS = value;
					this.SendPropertyChanged("JS");
					this.OnJSChanged();
				}
			}
		}
		
		[Column(Storage="_PAYMENTTYPE", DbType="VarChar(20)")]
		[DataMember(Order=16)]
		public string PAYMENTTYPE
		{
			get
			{
				return this._PAYMENTTYPE;
			}
			set
			{
				if ((this._PAYMENTTYPE != value))
				{
					this.OnPAYMENTTYPEChanging(value);
					this.SendPropertyChanging();
					this._PAYMENTTYPE = value;
					this.SendPropertyChanged("PAYMENTTYPE");
					this.OnPAYMENTTYPEChanged();
				}
			}
		}
		
		[Column(Storage="_Data", DbType="DateTime")]
		[DataMember(Order=17)]
		public System.Nullable<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();
				}
			}
		}
		
		[Column(Storage="_Status", DbType="Bit")]
		[DataMember(Order=18)]
		public System.Nullable<bool> Status
		{
			get
			{
				return this._Status;
			}
			set
			{
				if ((this._Status != value))
				{
					this.OnStatusChanging(value);
					this.SendPropertyChanging();
					this._Status = value;
					this.SendPropertyChanged("Status");
					this.OnStatusChanged();
				}
			}
		}
		
		[Column(Storage="_Status_data", DbType="DateTime")]
		[DataMember(Order=19)]
		public System.Nullable<System.DateTime> Status_data
		{
			get
			{
				return this._Status_data;
			}
			set
			{
				if ((this._Status_data != value))
				{
					this.OnStatus_dataChanging(value);
					this.SendPropertyChanging();
					this._Status_data = value;
					this.SendPropertyChanged("Status_data");
					this.OnStatus_dataChanged();
				}
			}
		}
		
		[Association(Name="PlatnosciEcard_PotwierdzeniaEcard", Storage="_PotwierdzeniaEcards", ThisKey="ORDERNUMBER", OtherKey="ORDERNUMBER")]
		[DataMember(Order=20, EmitDefaultValue=false)]
		public EntitySet<PotwierdzeniaEcard> PotwierdzeniaEcards
		{
			get
			{
				if ((this.serializing 
							&& (this._PotwierdzeniaEcards.HasLoadedOrAssignedValues == false)))
				{
					return null;
				}
				return this._PotwierdzeniaEcards;
			}
			set
			{
				this._PotwierdzeniaEcards.Assign(value);
			}
		}
		
		[Association(Name="FAKTURY_PlatnosciEcard", Storage="_FAKTURY", ThisKey="IDFaktury", OtherKey="ID_FAKTURY", IsForeignKey=true)]
		public FAKTURY FAKTURY
		{
			get
			{
				return this._FAKTURY.Entity;
			}
			set
			{
				FAKTURY previousValue = this._FAKTURY.Entity;
				if (((previousValue != value) 
							|| (this._FAKTURY.HasLoadedOrAssignedValue == false)))
				{
					this.SendPropertyChanging();
					if ((previousValue != null))
					{
						this._FAKTURY.Entity = null;
						previousValue.PlatnosciEcards.Remove(this);
					}
					this._FAKTURY.Entity = value;
					if ((value != null))
					{
						value.PlatnosciEcards.Add(this);
						this._IDFaktury = value.ID_FAKTURY;
					}
					else
					{
						this._IDFaktury = default(Nullable<int>);
					}
					this.SendPropertyChanged("FAKTURY");
				}
			}
		}
		
		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_PotwierdzeniaEcards(PotwierdzeniaEcard entity)
		{
			this.SendPropertyChanging();
			entity.PlatnosciEcard = this;
		}
		
		private void detach_PotwierdzeniaEcards(PotwierdzeniaEcard entity)
		{
			this.SendPropertyChanging();
			entity.PlatnosciEcard = null;
		}
		
		private void Initialize()
		{
			this._PotwierdzeniaEcards = new EntitySet<PotwierdzeniaEcard>(new Action<PotwierdzeniaEcard>(this.attach_PotwierdzeniaEcards), new Action<PotwierdzeniaEcard>(this.detach_PotwierdzeniaEcards));
			this._FAKTURY = default(EntityRef<FAKTURY>);
			OnCreated();
		}
		
		[OnDeserializing()]
		[System.ComponentModel.EditorBrowsableAttribute(EditorBrowsableState.Never)]
		public void OnDeserializing(StreamingContext context)
		{
			this.Initialize();
		}
		
		[OnSerializing()]
		[System.ComponentModel.EditorBrowsableAttribute(EditorBrowsableState.Never)]
		public void OnSerializing(StreamingContext context)
		{
			this.serializing = true;
		}
		
		[OnSerialized()]
		[System.ComponentModel.EditorBrowsableAttribute(EditorBrowsableState.Never)]
		public void OnSerialized(StreamingContext context)
		{
			this.serializing = false;
		}
	}
	
	[Table(Name="dbo.PotwierdzeniaEcard")]
	[DataContract()]
	public partial class PotwierdzeniaEcard : INotifyPropertyChanging, INotifyPropertyChanged
	{
		
		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
		
		private int _id;
		
		private string _MERCHANTNUMBER;
		
		private System.Nullable<int> _ORDERNUMBER;
		
		private string _COMMTYPE;
		
		private string _CURRENTSTATE;
		
		private string _PREVIOUSSTATE;
		
		private System.Nullable<bool> _PAYMENTTYPE;
		
		private System.Nullable<bool> _EVENTTYPE;
		
		private System.Nullable<bool> _PAYMENTNUMBER;
		
		private string _APPROVALCODE;
		
		private string _VALIDATIONCODE;
		
		private string _BIN;
		
		private System.Nullable<System.DateTime> _AUTHTIME;
		
		private string _TYPE;
		
		private string _WITHCVC;
		
		private System.Nullable<System.DateTime> _DATATRANSMISJI;
		
		private EntityRef<PlatnosciEcard> _PlatnosciEcard;
		
    #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 OnMERCHANTNUMBERChanging(string value);
    partial void OnMERCHANTNUMBERChanged();
    partial void OnORDERNUMBERChanging(System.Nullable<int> value);
    partial void OnORDERNUMBERChanged();
    partial void OnCOMMTYPEChanging(string value);
    partial void OnCOMMTYPEChanged();
    partial void OnCURRENTSTATEChanging(string value);
    partial void OnCURRENTSTATEChanged();
    partial void OnPREVIOUSSTATEChanging(string value);
    partial void OnPREVIOUSSTATEChanged();
    partial void OnPAYMENTTYPEChanging(System.Nullable<bool> value);
    partial void OnPAYMENTTYPEChanged();
    partial void OnEVENTTYPEChanging(System.Nullable<bool> value);
    partial void OnEVENTTYPEChanged();
    partial void OnPAYMENTNUMBERChanging(System.Nullable<bool> value);
    partial void OnPAYMENTNUMBERChanged();
    partial void OnAPPROVALCODEChanging(string value);
    partial void OnAPPROVALCODEChanged();
    partial void OnVALIDATIONCODEChanging(string value);
    partial void OnVALIDATIONCODEChanged();
    partial void OnBINChanging(string value);
    partial void OnBINChanged();
    partial void OnAUTHTIMEChanging(System.Nullable<System.DateTime> value);
    partial void OnAUTHTIMEChanged();
    partial void OnTYPEChanging(string value);
    partial void OnTYPEChanged();
    partial void OnWITHCVCChanging(string value);
    partial void OnWITHCVCChanged();
    partial void OnDATATRANSMISJIChanging(System.Nullable<System.DateTime> value);
    partial void OnDATATRANSMISJIChanged();
    #endregion
		
		public PotwierdzeniaEcard()
		{
			this.Initialize();
		}
		
		[Column(Storage="_id", AutoSync=AutoSync.OnInsert, DbType="Int NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)]
		[DataMember(Order=1)]
		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();
				}
			}
		}
		
		[Column(Storage="_MERCHANTNUMBER", DbType="VarChar(50)")]
		[DataMember(Order=2)]
		public string MERCHANTNUMBER
		{
			get
			{
				return this._MERCHANTNUMBER;
			}
			set
			{
				if ((this._MERCHANTNUMBER != value))
				{
					this.OnMERCHANTNUMBERChanging(value);
					this.SendPropertyChanging();
					this._MERCHANTNUMBER = value;
					this.SendPropertyChanged("MERCHANTNUMBER");
					this.OnMERCHANTNUMBERChanged();
				}
			}
		}
		
		[Column(Storage="_ORDERNUMBER", DbType="Int")]
		[DataMember(Order=3)]
		public System.Nullable<int> ORDERNUMBER
		{
			get
			{
				return this._ORDERNUMBER;
			}
			set
			{
				if ((this._ORDERNUMBER != value))
				{
					if (this._PlatnosciEcard.HasLoadedOrAssignedValue)
					{
						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
					}
					this.OnORDERNUMBERChanging(value);
					this.SendPropertyChanging();
					this._ORDERNUMBER = value;
					this.SendPropertyChanged("ORDERNUMBER");
					this.OnORDERNUMBERChanged();
				}
			}
		}
		
		[Column(Storage="_COMMTYPE", DbType="VarChar(50)")]
		[DataMember(Order=4)]
		public string COMMTYPE
		{
			get
			{
				return this._COMMTYPE;
			}
			set
			{
				if ((this._COMMTYPE != value))
				{
					this.OnCOMMTYPEChanging(value);
					this.SendPropertyChanging();
					this._COMMTYPE = value;
					this.SendPropertyChanged("COMMTYPE");
					this.OnCOMMTYPEChanged();
				}
			}
		}
		
		[Column(Storage="_CURRENTSTATE", DbType="VarChar(50)")]
		[DataMember(Order=5)]
		public string CURRENTSTATE
		{
			get
			{
				return this._CURRENTSTATE;
			}
			set
			{
				if ((this._CURRENTSTATE != value))
				{
					this.OnCURRENTSTATEChanging(value);
					this.SendPropertyChanging();
					this._CURRENTSTATE = value;
					this.SendPropertyChanged("CURRENTSTATE");
					this.OnCURRENTSTATEChanged();
				}
			}
		}
		
		[Column(Storage="_PREVIOUSSTATE", DbType="VarChar(50)")]
		[DataMember(Order=6)]
		public string PREVIOUSSTATE
		{
			get
			{
				return this._PREVIOUSSTATE;
			}
			set
			{
				if ((this._PREVIOUSSTATE != value))
				{
					this.OnPREVIOUSSTATEChanging(value);
					this.SendPropertyChanging();
					this._PREVIOUSSTATE = value;
					this.SendPropertyChanged("PREVIOUSSTATE");
					this.OnPREVIOUSSTATEChanged();
				}
			}
		}
		
		[Column(Storage="_PAYMENTTYPE", DbType="Bit")]
		[DataMember(Order=7)]
		public System.Nullable<bool> PAYMENTTYPE
		{
			get
			{
				return this._PAYMENTTYPE;
			}
			set
			{
				if ((this._PAYMENTTYPE != value))
				{
					this.OnPAYMENTTYPEChanging(value);
					this.SendPropertyChanging();
					this._PAYMENTTYPE = value;
					this.SendPropertyChanged("PAYMENTTYPE");
					this.OnPAYMENTTYPEChanged();
				}
			}
		}
		
		[Column(Storage="_EVENTTYPE", DbType="Bit")]
		[DataMember(Order=8)]
		public System.Nullable<bool> EVENTTYPE
		{
			get
			{
				return this._EVENTTYPE;
			}
			set
			{
				if ((this._EVENTTYPE != value))
				{
					this.OnEVENTTYPEChanging(value);
					this.SendPropertyChanging();
					this._EVENTTYPE = value;
					this.SendPropertyChanged("EVENTTYPE");
					this.OnEVENTTYPEChanged();
				}
			}
		}
		
		[Column(Storage="_PAYMENTNUMBER", DbType="Bit")]
		[DataMember(Order=9)]
		public System.Nullable<bool> PAYMENTNUMBER
		{
			get
			{
				return this._PAYMENTNUMBER;
			}
			set
			{
				if ((this._PAYMENTNUMBER != value))
				{
					this.OnPAYMENTNUMBERChanging(value);
					this.SendPropertyChanging();
					this._PAYMENTNUMBER = value;
					this.SendPropertyChanged("PAYMENTNUMBER");
					this.OnPAYMENTNUMBERChanged();
				}
			}
		}
		
		[Column(Storage="_APPROVALCODE", DbType="VarChar(50)")]
		[DataMember(Order=10)]
		public string APPROVALCODE
		{
			get
			{
				return this._APPROVALCODE;
			}
			set
			{
				if ((this._APPROVALCODE != value))
				{
					this.OnAPPROVALCODEChanging(value);
					this.SendPropertyChanging();
					this._APPROVALCODE = value;
					this.SendPropertyChanged("APPROVALCODE");
					this.OnAPPROVALCODEChanged();
				}
			}
		}
		
		[Column(Storage="_VALIDATIONCODE", DbType="Char(3)")]
		[DataMember(Order=11)]
		public string VALIDATIONCODE
		{
			get
			{
				return this._VALIDATIONCODE;
			}
			set
			{
				if ((this._VALIDATIONCODE != value))
				{
					this.OnVALIDATIONCODEChanging(value);
					this.SendPropertyChanging();
					this._VALIDATIONCODE = value;
					this.SendPropertyChanged("VALIDATIONCODE");
					this.OnVALIDATIONCODEChanged();
				}
			}
		}
		
		[Column(Storage="_BIN", DbType="Char(6)")]
		[DataMember(Order=12)]
		public string BIN
		{
			get
			{
				return this._BIN;
			}
			set
			{
				if ((this._BIN != value))
				{
					this.OnBINChanging(value);
					this.SendPropertyChanging();
					this._BIN = value;
					this.SendPropertyChanged("BIN");
					this.OnBINChanged();
				}
			}
		}
		
		[Column(Storage="_AUTHTIME", DbType="DateTime")]
		[DataMember(Order=13)]
		public System.Nullable<System.DateTime> AUTHTIME
		{
			get
			{
				return this._AUTHTIME;
			}
			set
			{
				if ((this._AUTHTIME != value))
				{
					this.OnAUTHTIMEChanging(value);
					this.SendPropertyChanging();
					this._AUTHTIME = value;
					this.SendPropertyChanged("AUTHTIME");
					this.OnAUTHTIMEChanged();
				}
			}
		}
		
		[Column(Storage="_TYPE", DbType="Char(2)")]
		[DataMember(Order=14)]
		public string TYPE
		{
			get
			{
				return this._TYPE;
			}
			set
			{
				if ((this._TYPE != value))
				{
					this.OnTYPEChanging(value);
					this.SendPropertyChanging();
					this._TYPE = value;
					this.SendPropertyChanged("TYPE");
					this.OnTYPEChanged();
				}
			}
		}
		
		[Column(Storage="_WITHCVC", DbType="Char(3)")]
		[DataMember(Order=15)]
		public string WITHCVC
		{
			get
			{
				return this._WITHCVC;
			}
			set
			{
				if ((this._WITHCVC != value))
				{
					this.OnWITHCVCChanging(value);
					this.SendPropertyChanging();
					this._WITHCVC = value;
					this.SendPropertyChanged("WITHCVC");
					this.OnWITHCVCChanged();
				}
			}
		}
		
		[Column(Storage="_DATATRANSMISJI", DbType="DateTime")]
		[DataMember(Order=16)]
		public System.Nullable<System.DateTime> DATATRANSMISJI
		{
			get
			{
				return this._DATATRANSMISJI;
			}
			set
			{
				if ((this._DATATRANSMISJI != value))
				{
					this.OnDATATRANSMISJIChanging(value);
					this.SendPropertyChanging();
					this._DATATRANSMISJI = value;
					this.SendPropertyChanged("DATATRANSMISJI");
					this.OnDATATRANSMISJIChanged();
				}
			}
		}
		
		[Association(Name="PlatnosciEcard_PotwierdzeniaEcard", Storage="_PlatnosciEcard", ThisKey="ORDERNUMBER", OtherKey="ORDERNUMBER", IsForeignKey=true)]
		public PlatnosciEcard PlatnosciEcard
		{
			get
			{
				return this._PlatnosciEcard.Entity;
			}
			set
			{
				PlatnosciEcard previousValue = this._PlatnosciEcard.Entity;
				if (((previousValue != value) 
							|| (this._PlatnosciEcard.HasLoadedOrAssignedValue == false)))
				{
					this.SendPropertyChanging();
					if ((previousValue != null))
					{
						this._PlatnosciEcard.Entity = null;
						previousValue.PotwierdzeniaEcards.Remove(this);
					}
					this._PlatnosciEcard.Entity = value;
					if ((value != null))
					{
						value.PotwierdzeniaEcards.Add(this);
						this._ORDERNUMBER = value.ORDERNUMBER;
					}
					else
					{
						this._ORDERNUMBER = default(Nullable<int>);
					}
					this.SendPropertyChanged("PlatnosciEcard");
				}
			}
		}
		
		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 Initialize()
		{
			this._PlatnosciEcard = default(EntityRef<PlatnosciEcard>);
			OnCreated();
		}
		
		[OnDeserializing()]
		[System.ComponentModel.EditorBrowsableAttribute(EditorBrowsableState.Never)]
		public void OnDeserializing(StreamingContext context)
		{
			this.Initialize();
		}
	}
	
	[Table(Name="dbo.FAKTURA_DETAILS")]
	[DataContract()]
	public partial class FAKTURA_DETAIL : INotifyPropertyChanging, INotifyPropertyChanged
	{
		
		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
		
		private int _ID_FAKTURA_DETAILS;
		
		private System.Nullable<int> _ID_FAKTURY;
		
		private System.Nullable<int> _ROK;
		
		private System.Nullable<short> _MIESIAC;
		
		private string _NAZWA_USLUGI;
		
		private string _SYMBOL_SWW;
		
		private string _JM;
		
		private System.Nullable<int> _ILOSC;
		
		private System.Nullable<decimal> _CENA_JEDN;
		
		private System.Nullable<double> _UPUST_PR;
		
		private System.Nullable<decimal> _UPUST_NETTO;
		
		private System.Nullable<decimal> _NETTO;
		
		private System.Nullable<double> _S_VAT;
		
		private System.Nullable<decimal> _VAT;
		
		private System.Nullable<decimal> _BRUTTO;
		
		private System.Nullable<short> _TYTUL;
		
		private System.Nullable<short> _NR_WYDANIA;
		
		private System.Nullable<short> _TYP;
		
		private System.Nullable<short> _PODTYP;
		
		private System.Nullable<bool> _wyroznienie;
		
		private System.Nullable<int> _reklamaId;
		
		private System.Guid _msrepl_tran_version;
		
		private EntityRef<FAKTURY> _FAKTURY;
		
    #region Extensibility Method Definitions
    partial void OnLoaded();
    partial void OnValidate(System.Data.Linq.ChangeAction action);
    partial void OnCreated();
    partial void OnID_FAKTURA_DETAILSChanging(int value);
    partial void OnID_FAKTURA_DETAILSChanged();
    partial void OnID_FAKTURYChanging(System.Nullable<int> value);
    partial void OnID_FAKTURYChanged();
    partial void OnROKChanging(System.Nullable<int> value);
    partial void OnROKChanged();
    partial void OnMIESIACChanging(System.Nullable<short> value);
    partial void OnMIESIACChanged();
    partial void OnNAZWA_USLUGIChanging(string value);
    partial void OnNAZWA_USLUGIChanged();
    partial void OnSYMBOL_SWWChanging(string value);
    partial void OnSYMBOL_SWWChanged();
    partial void OnJMChanging(string value);
    partial void OnJMChanged();
    partial void OnILOSCChanging(System.Nullable<int> value);
    partial void OnILOSCChanged();
    partial void OnCENA_JEDNChanging(System.Nullable<decimal> value);
    partial void OnCENA_JEDNChanged();
    partial void OnUPUST_PRChanging(System.Nullable<double> value);
    partial void OnUPUST_PRChanged();
    partial void OnUPUST_NETTOChanging(System.Nullable<decimal> value);
    partial void OnUPUST_NETTOChanged();
    partial void OnNETTOChanging(System.Nullable<decimal> value);
    partial void OnNETTOChanged();
    partial void OnS_VATChanging(System.Nullable<double> value);
    partial void OnS_VATChanged();
    partial void OnVATChanging(System.Nullable<decimal> value);
    partial void OnVATChanged();
    partial void OnBRUTTOChanging(System.Nullable<decimal> value);
    partial void OnBRUTTOChanged();
    partial void OnTYTULChanging(System.Nullable<short> value);
    partial void OnTYTULChanged();
    partial void OnNR_WYDANIAChanging(System.Nullable<short> value);
    partial void OnNR_WYDANIAChanged();
    partial void OnTYPChanging(System.Nullable<short> value);
    partial void OnTYPChanged();
    partial void OnPODTYPChanging(System.Nullable<short> value);
    partial void OnPODTYPChanged();
    partial void OnwyroznienieChanging(System.Nullable<bool> value);
    partial void OnwyroznienieChanged();
    partial void OnreklamaIdChanging(System.Nullable<int> value);
    partial void OnreklamaIdChanged();
    partial void Onmsrepl_tran_versionChanging(System.Guid value);
    partial void Onmsrepl_tran_versionChanged();
    #endregion
		
		public FAKTURA_DETAIL()
		{
			this.Initialize();
		}
		
		[Column(Storage="_ID_FAKTURA_DETAILS", AutoSync=AutoSync.OnInsert, DbType="Int NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)]
		[DataMember(Order=1)]
		public int ID_FAKTURA_DETAILS
		{
			get
			{
				return this._ID_FAKTURA_DETAILS;
			}
			set
			{
				if ((this._ID_FAKTURA_DETAILS != value))
				{
					this.OnID_FAKTURA_DETAILSChanging(value);
					this.SendPropertyChanging();
					this._ID_FAKTURA_DETAILS = value;
					this.SendPropertyChanged("ID_FAKTURA_DETAILS");
					this.OnID_FAKTURA_DETAILSChanged();
				}
			}
		}
		
		[Column(Storage="_ID_FAKTURY", DbType="Int")]
		[DataMember(Order=2)]
		public System.Nullable<int> ID_FAKTURY
		{
			get
			{
				return this._ID_FAKTURY;
			}
			set
			{
				if ((this._ID_FAKTURY != value))
				{
					if (this._FAKTURY.HasLoadedOrAssignedValue)
					{
						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
					}
					this.OnID_FAKTURYChanging(value);
					this.SendPropertyChanging();
					this._ID_FAKTURY = value;
					this.SendPropertyChanged("ID_FAKTURY");
					this.OnID_FAKTURYChanged();
				}
			}
		}
		
		[Column(Storage="_ROK", DbType="Int")]
		[DataMember(Order=3)]
		public System.Nullable<int> ROK
		{
			get
			{
				return this._ROK;
			}
			set
			{
				if ((this._ROK != value))
				{
					this.OnROKChanging(value);
					this.SendPropertyChanging();
					this._ROK = value;
					this.SendPropertyChanged("ROK");
					this.OnROKChanged();
				}
			}
		}
		
		[Column(Storage="_MIESIAC", DbType="SmallInt")]
		[DataMember(Order=4)]
		public System.Nullable<short> MIESIAC
		{
			get
			{
				return this._MIESIAC;
			}
			set
			{
				if ((this._MIESIAC != value))
				{
					this.OnMIESIACChanging(value);
					this.SendPropertyChanging();
					this._MIESIAC = value;
					this.SendPropertyChanged("MIESIAC");
					this.OnMIESIACChanged();
				}
			}
		}
		
		[Column(Storage="_NAZWA_USLUGI", DbType="NVarChar(100)")]
		[DataMember(Order=5)]
		public string NAZWA_USLUGI
		{
			get
			{
				return this._NAZWA_USLUGI;
			}
			set
			{
				if ((this._NAZWA_USLUGI != value))
				{
					this.OnNAZWA_USLUGIChanging(value);
					this.SendPropertyChanging();
					this._NAZWA_USLUGI = value;
					this.SendPropertyChanged("NAZWA_USLUGI");
					this.OnNAZWA_USLUGIChanged();
				}
			}
		}
		
		[Column(Storage="_SYMBOL_SWW", DbType="NVarChar(30)")]
		[DataMember(Order=6)]
		public string SYMBOL_SWW
		{
			get
			{
				return this._SYMBOL_SWW;
			}
			set
			{
				if ((this._SYMBOL_SWW != value))
				{
					this.OnSYMBOL_SWWChanging(value);
					this.SendPropertyChanging();
					this._SYMBOL_SWW = value;
					this.SendPropertyChanged("SYMBOL_SWW");
					this.OnSYMBOL_SWWChanged();
				}
			}
		}
		
		[Column(Storage="_JM", DbType="NVarChar(5)")]
		[DataMember(Order=7)]
		public string JM
		{
			get
			{
				return this._JM;
			}
			set
			{
				if ((this._JM != value))
				{
					this.OnJMChanging(value);
					this.SendPropertyChanging();
					this._JM = value;
					this.SendPropertyChanged("JM");
					this.OnJMChanged();
				}
			}
		}
		
		[Column(Storage="_ILOSC", DbType="Int")]
		[DataMember(Order=8)]
		public System.Nullable<int> ILOSC
		{
			get
			{
				return this._ILOSC;
			}
			set
			{
				if ((this._ILOSC != value))
				{
					this.OnILOSCChanging(value);
					this.SendPropertyChanging();
					this._ILOSC = value;
					this.SendPropertyChanged("ILOSC");
					this.OnILOSCChanged();
				}
			}
		}
		
		[Column(Storage="_CENA_JEDN", DbType="Money")]
		[DataMember(Order=9)]
		public System.Nullable<decimal> CENA_JEDN
		{
			get
			{
				return this._CENA_JEDN;
			}
			set
			{
				if ((this._CENA_JEDN != value))
				{
					this.OnCENA_JEDNChanging(value);
					this.SendPropertyChanging();
					this._CENA_JEDN = value;
					this.SendPropertyChanged("CENA_JEDN");
					this.OnCENA_JEDNChanged();
				}
			}
		}
		
		[Column(Storage="_UPUST_PR", DbType="Float")]
		[DataMember(Order=10)]
		public System.Nullable<double> UPUST_PR
		{
			get
			{
				return this._UPUST_PR;
			}
			set
			{
				if ((this._UPUST_PR != value))
				{
					this.OnUPUST_PRChanging(value);
					this.SendPropertyChanging();
					this._UPUST_PR = value;
					this.SendPropertyChanged("UPUST_PR");
					this.OnUPUST_PRChanged();
				}
			}
		}
		
		[Column(Storage="_UPUST_NETTO", DbType="Money")]
		[DataMember(Order=11)]
		public System.Nullable<decimal> UPUST_NETTO
		{
			get
			{
				return this._UPUST_NETTO;
			}
			set
			{
				if ((this._UPUST_NETTO != value))
				{
					this.OnUPUST_NETTOChanging(value);
					this.SendPropertyChanging();
					this._UPUST_NETTO = value;
					this.SendPropertyChanged("UPUST_NETTO");
					this.OnUPUST_NETTOChanged();
				}
			}
		}
		
		[Column(Storage="_NETTO", DbType="Money")]
		[DataMember(Order=12)]
		public System.Nullable<decimal> NETTO
		{
			get
			{
				return this._NETTO;
			}
			set
			{
				if ((this._NETTO != value))
				{
					this.OnNETTOChanging(value);
					this.SendPropertyChanging();
					this._NETTO = value;
					this.SendPropertyChanged("NETTO");
					this.OnNETTOChanged();
				}
			}
		}
		
		[Column(Storage="_S_VAT", DbType="Float")]
		[DataMember(Order=13)]
		public System.Nullable<double> S_VAT
		{
			get
			{
				return this._S_VAT;
			}
			set
			{
				if ((this._S_VAT != value))
				{
					this.OnS_VATChanging(value);
					this.SendPropertyChanging();
					this._S_VAT = value;
					this.SendPropertyChanged("S_VAT");
					this.OnS_VATChanged();
				}
			}
		}
		
		[Column(Storage="_VAT", DbType="Money")]
		[DataMember(Order=14)]
		public System.Nullable<decimal> VAT
		{
			get
			{
				return this._VAT;
			}
			set
			{
				if ((this._VAT != value))
				{
					this.OnVATChanging(value);
					this.SendPropertyChanging();
					this._VAT = value;
					this.SendPropertyChanged("VAT");
					this.OnVATChanged();
				}
			}
		}
		
		[Column(Storage="_BRUTTO", DbType="Money")]
		[DataMember(Order=15)]
		public System.Nullable<decimal> BRUTTO
		{
			get
			{
				return this._BRUTTO;
			}
			set
			{
				if ((this._BRUTTO != value))
				{
					this.OnBRUTTOChanging(value);
					this.SendPropertyChanging();
					this._BRUTTO = value;
					this.SendPropertyChanged("BRUTTO");
					this.OnBRUTTOChanged();
				}
			}
		}
		
		[Column(Storage="_TYTUL", DbType="SmallInt")]
		[DataMember(Order=16)]
		public System.Nullable<short> TYTUL
		{
			get
			{
				return this._TYTUL;
			}
			set
			{
				if ((this._TYTUL != value))
				{
					this.OnTYTULChanging(value);
					this.SendPropertyChanging();
					this._TYTUL = value;
					this.SendPropertyChanged("TYTUL");
					this.OnTYTULChanged();
				}
			}
		}
		
		[Column(Storage="_NR_WYDANIA", DbType="SmallInt")]
		[DataMember(Order=17)]
		public System.Nullable<short> NR_WYDANIA
		{
			get
			{
				return this._NR_WYDANIA;
			}
			set
			{
				if ((this._NR_WYDANIA != value))
				{
					this.OnNR_WYDANIAChanging(value);
					this.SendPropertyChanging();
					this._NR_WYDANIA = value;
					this.SendPropertyChanged("NR_WYDANIA");
					this.OnNR_WYDANIAChanged();
				}
			}
		}
		
		[Column(Storage="_TYP", DbType="SmallInt")]
		[DataMember(Order=18)]
		public System.Nullable<short> TYP
		{
			get
			{
				return this._TYP;
			}
			set
			{
				if ((this._TYP != value))
				{
					this.OnTYPChanging(value);
					this.SendPropertyChanging();
					this._TYP = value;
					this.SendPropertyChanged("TYP");
					this.OnTYPChanged();
				}
			}
		}
		
		[Column(Storage="_PODTYP", DbType="SmallInt")]
		[DataMember(Order=19)]
		public System.Nullable<short> PODTYP
		{
			get
			{
				return this._PODTYP;
			}
			set
			{
				if ((this._PODTYP != value))
				{
					this.OnPODTYPChanging(value);
					this.SendPropertyChanging();
					this._PODTYP = value;
					this.SendPropertyChanged("PODTYP");
					this.OnPODTYPChanged();
				}
			}
		}
		
		[Column(Storage="_wyroznienie", DbType="Bit")]
		[DataMember(Order=20)]
		public System.Nullable<bool> wyroznienie
		{
			get
			{
				return this._wyroznienie;
			}
			set
			{
				if ((this._wyroznienie != value))
				{
					this.OnwyroznienieChanging(value);
					this.SendPropertyChanging();
					this._wyroznienie = value;
					this.SendPropertyChanged("wyroznienie");
					this.OnwyroznienieChanged();
				}
			}
		}
		
		[Column(Storage="_reklamaId", DbType="Int")]
		[DataMember(Order=21)]
		public System.Nullable<int> reklamaId
		{
			get
			{
				return this._reklamaId;
			}
			set
			{
				if ((this._reklamaId != value))
				{
					this.OnreklamaIdChanging(value);
					this.SendPropertyChanging();
					this._reklamaId = value;
					this.SendPropertyChanged("reklamaId");
					this.OnreklamaIdChanged();
				}
			}
		}
		
		[Column(Storage="_msrepl_tran_version", DbType="UniqueIdentifier NOT NULL")]
		[DataMember(Order=22)]
		public System.Guid msrepl_tran_version
		{
			get
			{
				return this._msrepl_tran_version;
			}
			set
			{
				if ((this._msrepl_tran_version != value))
				{
					this.Onmsrepl_tran_versionChanging(value);
					this.SendPropertyChanging();
					this._msrepl_tran_version = value;
					this.SendPropertyChanged("msrepl_tran_version");
					this.Onmsrepl_tran_versionChanged();
				}
			}
		}
		
		[Association(Name="FAKTURY_FAKTURA_DETAIL", Storage="_FAKTURY", ThisKey="ID_FAKTURY", OtherKey="ID_FAKTURY", IsForeignKey=true)]
		public FAKTURY FAKTURY
		{
			get
			{
				return this._FAKTURY.Entity;
			}
			set
			{
				FAKTURY previousValue = this._FAKTURY.Entity;
				if (((previousValue != value) 
							|| (this._FAKTURY.HasLoadedOrAssignedValue == false)))
				{
					this.SendPropertyChanging();
					if ((previousValue != null))
					{
						this._FAKTURY.Entity = null;
						previousValue.FAKTURA_DETAILs.Remove(this);
					}
					this._FAKTURY.Entity = value;
					if ((value != null))
					{
						value.FAKTURA_DETAILs.Add(this);
						this._ID_FAKTURY = value.ID_FAKTURY;
					}
					else
					{
						this._ID_FAKTURY = default(Nullable<int>);
					}
					this.SendPropertyChanged("FAKTURY");
				}
			}
		}
		
		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 Initialize()
		{
			this._FAKTURY = default(EntityRef<FAKTURY>);
			OnCreated();
		}
		
		[OnDeserializing()]
		[System.ComponentModel.EditorBrowsableAttribute(EditorBrowsableState.Never)]
		public void OnDeserializing(StreamingContext context)
		{
			this.Initialize();
		}
	}
	
	[Table(Name="dbo.FAKTURY")]
	[DataContract()]
	public partial class FAKTURY : INotifyPropertyChanging, INotifyPropertyChanged
	{
		
		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
		
		private int _ID_FAKTURY;
		
		private System.Nullable<int> _NUMER;
		
		private string _NUMER_ROZ;
		
		private System.Nullable<int> _NUMER_ROK;
		
		private System.Nullable<System.DateTime> _DATA_WYSTAWIENIA;
		
		private string _MIEJSCOWOSC_WYSTAWIENIA;
		
		private System.Nullable<int> _ID_SPRZEDAWCY;
		
		private System.Nullable<int> _ID_NABYWCY;
		
		private System.Nullable<System.DateTime> _DATA_SPRZEDAZY;
		
		private string _PODPIS_WYSTAWIL;
		
		private string _PODPIS_ODEBRAL;
		
		private string _opis;
		
		private string _SPOSOB_ZAPLATY;
		
		private System.Nullable<System.DateTime> _TERMIN_ZAPLATY;
		
		private System.Nullable<bool> _ZAPLACONO;
		
		private System.Nullable<bool> _BYL_WYDRUK;
		
		private string _NABYWCA_ADRES;
		
		private string _SPRZEDAWCA_ADRES;
		
		private string _SPRZEDAWCA_NIP;
		
		private string _NABYWCA_NIP;
		
		private System.Nullable<short> _FAKTURA_TYP;
		
		private System.Nullable<short> _FAKTURA_PODTYP;
		
		private System.Nullable<short> _ID_KONTA;
		
		private bool _EKSPORT;
		
		private bool _EXPORTED;
		
		private System.Nullable<short> _ID_TYTUL;
		
		private System.Nullable<System.DateTime> _EXPORTED_DATA;
		
		private System.Nullable<decimal> _suma_zaplat;
		
		private System.Nullable<int> _ID_FK_KOR;
		
		private System.Nullable<bool> _KOREKTA;
		
		private System.Nullable<System.DateTime> _zaplata_data;
		
		private string _zaplata_opis;
		
		private System.Nullable<decimal> _Zaliczka_Brutto;
		
		private System.Nullable<System.DateTime> _Zaliczka_Data;
		
		private System.Nullable<double> _waluta_brutto;
		
		private string _waluta_miano;
		
		private System.Nullable<double> _waluta_kurs;
		
		private System.Nullable<int> _waluta_przelicznik;
		
		private System.Nullable<System.DateTime> _waluta_kurs_z_dnia;
		
		private string _waluta_tabela_nr;
		
		private System.Nullable<int> _idZamowienia;
		
		private System.Nullable<int> _idFakturyKorekta;
		
		private System.Nullable<int> _idFakturyVAT;
		
		private System.Nullable<byte> _SystemKsiegowyId;
		
		private bool _ZmianaEmisji;
		
		private EntitySet<PlatnosciEcard> _PlatnosciEcards;
		
		private EntitySet<FAKTURA_DETAIL> _FAKTURA_DETAILs;
		
		private EntitySet<vPlatnosciEcard> _vDanePlatnosciEcards;
		
		private bool serializing;
		
    #region Extensibility Method Definitions
    partial void OnLoaded();
    partial void OnValidate(System.Data.Linq.ChangeAction action);
    partial void OnCreated();
    partial void OnID_FAKTURYChanging(int value);
    partial void OnID_FAKTURYChanged();
    partial void OnNUMERChanging(System.Nullable<int> value);
    partial void OnNUMERChanged();
    partial void OnNUMER_ROZChanging(string value);
    partial void OnNUMER_ROZChanged();
    partial void OnNUMER_ROKChanging(System.Nullable<int> value);
    partial void OnNUMER_ROKChanged();
    partial void OnDATA_WYSTAWIENIAChanging(System.Nullable<System.DateTime> value);
    partial void OnDATA_WYSTAWIENIAChanged();
    partial void OnMIEJSCOWOSC_WYSTAWIENIAChanging(string value);
    partial void OnMIEJSCOWOSC_WYSTAWIENIAChanged();
    partial void OnID_SPRZEDAWCYChanging(System.Nullable<int> value);
    partial void OnID_SPRZEDAWCYChanged();
    partial void OnID_NABYWCYChanging(System.Nullable<int> value);
    partial void OnID_NABYWCYChanged();
    partial void OnDATA_SPRZEDAZYChanging(System.Nullable<System.DateTime> value);
    partial void OnDATA_SPRZEDAZYChanged();
    partial void OnPODPIS_WYSTAWILChanging(string value);
    partial void OnPODPIS_WYSTAWILChanged();
    partial void OnPODPIS_ODEBRALChanging(string value);
    partial void OnPODPIS_ODEBRALChanged();
    partial void OnopisChanging(string value);
    partial void OnopisChanged();
    partial void OnSPOSOB_ZAPLATYChanging(string value);
    partial void OnSPOSOB_ZAPLATYChanged();
    partial void OnTERMIN_ZAPLATYChanging(System.Nullable<System.DateTime> value);
    partial void OnTERMIN_ZAPLATYChanged();
    partial void OnZAPLACONOChanging(System.Nullable<bool> value);
    partial void OnZAPLACONOChanged();
    partial void OnBYL_WYDRUKChanging(System.Nullable<bool> value);
    partial void OnBYL_WYDRUKChanged();
    partial void OnNABYWCA_ADRESChanging(string value);
    partial void OnNABYWCA_ADRESChanged();
    partial void OnSPRZEDAWCA_ADRESChanging(string value);
    partial void OnSPRZEDAWCA_ADRESChanged();
    partial void OnSPRZEDAWCA_NIPChanging(string value);
    partial void OnSPRZEDAWCA_NIPChanged();
    partial void OnNABYWCA_NIPChanging(string value);
    partial void OnNABYWCA_NIPChanged();
    partial void OnFAKTURA_TYPChanging(System.Nullable<short> value);
    partial void OnFAKTURA_TYPChanged();
    partial void OnFAKTURA_PODTYPChanging(System.Nullable<short> value);
    partial void OnFAKTURA_PODTYPChanged();
    partial void OnID_KONTAChanging(System.Nullable<short> value);
    partial void OnID_KONTAChanged();
    partial void OnEKSPORTChanging(bool value);
    partial void OnEKSPORTChanged();
    partial void OnEXPORTEDChanging(bool value);
    partial void OnEXPORTEDChanged();
    partial void OnID_TYTULChanging(System.Nullable<short> value);
    partial void OnID_TYTULChanged();
    partial void OnEXPORTED_DATAChanging(System.Nullable<System.DateTime> value);
    partial void OnEXPORTED_DATAChanged();
    partial void Onsuma_zaplatChanging(System.Nullable<decimal> value);
    partial void Onsuma_zaplatChanged();
    partial void OnID_FK_KORChanging(System.Nullable<int> value);
    partial void OnID_FK_KORChanged();
    partial void OnKOREKTAChanging(System.Nullable<bool> value);
    partial void OnKOREKTAChanged();
    partial void Onzaplata_dataChanging(System.Nullable<System.DateTime> value);
    partial void Onzaplata_dataChanged();
    partial void Onzaplata_opisChanging(string value);
    partial void Onzaplata_opisChanged();
    partial void OnZaliczka_BruttoChanging(System.Nullable<decimal> value);
    partial void OnZaliczka_BruttoChanged();
    partial void OnZaliczka_DataChanging(System.Nullable<System.DateTime> value);
    partial void OnZaliczka_DataChanged();
    partial void Onwaluta_bruttoChanging(System.Nullable<double> value);
    partial void Onwaluta_bruttoChanged();
    partial void Onwaluta_mianoChanging(string value);
    partial void Onwaluta_mianoChanged();
    partial void Onwaluta_kursChanging(System.Nullable<double> value);
    partial void Onwaluta_kursChanged();
    partial void Onwaluta_przelicznikChanging(System.Nullable<int> value);
    partial void Onwaluta_przelicznikChanged();
    partial void Onwaluta_kurs_z_dniaChanging(System.Nullable<System.DateTime> value);
    partial void Onwaluta_kurs_z_dniaChanged();
    partial void Onwaluta_tabela_nrChanging(string value);
    partial void Onwaluta_tabela_nrChanged();
    partial void OnidZamowieniaChanging(System.Nullable<int> value);
    partial void OnidZamowieniaChanged();
    partial void OnidFakturyKorektaChanging(System.Nullable<int> value);
    partial void OnidFakturyKorektaChanged();
    partial void OnidFakturyVATChanging(System.Nullable<int> value);
    partial void OnidFakturyVATChanged();
    partial void OnSystemKsiegowyIdChanging(System.Nullable<byte> value);
    partial void OnSystemKsiegowyIdChanged();
    partial void OnZmianaEmisjiChanging(bool value);
    partial void OnZmianaEmisjiChanged();
    #endregion
		
		public FAKTURY()
		{
			this.Initialize();
		}
		
		[Column(Storage="_ID_FAKTURY", AutoSync=AutoSync.OnInsert, DbType="Int NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)]
		[DataMember(Order=1)]
		public int ID_FAKTURY
		{
			get
			{
				return this._ID_FAKTURY;
			}
			set
			{
				if ((this._ID_FAKTURY != value))
				{
					this.OnID_FAKTURYChanging(value);
					this.SendPropertyChanging();
					this._ID_FAKTURY = value;
					this.SendPropertyChanged("ID_FAKTURY");
					this.OnID_FAKTURYChanged();
				}
			}
		}
		
		[Column(Storage="_NUMER", DbType="Int")]
		[DataMember(Order=2)]
		public System.Nullable<int> NUMER
		{
			get
			{
				return this._NUMER;
			}
			set
			{
				if ((this._NUMER != value))
				{
					this.OnNUMERChanging(value);
					this.SendPropertyChanging();
					this._NUMER = value;
					this.SendPropertyChanged("NUMER");
					this.OnNUMERChanged();
				}
			}
		}
		
		[Column(Storage="_NUMER_ROZ", DbType="NVarChar(8)")]
		[DataMember(Order=3)]
		public string NUMER_ROZ
		{
			get
			{
				return this._NUMER_ROZ;
			}
			set
			{
				if ((this._NUMER_ROZ != value))
				{
					this.OnNUMER_ROZChanging(value);
					this.SendPropertyChanging();
					this._NUMER_ROZ = value;
					this.SendPropertyChanged("NUMER_ROZ");
					this.OnNUMER_ROZChanged();
				}
			}
		}
		
		[Column(Storage="_NUMER_ROK", DbType="Int")]
		[DataMember(Order=4)]
		public System.Nullable<int> NUMER_ROK
		{
			get
			{
				return this._NUMER_ROK;
			}
			set
			{
				if ((this._NUMER_ROK != value))
				{
					this.OnNUMER_ROKChanging(value);
					this.SendPropertyChanging();
					this._NUMER_ROK = value;
					this.SendPropertyChanged("NUMER_ROK");
					this.OnNUMER_ROKChanged();
				}
			}
		}
		
		[Column(Storage="_DATA_WYSTAWIENIA", DbType="DateTime")]
		[DataMember(Order=5)]
		public System.Nullable<System.DateTime> DATA_WYSTAWIENIA
		{
			get
			{
				return this._DATA_WYSTAWIENIA;
			}
			set
			{
				if ((this._DATA_WYSTAWIENIA != value))
				{
					this.OnDATA_WYSTAWIENIAChanging(value);
					this.SendPropertyChanging();
					this._DATA_WYSTAWIENIA = value;
					this.SendPropertyChanged("DATA_WYSTAWIENIA");
					this.OnDATA_WYSTAWIENIAChanged();
				}
			}
		}
		
		[Column(Storage="_MIEJSCOWOSC_WYSTAWIENIA", DbType="NVarChar(30)")]
		[DataMember(Order=6)]
		public string MIEJSCOWOSC_WYSTAWIENIA
		{
			get
			{
				return this._MIEJSCOWOSC_WYSTAWIENIA;
			}
			set
			{
				if ((this._MIEJSCOWOSC_WYSTAWIENIA != value))
				{
					this.OnMIEJSCOWOSC_WYSTAWIENIAChanging(value);
					this.SendPropertyChanging();
					this._MIEJSCOWOSC_WYSTAWIENIA = value;
					this.SendPropertyChanged("MIEJSCOWOSC_WYSTAWIENIA");
					this.OnMIEJSCOWOSC_WYSTAWIENIAChanged();
				}
			}
		}
		
		[Column(Storage="_ID_SPRZEDAWCY", DbType="Int")]
		[DataMember(Order=7)]
		public System.Nullable<int> ID_SPRZEDAWCY
		{
			get
			{
				return this._ID_SPRZEDAWCY;
			}
			set
			{
				if ((this._ID_SPRZEDAWCY != value))
				{
					this.OnID_SPRZEDAWCYChanging(value);
					this.SendPropertyChanging();
					this._ID_SPRZEDAWCY = value;
					this.SendPropertyChanged("ID_SPRZEDAWCY");
					this.OnID_SPRZEDAWCYChanged();
				}
			}
		}
		
		[Column(Storage="_ID_NABYWCY", DbType="Int")]
		[DataMember(Order=8)]
		public System.Nullable<int> ID_NABYWCY
		{
			get
			{
				return this._ID_NABYWCY;
			}
			set
			{
				if ((this._ID_NABYWCY != value))
				{
					this.OnID_NABYWCYChanging(value);
					this.SendPropertyChanging();
					this._ID_NABYWCY = value;
					this.SendPropertyChanged("ID_NABYWCY");
					this.OnID_NABYWCYChanged();
				}
			}
		}
		
		[Column(Storage="_DATA_SPRZEDAZY", DbType="DateTime")]
		[DataMember(Order=9)]
		public System.Nullable<System.DateTime> DATA_SPRZEDAZY
		{
			get
			{
				return this._DATA_SPRZEDAZY;
			}
			set
			{
				if ((this._DATA_SPRZEDAZY != value))
				{
					this.OnDATA_SPRZEDAZYChanging(value);
					this.SendPropertyChanging();
					this._DATA_SPRZEDAZY = value;
					this.SendPropertyChanged("DATA_SPRZEDAZY");
					this.OnDATA_SPRZEDAZYChanged();
				}
			}
		}
		
		[Column(Storage="_PODPIS_WYSTAWIL", DbType="NVarChar(30)")]
		[DataMember(Order=10)]
		public string PODPIS_WYSTAWIL
		{
			get
			{
				return this._PODPIS_WYSTAWIL;
			}
			set
			{
				if ((this._PODPIS_WYSTAWIL != value))
				{
					this.OnPODPIS_WYSTAWILChanging(value);
					this.SendPropertyChanging();
					this._PODPIS_WYSTAWIL = value;
					this.SendPropertyChanged("PODPIS_WYSTAWIL");
					this.OnPODPIS_WYSTAWILChanged();
				}
			}
		}
		
		[Column(Storage="_PODPIS_ODEBRAL", DbType="NVarChar(30)")]
		[DataMember(Order=11)]
		public string PODPIS_ODEBRAL
		{
			get
			{
				return this._PODPIS_ODEBRAL;
			}
			set
			{
				if ((this._PODPIS_ODEBRAL != value))
				{
					this.OnPODPIS_ODEBRALChanging(value);
					this.SendPropertyChanging();
					this._PODPIS_ODEBRAL = value;
					this.SendPropertyChanged("PODPIS_ODEBRAL");
					this.OnPODPIS_ODEBRALChanged();
				}
			}
		}
		
		[Column(Storage="_opis", DbType="NText", UpdateCheck=UpdateCheck.Never)]
		[DataMember(Order=12)]
		public string opis
		{
			get
			{
				return this._opis;
			}
			set
			{
				if ((this._opis != value))
				{
					this.OnopisChanging(value);
					this.SendPropertyChanging();
					this._opis = value;
					this.SendPropertyChanged("opis");
					this.OnopisChanged();
				}
			}
		}
		
		[Column(Storage="_SPOSOB_ZAPLATY", DbType="NVarChar(20)")]
		[DataMember(Order=13)]
		public string SPOSOB_ZAPLATY
		{
			get
			{
				return this._SPOSOB_ZAPLATY;
			}
			set
			{
				if ((this._SPOSOB_ZAPLATY != value))
				{
					this.OnSPOSOB_ZAPLATYChanging(value);
					this.SendPropertyChanging();
					this._SPOSOB_ZAPLATY = value;
					this.SendPropertyChanged("SPOSOB_ZAPLATY");
					this.OnSPOSOB_ZAPLATYChanged();
				}
			}
		}
		
		[Column(Storage="_TERMIN_ZAPLATY", DbType="DateTime")]
		[DataMember(Order=14)]
		public System.Nullable<System.DateTime> TERMIN_ZAPLATY
		{
			get
			{
				return this._TERMIN_ZAPLATY;
			}
			set
			{
				if ((this._TERMIN_ZAPLATY != value))
				{
					this.OnTERMIN_ZAPLATYChanging(value);
					this.SendPropertyChanging();
					this._TERMIN_ZAPLATY = value;
					this.SendPropertyChanged("TERMIN_ZAPLATY");
					this.OnTERMIN_ZAPLATYChanged();
				}
			}
		}
		
		[Column(Storage="_ZAPLACONO", DbType="Bit")]
		[DataMember(Order=15)]
		public System.Nullable<bool> ZAPLACONO
		{
			get
			{
				return this._ZAPLACONO;
			}
			set
			{
				if ((this._ZAPLACONO != value))
				{
					this.OnZAPLACONOChanging(value);
					this.SendPropertyChanging();
					this._ZAPLACONO = value;
					this.SendPropertyChanged("ZAPLACONO");
					this.OnZAPLACONOChanged();
				}
			}
		}
		
		[Column(Storage="_BYL_WYDRUK", DbType="Bit")]
		[DataMember(Order=16)]
		public System.Nullable<bool> BYL_WYDRUK
		{
			get
			{
				return this._BYL_WYDRUK;
			}
			set
			{
				if ((this._BYL_WYDRUK != value))
				{
					this.OnBYL_WYDRUKChanging(value);
					this.SendPropertyChanging();
					this._BYL_WYDRUK = value;
					this.SendPropertyChanged("BYL_WYDRUK");
					this.OnBYL_WYDRUKChanged();
				}
			}
		}
		
		[Column(Storage="_NABYWCA_ADRES", DbType="NText", UpdateCheck=UpdateCheck.Never)]
		[DataMember(Order=17)]
		public string NABYWCA_ADRES
		{
			get
			{
				return this._NABYWCA_ADRES;
			}
			set
			{
				if ((this._NABYWCA_ADRES != value))
				{
					this.OnNABYWCA_ADRESChanging(value);
					this.SendPropertyChanging();
					this._NABYWCA_ADRES = value;
					this.SendPropertyChanged("NABYWCA_ADRES");
					this.OnNABYWCA_ADRESChanged();
				}
			}
		}
		
		[Column(Storage="_SPRZEDAWCA_ADRES", DbType="NText", UpdateCheck=UpdateCheck.Never)]
		[DataMember(Order=18)]
		public string SPRZEDAWCA_ADRES
		{
			get
			{
				return this._SPRZEDAWCA_ADRES;
			}
			set
			{
				if ((this._SPRZEDAWCA_ADRES != value))
				{
					this.OnSPRZEDAWCA_ADRESChanging(value);
					this.SendPropertyChanging();
					this._SPRZEDAWCA_ADRES = value;
					this.SendPropertyChanged("SPRZEDAWCA_ADRES");
					this.OnSPRZEDAWCA_ADRESChanged();
				}
			}
		}
		
		[Column(Storage="_SPRZEDAWCA_NIP", DbType="NVarChar(50)")]
		[DataMember(Order=19)]
		public string SPRZEDAWCA_NIP
		{
			get
			{
				return this._SPRZEDAWCA_NIP;
			}
			set
			{
				if ((this._SPRZEDAWCA_NIP != value))
				{
					this.OnSPRZEDAWCA_NIPChanging(value);
					this.SendPropertyChanging();
					this._SPRZEDAWCA_NIP = value;
					this.SendPropertyChanged("SPRZEDAWCA_NIP");
					this.OnSPRZEDAWCA_NIPChanged();
				}
			}
		}
		
		[Column(Storage="_NABYWCA_NIP", DbType="NVarChar(50)")]
		[DataMember(Order=20)]
		public string NABYWCA_NIP
		{
			get
			{
				return this._NABYWCA_NIP;
			}
			set
			{
				if ((this._NABYWCA_NIP != value))
				{
					this.OnNABYWCA_NIPChanging(value);
					this.SendPropertyChanging();
					this._NABYWCA_NIP = value;
					this.SendPropertyChanged("NABYWCA_NIP");
					this.OnNABYWCA_NIPChanged();
				}
			}
		}
		
		[Column(Storage="_FAKTURA_TYP", DbType="SmallInt")]
		[DataMember(Order=21)]
		public System.Nullable<short> FAKTURA_TYP
		{
			get
			{
				return this._FAKTURA_TYP;
			}
			set
			{
				if ((this._FAKTURA_TYP != value))
				{
					this.OnFAKTURA_TYPChanging(value);
					this.SendPropertyChanging();
					this._FAKTURA_TYP = value;
					this.SendPropertyChanged("FAKTURA_TYP");
					this.OnFAKTURA_TYPChanged();
				}
			}
		}
		
		[Column(Storage="_FAKTURA_PODTYP", DbType="SmallInt")]
		[DataMember(Order=22)]
		public System.Nullable<short> FAKTURA_PODTYP
		{
			get
			{
				return this._FAKTURA_PODTYP;
			}
			set
			{
				if ((this._FAKTURA_PODTYP != value))
				{
					this.OnFAKTURA_PODTYPChanging(value);
					this.SendPropertyChanging();
					this._FAKTURA_PODTYP = value;
					this.SendPropertyChanged("FAKTURA_PODTYP");
					this.OnFAKTURA_PODTYPChanged();
				}
			}
		}
		
		[Column(Storage="_ID_KONTA", DbType="SmallInt")]
		[DataMember(Order=23)]
		public System.Nullable<short> ID_KONTA
		{
			get
			{
				return this._ID_KONTA;
			}
			set
			{
				if ((this._ID_KONTA != value))
				{
					this.OnID_KONTAChanging(value);
					this.SendPropertyChanging();
					this._ID_KONTA = value;
					this.SendPropertyChanged("ID_KONTA");
					this.OnID_KONTAChanged();
				}
			}
		}
		
		[Column(Storage="_EKSPORT", DbType="Bit NOT NULL")]
		[DataMember(Order=24)]
		public bool EKSPORT
		{
			get
			{
				return this._EKSPORT;
			}
			set
			{
				if ((this._EKSPORT != value))
				{
					this.OnEKSPORTChanging(value);
					this.SendPropertyChanging();
					this._EKSPORT = value;
					this.SendPropertyChanged("EKSPORT");
					this.OnEKSPORTChanged();
				}
			}
		}
		
		[Column(Storage="_EXPORTED", DbType="Bit NOT NULL")]
		[DataMember(Order=25)]
		public bool EXPORTED
		{
			get
			{
				return this._EXPORTED;
			}
			set
			{
				if ((this._EXPORTED != value))
				{
					this.OnEXPORTEDChanging(value);
					this.SendPropertyChanging();
					this._EXPORTED = value;
					this.SendPropertyChanged("EXPORTED");
					this.OnEXPORTEDChanged();
				}
			}
		}
		
		[Column(Storage="_ID_TYTUL", DbType="SmallInt")]
		[DataMember(Order=26)]
		public System.Nullable<short> ID_TYTUL
		{
			get
			{
				return this._ID_TYTUL;
			}
			set
			{
				if ((this._ID_TYTUL != value))
				{
					this.OnID_TYTULChanging(value);
					this.SendPropertyChanging();
					this._ID_TYTUL = value;
					this.SendPropertyChanged("ID_TYTUL");
					this.OnID_TYTULChanged();
				}
			}
		}
		
		[Column(Storage="_EXPORTED_DATA", DbType="DateTime")]
		[DataMember(Order=27)]
		public System.Nullable<System.DateTime> EXPORTED_DATA
		{
			get
			{
				return this._EXPORTED_DATA;
			}
			set
			{
				if ((this._EXPORTED_DATA != value))
				{
					this.OnEXPORTED_DATAChanging(value);
					this.SendPropertyChanging();
					this._EXPORTED_DATA = value;
					this.SendPropertyChanged("EXPORTED_DATA");
					this.OnEXPORTED_DATAChanged();
				}
			}
		}
		
		[Column(Storage="_suma_zaplat", DbType="Money")]
		[DataMember(Order=28)]
		public System.Nullable<decimal> suma_zaplat
		{
			get
			{
				return this._suma_zaplat;
			}
			set
			{
				if ((this._suma_zaplat != value))
				{
					this.Onsuma_zaplatChanging(value);
					this.SendPropertyChanging();
					this._suma_zaplat = value;
					this.SendPropertyChanged("suma_zaplat");
					this.Onsuma_zaplatChanged();
				}
			}
		}
		
		[Column(Storage="_ID_FK_KOR", DbType="Int")]
		[DataMember(Order=29)]
		public System.Nullable<int> ID_FK_KOR
		{
			get
			{
				return this._ID_FK_KOR;
			}
			set
			{
				if ((this._ID_FK_KOR != value))
				{
					this.OnID_FK_KORChanging(value);
					this.SendPropertyChanging();
					this._ID_FK_KOR = value;
					this.SendPropertyChanged("ID_FK_KOR");
					this.OnID_FK_KORChanged();
				}
			}
		}
		
		[Column(Storage="_KOREKTA", DbType="Bit")]
		[DataMember(Order=30)]
		public System.Nullable<bool> KOREKTA
		{
			get
			{
				return this._KOREKTA;
			}
			set
			{
				if ((this._KOREKTA != value))
				{
					this.OnKOREKTAChanging(value);
					this.SendPropertyChanging();
					this._KOREKTA = value;
					this.SendPropertyChanged("KOREKTA");
					this.OnKOREKTAChanged();
				}
			}
		}
		
		[Column(Storage="_zaplata_data", DbType="DateTime")]
		[DataMember(Order=31)]
		public System.Nullable<System.DateTime> zaplata_data
		{
			get
			{
				return this._zaplata_data;
			}
			set
			{
				if ((this._zaplata_data != value))
				{
					this.Onzaplata_dataChanging(value);
					this.SendPropertyChanging();
					this._zaplata_data = value;
					this.SendPropertyChanged("zaplata_data");
					this.Onzaplata_dataChanged();
				}
			}
		}
		
		[Column(Storage="_zaplata_opis", DbType="NVarChar(50)")]
		[DataMember(Order=32)]
		public string zaplata_opis
		{
			get
			{
				return this._zaplata_opis;
			}
			set
			{
				if ((this._zaplata_opis != value))
				{
					this.Onzaplata_opisChanging(value);
					this.SendPropertyChanging();
					this._zaplata_opis = value;
					this.SendPropertyChanged("zaplata_opis");
					this.Onzaplata_opisChanged();
				}
			}
		}
		
		[Column(Storage="_Zaliczka_Brutto", DbType="Money")]
		[DataMember(Order=33)]
		public System.Nullable<decimal> Zaliczka_Brutto
		{
			get
			{
				return this._Zaliczka_Brutto;
			}
			set
			{
				if ((this._Zaliczka_Brutto != value))
				{
					this.OnZaliczka_BruttoChanging(value);
					this.SendPropertyChanging();
					this._Zaliczka_Brutto = value;
					this.SendPropertyChanged("Zaliczka_Brutto");
					this.OnZaliczka_BruttoChanged();
				}
			}
		}
		
		[Column(Storage="_Zaliczka_Data", DbType="DateTime")]
		[DataMember(Order=34)]
		public System.Nullable<System.DateTime> Zaliczka_Data
		{
			get
			{
				return this._Zaliczka_Data;
			}
			set
			{
				if ((this._Zaliczka_Data != value))
				{
					this.OnZaliczka_DataChanging(value);
					this.SendPropertyChanging();
					this._Zaliczka_Data = value;
					this.SendPropertyChanged("Zaliczka_Data");
					this.OnZaliczka_DataChanged();
				}
			}
		}
		
		[Column(Storage="_waluta_brutto", DbType="Float")]
		[DataMember(Order=35)]
		public System.Nullable<double> waluta_brutto
		{
			get
			{
				return this._waluta_brutto;
			}
			set
			{
				if ((this._waluta_brutto != value))
				{
					this.Onwaluta_bruttoChanging(value);
					this.SendPropertyChanging();
					this._waluta_brutto = value;
					this.SendPropertyChanged("waluta_brutto");
					this.Onwaluta_bruttoChanged();
				}
			}
		}
		
		[Column(Storage="_waluta_miano", DbType="NVarChar(4)")]
		[DataMember(Order=36)]
		public string waluta_miano
		{
			get
			{
				return this._waluta_miano;
			}
			set
			{
				if ((this._waluta_miano != value))
				{
					this.Onwaluta_mianoChanging(value);
					this.SendPropertyChanging();
					this._waluta_miano = value;
					this.SendPropertyChanged("waluta_miano");
					this.Onwaluta_mianoChanged();
				}
			}
		}
		
		[Column(Storage="_waluta_kurs", DbType="Float")]
		[DataMember(Order=37)]
		public System.Nullable<double> waluta_kurs
		{
			get
			{
				return this._waluta_kurs;
			}
			set
			{
				if ((this._waluta_kurs != value))
				{
					this.Onwaluta_kursChanging(value);
					this.SendPropertyChanging();
					this._waluta_kurs = value;
					this.SendPropertyChanged("waluta_kurs");
					this.Onwaluta_kursChanged();
				}
			}
		}
		
		[Column(Storage="_waluta_przelicznik", DbType="Int")]
		[DataMember(Order=38)]
		public System.Nullable<int> waluta_przelicznik
		{
			get
			{
				return this._waluta_przelicznik;
			}
			set
			{
				if ((this._waluta_przelicznik != value))
				{
					this.Onwaluta_przelicznikChanging(value);
					this.SendPropertyChanging();
					this._waluta_przelicznik = value;
					this.SendPropertyChanged("waluta_przelicznik");
					this.Onwaluta_przelicznikChanged();
				}
			}
		}
		
		[Column(Storage="_waluta_kurs_z_dnia", DbType="SmallDateTime")]
		[DataMember(Order=39)]
		public System.Nullable<System.DateTime> waluta_kurs_z_dnia
		{
			get
			{
				return this._waluta_kurs_z_dnia;
			}
			set
			{
				if ((this._waluta_kurs_z_dnia != value))
				{
					this.Onwaluta_kurs_z_dniaChanging(value);
					this.SendPropertyChanging();
					this._waluta_kurs_z_dnia = value;
					this.SendPropertyChanged("waluta_kurs_z_dnia");
					this.Onwaluta_kurs_z_dniaChanged();
				}
			}
		}
		
		[Column(Storage="_waluta_tabela_nr", DbType="NVarChar(15)")]
		[DataMember(Order=40)]
		public string waluta_tabela_nr
		{
			get
			{
				return this._waluta_tabela_nr;
			}
			set
			{
				if ((this._waluta_tabela_nr != value))
				{
					this.Onwaluta_tabela_nrChanging(value);
					this.SendPropertyChanging();
					this._waluta_tabela_nr = value;
					this.SendPropertyChanged("waluta_tabela_nr");
					this.Onwaluta_tabela_nrChanged();
				}
			}
		}
		
		[Column(Storage="_idZamowienia", DbType="Int")]
		[DataMember(Order=41)]
		public System.Nullable<int> idZamowienia
		{
			get
			{
				return this._idZamowienia;
			}
			set
			{
				if ((this._idZamowienia != value))
				{
					this.OnidZamowieniaChanging(value);
					this.SendPropertyChanging();
					this._idZamowienia = value;
					this.SendPropertyChanged("idZamowienia");
					this.OnidZamowieniaChanged();
				}
			}
		}
		
		[Column(Storage="_idFakturyKorekta", DbType="Int")]
		[DataMember(Order=42)]
		public System.Nullable<int> idFakturyKorekta
		{
			get
			{
				return this._idFakturyKorekta;
			}
			set
			{
				if ((this._idFakturyKorekta != value))
				{
					this.OnidFakturyKorektaChanging(value);
					this.SendPropertyChanging();
					this._idFakturyKorekta = value;
					this.SendPropertyChanged("idFakturyKorekta");
					this.OnidFakturyKorektaChanged();
				}
			}
		}
		
		[Column(Storage="_idFakturyVAT", DbType="Int")]
		[DataMember(Order=43)]
		public System.Nullable<int> idFakturyVAT
		{
			get
			{
				return this._idFakturyVAT;
			}
			set
			{
				if ((this._idFakturyVAT != value))
				{
					this.OnidFakturyVATChanging(value);
					this.SendPropertyChanging();
					this._idFakturyVAT = value;
					this.SendPropertyChanged("idFakturyVAT");
					this.OnidFakturyVATChanged();
				}
			}
		}
		
		[Column(Storage="_SystemKsiegowyId", DbType="TinyInt")]
		[DataMember(Order=44)]
		public System.Nullable<byte> SystemKsiegowyId
		{
			get
			{
				return this._SystemKsiegowyId;
			}
			set
			{
				if ((this._SystemKsiegowyId != value))
				{
					this.OnSystemKsiegowyIdChanging(value);
					this.SendPropertyChanging();
					this._SystemKsiegowyId = value;
					this.SendPropertyChanged("SystemKsiegowyId");
					this.OnSystemKsiegowyIdChanged();
				}
			}
		}
		
		[Column(Storage="_ZmianaEmisji", DbType="Bit NOT NULL")]
		[DataMember(Order=45)]
		public bool ZmianaEmisji
		{
			get
			{
				return this._ZmianaEmisji;
			}
			set
			{
				if ((this._ZmianaEmisji != value))
				{
					this.OnZmianaEmisjiChanging(value);
					this.SendPropertyChanging();
					this._ZmianaEmisji = value;
					this.SendPropertyChanged("ZmianaEmisji");
					this.OnZmianaEmisjiChanged();
				}
			}
		}
		
		[Association(Name="FAKTURY_PlatnosciEcard", Storage="_PlatnosciEcards", ThisKey="ID_FAKTURY", OtherKey="IDFaktury")]
		[DataMember(Order=46, EmitDefaultValue=false)]
		public EntitySet<PlatnosciEcard> PlatnosciEcards
		{
			get
			{
				if ((this.serializing 
							&& (this._PlatnosciEcards.HasLoadedOrAssignedValues == false)))
				{
					return null;
				}
				return this._PlatnosciEcards;
			}
			set
			{
				this._PlatnosciEcards.Assign(value);
			}
		}
		
		[Association(Name="FAKTURY_FAKTURA_DETAIL", Storage="_FAKTURA_DETAILs", ThisKey="ID_FAKTURY", OtherKey="ID_FAKTURY")]
		[DataMember(Order=47, EmitDefaultValue=false)]
		public EntitySet<FAKTURA_DETAIL> FAKTURA_DETAILs
		{
			get
			{
				if ((this.serializing 
							&& (this._FAKTURA_DETAILs.HasLoadedOrAssignedValues == false)))
				{
					return null;
				}
				return this._FAKTURA_DETAILs;
			}
			set
			{
				this._FAKTURA_DETAILs.Assign(value);
			}
		}
		
		[Association(Name="FAKTURY_vPlatnosciEcard", Storage="_vDanePlatnosciEcards", ThisKey="ID_FAKTURY", OtherKey="ID_faktury")]
		[DataMember(Order=48, EmitDefaultValue=false)]
		public EntitySet<vPlatnosciEcard> vPlatnosciEcards
		{
			get
			{
				if ((this.serializing 
							&& (this._vDanePlatnosciEcards.HasLoadedOrAssignedValues == false)))
				{
					return null;
				}
				return this._vDanePlatnosciEcards;
			}
			set
			{
				this._vDanePlatnosciEcards.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_PlatnosciEcards(PlatnosciEcard entity)
		{
			this.SendPropertyChanging();
			entity.FAKTURY = this;
		}
		
		private void detach_PlatnosciEcards(PlatnosciEcard entity)
		{
			this.SendPropertyChanging();
			entity.FAKTURY = null;
		}
		
		private void attach_FAKTURA_DETAILs(FAKTURA_DETAIL entity)
		{
			this.SendPropertyChanging();
			entity.FAKTURY = this;
		}
		
		private void detach_FAKTURA_DETAILs(FAKTURA_DETAIL entity)
		{
			this.SendPropertyChanging();
			entity.FAKTURY = null;
		}
		
		private void attach_vDanePlatnosciEcards(vPlatnosciEcard entity)
		{
			this.SendPropertyChanging();
			entity.FAKTURY = this;
		}
		
		private void detach_vDanePlatnosciEcards(vPlatnosciEcard entity)
		{
			this.SendPropertyChanging();
			entity.FAKTURY = null;
		}
		
		private void Initialize()
		{
			this._PlatnosciEcards = new EntitySet<PlatnosciEcard>(new Action<PlatnosciEcard>(this.attach_PlatnosciEcards), new Action<PlatnosciEcard>(this.detach_PlatnosciEcards));
			this._FAKTURA_DETAILs = new EntitySet<FAKTURA_DETAIL>(new Action<FAKTURA_DETAIL>(this.attach_FAKTURA_DETAILs), new Action<FAKTURA_DETAIL>(this.detach_FAKTURA_DETAILs));
			this._vDanePlatnosciEcards = new EntitySet<vPlatnosciEcard>(new Action<vPlatnosciEcard>(this.attach_vDanePlatnosciEcards), new Action<vPlatnosciEcard>(this.detach_vDanePlatnosciEcards));
			OnCreated();
		}
		
		[OnDeserializing()]
		[System.ComponentModel.EditorBrowsableAttribute(EditorBrowsableState.Never)]
		public void OnDeserializing(StreamingContext context)
		{
			this.Initialize();
		}
		
		[OnSerializing()]
		[System.ComponentModel.EditorBrowsableAttribute(EditorBrowsableState.Never)]
		public void OnSerializing(StreamingContext context)
		{
			this.serializing = true;
		}
		
		[OnSerialized()]
		[System.ComponentModel.EditorBrowsableAttribute(EditorBrowsableState.Never)]
		public void OnSerialized(StreamingContext context)
		{
			this.serializing = false;
		}
	}
	
	[Table(Name="dbo.vDanePlatnosciEcard")]
	[DataContract()]
	public partial class vPlatnosciEcard : INotifyPropertyChanging, INotifyPropertyChanged
	{
		
		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
		
		private int _ID_faktury;
		
		private System.Nullable<int> _Numer;
		
		private string _Numer_Roz;
		
		private System.Nullable<int> _Numer_Rok;
		
		private System.Nullable<byte> _SystemKsiegowyId;
		
		private string _FirstName;
		
		private string _LastName;
		
		private string _Address;
		
		private string _PostalCode;
		
		private string _City;
		
		private string _nip;
		
		private string _Faktura_Numer;
		
		private string _Nabywca_nip;
		
		private System.Nullable<decimal> _Brutto;
		
		private System.Nullable<System.DateTime> _Data_Wystawienia;
		
		private System.Nullable<System.DateTime> _Termin_zaplaty;
		
		private string _Sposob_zaplaty;
		
		private string _Imie;
		
		private string _Nazwisko;
		
		private string _ulica;
		
		private string _kod;
		
		private string _miasto;
		
		private string _telefon;
		
		private System.Nullable<decimal> _waluta_brutto;
		
		private string _waluta_miano;
		
		private EntityRef<FAKTURY> _FAKTURY;
		
    #region Extensibility Method Definitions
    partial void OnLoaded();
    partial void OnValidate(System.Data.Linq.ChangeAction action);
    partial void OnCreated();
    partial void OnID_fakturyChanging(int value);
    partial void OnID_fakturyChanged();
    partial void OnNumerChanging(System.Nullable<int> value);
    partial void OnNumerChanged();
    partial void OnNumer_RozChanging(string value);
    partial void OnNumer_RozChanged();
    partial void OnNumer_RokChanging(System.Nullable<int> value);
    partial void OnNumer_RokChanged();
    partial void OnSystemKsiegowyIdChanging(System.Nullable<byte> value);
    partial void OnSystemKsiegowyIdChanged();
    partial void OnFirstNameChanging(string value);
    partial void OnFirstNameChanged();
    partial void OnLastNameChanging(string value);
    partial void OnLastNameChanged();
    partial void OnAddressChanging(string value);
    partial void OnAddressChanged();
    partial void OnPostalCodeChanging(string value);
    partial void OnPostalCodeChanged();
    partial void OnCityChanging(string value);
    partial void OnCityChanged();
    partial void OnnipChanging(string value);
    partial void OnnipChanged();
    partial void OnFaktura_NumerChanging(string value);
    partial void OnFaktura_NumerChanged();
    partial void OnNabywca_nipChanging(string value);
    partial void OnNabywca_nipChanged();
    partial void OnBruttoChanging(System.Nullable<decimal> value);
    partial void OnBruttoChanged();
    partial void OnData_WystawieniaChanging(System.Nullable<System.DateTime> value);
    partial void OnData_WystawieniaChanged();
    partial void OnTermin_zaplatyChanging(System.Nullable<System.DateTime> value);
    partial void OnTermin_zaplatyChanged();
    partial void OnSposob_zaplatyChanging(string value);
    partial void OnSposob_zaplatyChanged();
    partial void OnImieChanging(string value);
    partial void OnImieChanged();
    partial void OnNazwiskoChanging(string value);
    partial void OnNazwiskoChanged();
    partial void OnulicaChanging(string value);
    partial void OnulicaChanged();
    partial void OnkodChanging(string value);
    partial void OnkodChanged();
    partial void OnmiastoChanging(string value);
    partial void OnmiastoChanged();
    partial void OntelefonChanging(string value);
    partial void OntelefonChanged();
    partial void Onwaluta_bruttoChanging(System.Nullable<decimal> value);
    partial void Onwaluta_bruttoChanged();
    partial void Onwaluta_mianoChanging(string value);
    partial void Onwaluta_mianoChanged();
    #endregion
		
		public vPlatnosciEcard()
		{
			this.Initialize();
		}
		
		[Column(Storage="_ID_faktury", DbType="Int NOT NULL", IsPrimaryKey=true)]
		[DataMember(Order=1)]
		public int ID_faktury
		{
			get
			{
				return this._ID_faktury;
			}
			set
			{
				if ((this._ID_faktury != value))
				{
					if (this._FAKTURY.HasLoadedOrAssignedValue)
					{
						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
					}
					this.OnID_fakturyChanging(value);
					this.SendPropertyChanging();
					this._ID_faktury = value;
					this.SendPropertyChanged("ID_faktury");
					this.OnID_fakturyChanged();
				}
			}
		}
		
		[Column(Storage="_Numer", DbType="Int")]
		[DataMember(Order=2)]
		public System.Nullable<int> Numer
		{
			get
			{
				return this._Numer;
			}
			set
			{
				if ((this._Numer != value))
				{
					this.OnNumerChanging(value);
					this.SendPropertyChanging();
					this._Numer = value;
					this.SendPropertyChanged("Numer");
					this.OnNumerChanged();
				}
			}
		}
		
		[Column(Storage="_Numer_Roz", DbType="NVarChar(8)")]
		[DataMember(Order=3)]
		public string Numer_Roz
		{
			get
			{
				return this._Numer_Roz;
			}
			set
			{
				if ((this._Numer_Roz != value))
				{
					this.OnNumer_RozChanging(value);
					this.SendPropertyChanging();
					this._Numer_Roz = value;
					this.SendPropertyChanged("Numer_Roz");
					this.OnNumer_RozChanged();
				}
			}
		}
		
		[Column(Storage="_Numer_Rok", DbType="Int")]
		[DataMember(Order=4)]
		public System.Nullable<int> Numer_Rok
		{
			get
			{
				return this._Numer_Rok;
			}
			set
			{
				if ((this._Numer_Rok != value))
				{
					this.OnNumer_RokChanging(value);
					this.SendPropertyChanging();
					this._Numer_Rok = value;
					this.SendPropertyChanged("Numer_Rok");
					this.OnNumer_RokChanged();
				}
			}
		}
		
		[Column(Storage="_SystemKsiegowyId", DbType="TinyInt")]
		[DataMember(Order=5)]
		public System.Nullable<byte> SystemKsiegowyId
		{
			get
			{
				return this._SystemKsiegowyId;
			}
			set
			{
				if ((this._SystemKsiegowyId != value))
				{
					this.OnSystemKsiegowyIdChanging(value);
					this.SendPropertyChanging();
					this._SystemKsiegowyId = value;
					this.SendPropertyChanged("SystemKsiegowyId");
					this.OnSystemKsiegowyIdChanged();
				}
			}
		}
		
		[Column(Storage="_FirstName", DbType="NVarChar(50)")]
		[DataMember(Order=6)]
		public string FirstName
		{
			get
			{
				return this._FirstName;
			}
			set
			{
				if ((this._FirstName != value))
				{
					this.OnFirstNameChanging(value);
					this.SendPropertyChanging();
					this._FirstName = value;
					this.SendPropertyChanged("FirstName");
					this.OnFirstNameChanged();
				}
			}
		}
		
		[Column(Storage="_LastName", DbType="NVarChar(50)")]
		[DataMember(Order=7)]
		public string LastName
		{
			get
			{
				return this._LastName;
			}
			set
			{
				if ((this._LastName != value))
				{
					this.OnLastNameChanging(value);
					this.SendPropertyChanging();
					this._LastName = value;
					this.SendPropertyChanged("LastName");
					this.OnLastNameChanged();
				}
			}
		}
		
		[Column(Storage="_Address", DbType="NVarChar(50)")]
		[DataMember(Order=8)]
		public string Address
		{
			get
			{
				return this._Address;
			}
			set
			{
				if ((this._Address != value))
				{
					this.OnAddressChanging(value);
					this.SendPropertyChanging();
					this._Address = value;
					this.SendPropertyChanged("Address");
					this.OnAddressChanged();
				}
			}
		}
		
		[Column(Storage="_PostalCode", DbType="NVarChar(20)")]
		[DataMember(Order=9)]
		public string PostalCode
		{
			get
			{
				return this._PostalCode;
			}
			set
			{
				if ((this._PostalCode != value))
				{
					this.OnPostalCodeChanging(value);
					this.SendPropertyChanging();
					this._PostalCode = value;
					this.SendPropertyChanged("PostalCode");
					this.OnPostalCodeChanged();
				}
			}
		}
		
		[Column(Storage="_City", DbType="NVarChar(50)")]
		[DataMember(Order=10)]
		public string City
		{
			get
			{
				return this._City;
			}
			set
			{
				if ((this._City != value))
				{
					this.OnCityChanging(value);
					this.SendPropertyChanging();
					this._City = value;
					this.SendPropertyChanged("City");
					this.OnCityChanged();
				}
			}
		}
		
		[Column(Storage="_nip", DbType="NVarChar(4000)")]
		[DataMember(Order=11)]
		public string nip
		{
			get
			{
				return this._nip;
			}
			set
			{
				if ((this._nip != value))
				{
					this.OnnipChanging(value);
					this.SendPropertyChanging();
					this._nip = value;
					this.SendPropertyChanged("nip");
					this.OnnipChanged();
				}
			}
		}
		
		[Column(Name="[Faktura Numer]", Storage="_Faktura_Numer", DbType="NVarChar(70)")]
		[DataMember(Order=12)]
		public string Faktura_Numer
		{
			get
			{
				return this._Faktura_Numer;
			}
			set
			{
				if ((this._Faktura_Numer != value))
				{
					this.OnFaktura_NumerChanging(value);
					this.SendPropertyChanging();
					this._Faktura_Numer = value;
					this.SendPropertyChanged("Faktura_Numer");
					this.OnFaktura_NumerChanged();
				}
			}
		}
		
		[Column(Storage="_Nabywca_nip", DbType="NVarChar(50)")]
		[DataMember(Order=13)]
		public string Nabywca_nip
		{
			get
			{
				return this._Nabywca_nip;
			}
			set
			{
				if ((this._Nabywca_nip != value))
				{
					this.OnNabywca_nipChanging(value);
					this.SendPropertyChanging();
					this._Nabywca_nip = value;
					this.SendPropertyChanged("Nabywca_nip");
					this.OnNabywca_nipChanged();
				}
			}
		}
		
		[Column(Storage="_Brutto", DbType="Decimal(9,2)")]
		[DataMember(Order=14)]
		public System.Nullable<decimal> Brutto
		{
			get
			{
				return this._Brutto;
			}
			set
			{
				if ((this._Brutto != value))
				{
					this.OnBruttoChanging(value);
					this.SendPropertyChanging();
					this._Brutto = value;
					this.SendPropertyChanged("Brutto");
					this.OnBruttoChanged();
				}
			}
		}
		
		[Column(Storage="_Data_Wystawienia", DbType="DateTime")]
		[DataMember(Order=15)]
		public System.Nullable<System.DateTime> Data_Wystawienia
		{
			get
			{
				return this._Data_Wystawienia;
			}
			set
			{
				if ((this._Data_Wystawienia != value))
				{
					this.OnData_WystawieniaChanging(value);
					this.SendPropertyChanging();
					this._Data_Wystawienia = value;
					this.SendPropertyChanged("Data_Wystawienia");
					this.OnData_WystawieniaChanged();
				}
			}
		}
		
		[Column(Storage="_Termin_zaplaty", DbType="DateTime")]
		[DataMember(Order=16)]
		public System.Nullable<System.DateTime> Termin_zaplaty
		{
			get
			{
				return this._Termin_zaplaty;
			}
			set
			{
				if ((this._Termin_zaplaty != value))
				{
					this.OnTermin_zaplatyChanging(value);
					this.SendPropertyChanging();
					this._Termin_zaplaty = value;
					this.SendPropertyChanged("Termin_zaplaty");
					this.OnTermin_zaplatyChanged();
				}
			}
		}
		
		[Column(Storage="_Sposob_zaplaty", DbType="NVarChar(20)")]
		[DataMember(Order=17)]
		public string Sposob_zaplaty
		{
			get
			{
				return this._Sposob_zaplaty;
			}
			set
			{
				if ((this._Sposob_zaplaty != value))
				{
					this.OnSposob_zaplatyChanging(value);
					this.SendPropertyChanging();
					this._Sposob_zaplaty = value;
					this.SendPropertyChanged("Sposob_zaplaty");
					this.OnSposob_zaplatyChanged();
				}
			}
		}
		
		[Column(Storage="_Imie", DbType="NVarChar(50)")]
		[DataMember(Order=18)]
		public string Imie
		{
			get
			{
				return this._Imie;
			}
			set
			{
				if ((this._Imie != value))
				{
					this.OnImieChanging(value);
					this.SendPropertyChanging();
					this._Imie = value;
					this.SendPropertyChanged("Imie");
					this.OnImieChanged();
				}
			}
		}
		
		[Column(Storage="_Nazwisko", DbType="NVarChar(50)")]
		[DataMember(Order=19)]
		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();
				}
			}
		}
		
		[Column(Storage="_ulica", DbType="NVarChar(50)")]
		[DataMember(Order=20)]
		public string ulica
		{
			get
			{
				return this._ulica;
			}
			set
			{
				if ((this._ulica != value))
				{
					this.OnulicaChanging(value);
					this.SendPropertyChanging();
					this._ulica = value;
					this.SendPropertyChanged("ulica");
					this.OnulicaChanged();
				}
			}
		}
		
		[Column(Storage="_kod", DbType="NVarChar(50)")]
		[DataMember(Order=21)]
		public string kod
		{
			get
			{
				return this._kod;
			}
			set
			{
				if ((this._kod != value))
				{
					this.OnkodChanging(value);
					this.SendPropertyChanging();
					this._kod = value;
					this.SendPropertyChanged("kod");
					this.OnkodChanged();
				}
			}
		}
		
		[Column(Storage="_miasto", DbType="NVarChar(50)")]
		[DataMember(Order=22)]
		public string miasto
		{
			get
			{
				return this._miasto;
			}
			set
			{
				if ((this._miasto != value))
				{
					this.OnmiastoChanging(value);
					this.SendPropertyChanging();
					this._miasto = value;
					this.SendPropertyChanged("miasto");
					this.OnmiastoChanged();
				}
			}
		}
		
		[Column(Storage="_telefon", DbType="NVarChar(50)")]
		[DataMember(Order=23)]
		public string telefon
		{
			get
			{
				return this._telefon;
			}
			set
			{
				if ((this._telefon != value))
				{
					this.OntelefonChanging(value);
					this.SendPropertyChanging();
					this._telefon = value;
					this.SendPropertyChanged("telefon");
					this.OntelefonChanged();
				}
			}
		}
		
		[Column(Storage="_waluta_brutto", DbType="Decimal(9,2)")]
		[DataMember(Order=24)]
		public System.Nullable<decimal> waluta_brutto
		{
			get
			{
				return this._waluta_brutto;
			}
			set
			{
				if ((this._waluta_brutto != value))
				{
					this.Onwaluta_bruttoChanging(value);
					this.SendPropertyChanging();
					this._waluta_brutto = value;
					this.SendPropertyChanged("waluta_brutto");
					this.Onwaluta_bruttoChanged();
				}
			}
		}
		
		[Column(Storage="_waluta_miano", DbType="NVarChar(4)")]
		[DataMember(Order=25)]
		public string waluta_miano
		{
			get
			{
				return this._waluta_miano;
			}
			set
			{
				if ((this._waluta_miano != value))
				{
					this.Onwaluta_mianoChanging(value);
					this.SendPropertyChanging();
					this._waluta_miano = value;
					this.SendPropertyChanged("waluta_miano");
					this.Onwaluta_mianoChanged();
				}
			}
		}
		
		[Association(Name="FAKTURY_vPlatnosciEcard", Storage="_FAKTURY", ThisKey="ID_faktury", OtherKey="ID_FAKTURY", IsForeignKey=true)]
		public FAKTURY FAKTURY
		{
			get
			{
				return this._FAKTURY.Entity;
			}
			set
			{
				FAKTURY previousValue = this._FAKTURY.Entity;
				if (((previousValue != value) 
							|| (this._FAKTURY.HasLoadedOrAssignedValue == false)))
				{
					this.SendPropertyChanging();
					if ((previousValue != null))
					{
						this._FAKTURY.Entity = null;
						previousValue.vPlatnosciEcards.Remove(this);
					}
					this._FAKTURY.Entity = value;
					if ((value != null))
					{
						value.vPlatnosciEcards.Add(this);
						this._ID_faktury = value.ID_FAKTURY;
					}
					else
					{
						this._ID_faktury = default(int);
					}
					this.SendPropertyChanged("FAKTURY");
				}
			}
		}
		
		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 Initialize()
		{
			this._FAKTURY = default(EntityRef<FAKTURY>);
			OnCreated();
		}
		
		[OnDeserializing()]
		[System.ComponentModel.EditorBrowsableAttribute(EditorBrowsableState.Never)]
		public void OnDeserializing(StreamingContext context)
		{
			this.Initialize();
		}
	}
}
#pragma warning restore 1591
