#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 WareHouse
{
	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="AnbarDari")]
	public partial class Lsc_AnbarDataContext : System.Data.Linq.DataContext
	{
		
		private static System.Data.Linq.Mapping.MappingSource mappingSource = new AttributeMappingSource();
		
    #region Extensibility Method Definitions
    partial void OnCreated();
    partial void InsertAsset(Asset instance);
    partial void UpdateAsset(Asset instance);
    partial void DeleteAsset(Asset instance);
    partial void InsertAssetUnit(AssetUnit instance);
    partial void UpdateAssetUnit(AssetUnit instance);
    partial void DeleteAssetUnit(AssetUnit instance);
    partial void InsertUnit(Unit instance);
    partial void UpdateUnit(Unit instance);
    partial void DeleteUnit(Unit instance);
    partial void InsertCateg(Categ instance);
    partial void UpdateCateg(Categ instance);
    partial void DeleteCateg(Categ instance);
    partial void InsertWareHouse101(WareHouse101 instance);
    partial void UpdateWareHouse101(WareHouse101 instance);
    partial void DeleteWareHouse101(WareHouse101 instance);
    partial void InsertSefareshat(Sefareshat instance);
    partial void UpdateSefareshat(Sefareshat instance);
    partial void DeleteSefareshat(Sefareshat instance);
    partial void InsertTahvilShodegan(TahvilShodegan instance);
    partial void UpdateTahvilShodegan(TahvilShodegan instance);
    partial void DeleteTahvilShodegan(TahvilShodegan instance);
    #endregion
		
		public Lsc_AnbarDataContext() : 
				base(global::WareHouse.Properties.Settings.Default.DBWare_mdbConnectionString, mappingSource)
		{
			OnCreated();
		}
		
		public Lsc_AnbarDataContext(string connection) : 
				base(connection, mappingSource)
		{
			OnCreated();
		}
		
		public Lsc_AnbarDataContext(System.Data.IDbConnection connection) : 
				base(connection, mappingSource)
		{
			OnCreated();
		}
		
		public Lsc_AnbarDataContext(string connection, System.Data.Linq.Mapping.MappingSource mappingSource) : 
				base(connection, mappingSource)
		{
			OnCreated();
		}
		
		public Lsc_AnbarDataContext(System.Data.IDbConnection connection, System.Data.Linq.Mapping.MappingSource mappingSource) : 
				base(connection, mappingSource)
		{
			OnCreated();
		}
		
		public System.Data.Linq.Table<Asset> Assets
		{
			get
			{
				return this.GetTable<Asset>();
			}
		}
		
		public System.Data.Linq.Table<AssetUnit> AssetUnits
		{
			get
			{
				return this.GetTable<AssetUnit>();
			}
		}
		
		public System.Data.Linq.Table<Unit> Units
		{
			get
			{
				return this.GetTable<Unit>();
			}
		}
		
		public System.Data.Linq.Table<Categ> Categs
		{
			get
			{
				return this.GetTable<Categ>();
			}
		}
		
		public System.Data.Linq.Table<WareHouse101> WareHouse101s
		{
			get
			{
				return this.GetTable<WareHouse101>();
			}
		}
		
		public System.Data.Linq.Table<Sefareshat> Sefareshats
		{
			get
			{
				return this.GetTable<Sefareshat>();
			}
		}
		
		public System.Data.Linq.Table<TahvilShodegan> TahvilShodegans
		{
			get
			{
				return this.GetTable<TahvilShodegan>();
			}
		}
	}
	
	[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.Asset")]
	public partial class Asset : INotifyPropertyChanging, INotifyPropertyChanged
	{
		
		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
		
		private int _AssetID;
		
		private string _AssetName;
		
		private System.Nullable<int> _Categu;
		
		private int _MakanID;
		
		private System.Nullable<int> _AssetUnit;
		
		private System.Nullable<int> _OrderPoint;
		
		private EntityRef<AssetUnit> _AssetUnit1;
		
		private EntityRef<Categ> _Categ;
		
		private EntityRef<WareHouse101> _WareHouse;
		
    #region Extensibility Method Definitions
    partial void OnLoaded();
    partial void OnValidate(System.Data.Linq.ChangeAction action);
    partial void OnCreated();
    partial void OnAssetIDChanging(int value);
    partial void OnAssetIDChanged();
    partial void OnAssetNameChanging(string value);
    partial void OnAssetNameChanged();
    partial void OnCateguChanging(System.Nullable<int> value);
    partial void OnCateguChanged();
    partial void OnMakanIDChanging(int value);
    partial void OnMakanIDChanged();
    partial void OnAssetUnitChanging(System.Nullable<int> value);
    partial void OnAssetUnitChanged();
    partial void OnOrderPointChanging(System.Nullable<int> value);
    partial void OnOrderPointChanged();
    #endregion
		
		public Asset()
		{
			this._AssetUnit1 = default(EntityRef<AssetUnit>);
			this._Categ = default(EntityRef<Categ>);
			this._WareHouse = default(EntityRef<WareHouse101>);
			OnCreated();
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_AssetID", AutoSync=AutoSync.OnInsert, DbType="Int NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)]
		public int AssetID
		{
			get
			{
				return this._AssetID;
			}
			set
			{
				if ((this._AssetID != value))
				{
					this.OnAssetIDChanging(value);
					this.SendPropertyChanging();
					this._AssetID = value;
					this.SendPropertyChanged("AssetID");
					this.OnAssetIDChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_AssetName", DbType="NVarChar(50)")]
		public string AssetName
		{
			get
			{
				return this._AssetName;
			}
			set
			{
				if ((this._AssetName != value))
				{
					this.OnAssetNameChanging(value);
					this.SendPropertyChanging();
					this._AssetName = value;
					this.SendPropertyChanged("AssetName");
					this.OnAssetNameChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Categu", DbType="Int")]
		public System.Nullable<int> Categu
		{
			get
			{
				return this._Categu;
			}
			set
			{
				if ((this._Categu != value))
				{
					if (this._Categ.HasLoadedOrAssignedValue)
					{
						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
					}
					this.OnCateguChanging(value);
					this.SendPropertyChanging();
					this._Categu = value;
					this.SendPropertyChanged("Categu");
					this.OnCateguChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_MakanID", DbType="Int NOT NULL")]
		public int MakanID
		{
			get
			{
				return this._MakanID;
			}
			set
			{
				if ((this._MakanID != value))
				{
					if (this._WareHouse.HasLoadedOrAssignedValue)
					{
						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
					}
					this.OnMakanIDChanging(value);
					this.SendPropertyChanging();
					this._MakanID = value;
					this.SendPropertyChanged("MakanID");
					this.OnMakanIDChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_AssetUnit", DbType="Int")]
		public System.Nullable<int> AssetUnit
		{
			get
			{
				return this._AssetUnit;
			}
			set
			{
				if ((this._AssetUnit != value))
				{
					if (this._AssetUnit1.HasLoadedOrAssignedValue)
					{
						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
					}
					this.OnAssetUnitChanging(value);
					this.SendPropertyChanging();
					this._AssetUnit = value;
					this.SendPropertyChanged("AssetUnit");
					this.OnAssetUnitChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_OrderPoint", DbType="Int")]
		public System.Nullable<int> OrderPoint
		{
			get
			{
				return this._OrderPoint;
			}
			set
			{
				if ((this._OrderPoint != value))
				{
					this.OnOrderPointChanging(value);
					this.SendPropertyChanging();
					this._OrderPoint = value;
					this.SendPropertyChanged("OrderPoint");
					this.OnOrderPointChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="AssetUnit_Asset", Storage="_AssetUnit1", ThisKey="AssetUnit", OtherKey="AssetUnitID", IsForeignKey=true, DeleteRule="CASCADE")]
		public AssetUnit AssetUnit1
		{
			get
			{
				return this._AssetUnit1.Entity;
			}
			set
			{
				AssetUnit previousValue = this._AssetUnit1.Entity;
				if (((previousValue != value) 
							|| (this._AssetUnit1.HasLoadedOrAssignedValue == false)))
				{
					this.SendPropertyChanging();
					if ((previousValue != null))
					{
						this._AssetUnit1.Entity = null;
						previousValue.Assets.Remove(this);
					}
					this._AssetUnit1.Entity = value;
					if ((value != null))
					{
						value.Assets.Add(this);
						this._AssetUnit = value.AssetUnitID;
					}
					else
					{
						this._AssetUnit = default(Nullable<int>);
					}
					this.SendPropertyChanged("AssetUnit1");
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Categ_Asset", Storage="_Categ", ThisKey="Categu", OtherKey="CatID", IsForeignKey=true, DeleteRule="CASCADE")]
		public Categ Categ
		{
			get
			{
				return this._Categ.Entity;
			}
			set
			{
				Categ previousValue = this._Categ.Entity;
				if (((previousValue != value) 
							|| (this._Categ.HasLoadedOrAssignedValue == false)))
				{
					this.SendPropertyChanging();
					if ((previousValue != null))
					{
						this._Categ.Entity = null;
						previousValue.Assets.Remove(this);
					}
					this._Categ.Entity = value;
					if ((value != null))
					{
						value.Assets.Add(this);
						this._Categu = value.CatID;
					}
					else
					{
						this._Categu = default(Nullable<int>);
					}
					this.SendPropertyChanged("Categ");
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="WareHouse_Asset", Storage="_WareHouse", ThisKey="MakanID", OtherKey="WarHouseID", IsForeignKey=true, DeleteOnNull=true, DeleteRule="CASCADE")]
		public WareHouse101 WareHouse101
		{
			get
			{
				return this._WareHouse.Entity;
			}
			set
			{
				WareHouse101 previousValue = this._WareHouse.Entity;
				if (((previousValue != value) 
							|| (this._WareHouse.HasLoadedOrAssignedValue == false)))
				{
					this.SendPropertyChanging();
					if ((previousValue != null))
					{
						this._WareHouse.Entity = null;
						previousValue.Assets.Remove(this);
					}
					this._WareHouse.Entity = value;
					if ((value != null))
					{
						value.Assets.Add(this);
						this._MakanID = value.WarHouseID;
					}
					else
					{
						this._MakanID = default(int);
					}
					this.SendPropertyChanged("WareHouse101");
				}
			}
		}
		
		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));
			}
		}
	}
	
	[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.AssetUnits")]
	public partial class AssetUnit : INotifyPropertyChanging, INotifyPropertyChanged
	{
		
		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
		
		private int _AssetUnitID;
		
		private string _AssetUnit1;
		
		private EntitySet<Asset> _Assets;
		
    #region Extensibility Method Definitions
    partial void OnLoaded();
    partial void OnValidate(System.Data.Linq.ChangeAction action);
    partial void OnCreated();
    partial void OnAssetUnitIDChanging(int value);
    partial void OnAssetUnitIDChanged();
    partial void OnAssetUnit1Changing(string value);
    partial void OnAssetUnit1Changed();
    #endregion
		
		public AssetUnit()
		{
			this._Assets = new EntitySet<Asset>(new Action<Asset>(this.attach_Assets), new Action<Asset>(this.detach_Assets));
			OnCreated();
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_AssetUnitID", AutoSync=AutoSync.OnInsert, DbType="Int NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)]
		public int AssetUnitID
		{
			get
			{
				return this._AssetUnitID;
			}
			set
			{
				if ((this._AssetUnitID != value))
				{
					this.OnAssetUnitIDChanging(value);
					this.SendPropertyChanging();
					this._AssetUnitID = value;
					this.SendPropertyChanged("AssetUnitID");
					this.OnAssetUnitIDChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Name="AssetUnit", Storage="_AssetUnit1", DbType="NVarChar(50)")]
		public string AssetUnit1
		{
			get
			{
				return this._AssetUnit1;
			}
			set
			{
				if ((this._AssetUnit1 != value))
				{
					this.OnAssetUnit1Changing(value);
					this.SendPropertyChanging();
					this._AssetUnit1 = value;
					this.SendPropertyChanged("AssetUnit1");
					this.OnAssetUnit1Changed();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="AssetUnit_Asset", Storage="_Assets", ThisKey="AssetUnitID", OtherKey="AssetUnit")]
		public EntitySet<Asset> Assets
		{
			get
			{
				return this._Assets;
			}
			set
			{
				this._Assets.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_Assets(Asset entity)
		{
			this.SendPropertyChanging();
			entity.AssetUnit1 = this;
		}
		
		private void detach_Assets(Asset entity)
		{
			this.SendPropertyChanging();
			entity.AssetUnit1 = null;
		}
	}
	
	[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.Units")]
	public partial class Unit : INotifyPropertyChanging, INotifyPropertyChanged
	{
		
		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
		
		private int _UnitID;
		
		private string _UnitName;
		
		private EntitySet<TahvilShodegan> _TahvilShodegans;
		
    #region Extensibility Method Definitions
    partial void OnLoaded();
    partial void OnValidate(System.Data.Linq.ChangeAction action);
    partial void OnCreated();
    partial void OnUnitIDChanging(int value);
    partial void OnUnitIDChanged();
    partial void OnUnitNameChanging(string value);
    partial void OnUnitNameChanged();
    #endregion
		
		public Unit()
		{
			this._TahvilShodegans = new EntitySet<TahvilShodegan>(new Action<TahvilShodegan>(this.attach_TahvilShodegans), new Action<TahvilShodegan>(this.detach_TahvilShodegans));
			OnCreated();
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UnitID", AutoSync=AutoSync.OnInsert, DbType="Int NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)]
		public int UnitID
		{
			get
			{
				return this._UnitID;
			}
			set
			{
				if ((this._UnitID != value))
				{
					this.OnUnitIDChanging(value);
					this.SendPropertyChanging();
					this._UnitID = value;
					this.SendPropertyChanged("UnitID");
					this.OnUnitIDChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UnitName", DbType="NVarChar(30)")]
		public string UnitName
		{
			get
			{
				return this._UnitName;
			}
			set
			{
				if ((this._UnitName != value))
				{
					this.OnUnitNameChanging(value);
					this.SendPropertyChanging();
					this._UnitName = value;
					this.SendPropertyChanged("UnitName");
					this.OnUnitNameChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Unit_TahvilShodegan", Storage="_TahvilShodegans", ThisKey="UnitID", OtherKey="TahvilUnit")]
		public EntitySet<TahvilShodegan> TahvilShodegans
		{
			get
			{
				return this._TahvilShodegans;
			}
			set
			{
				this._TahvilShodegans.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_TahvilShodegans(TahvilShodegan entity)
		{
			this.SendPropertyChanging();
			entity.Unit = this;
		}
		
		private void detach_TahvilShodegans(TahvilShodegan entity)
		{
			this.SendPropertyChanging();
			entity.Unit = null;
		}
	}
	
	[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.Categ")]
	public partial class Categ : INotifyPropertyChanging, INotifyPropertyChanged
	{
		
		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
		
		private int _CatID;
		
		private string _Categ1;
		
		private EntitySet<Asset> _Assets;
		
    #region Extensibility Method Definitions
    partial void OnLoaded();
    partial void OnValidate(System.Data.Linq.ChangeAction action);
    partial void OnCreated();
    partial void OnCatIDChanging(int value);
    partial void OnCatIDChanged();
    partial void OnCateg1Changing(string value);
    partial void OnCateg1Changed();
    #endregion
		
		public Categ()
		{
			this._Assets = new EntitySet<Asset>(new Action<Asset>(this.attach_Assets), new Action<Asset>(this.detach_Assets));
			OnCreated();
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CatID", AutoSync=AutoSync.OnInsert, DbType="Int NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)]
		public int CatID
		{
			get
			{
				return this._CatID;
			}
			set
			{
				if ((this._CatID != value))
				{
					this.OnCatIDChanging(value);
					this.SendPropertyChanging();
					this._CatID = value;
					this.SendPropertyChanged("CatID");
					this.OnCatIDChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Name="Categ", Storage="_Categ1", DbType="NVarChar(50)")]
		public string Categ1
		{
			get
			{
				return this._Categ1;
			}
			set
			{
				if ((this._Categ1 != value))
				{
					this.OnCateg1Changing(value);
					this.SendPropertyChanging();
					this._Categ1 = value;
					this.SendPropertyChanged("Categ1");
					this.OnCateg1Changed();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Categ_Asset", Storage="_Assets", ThisKey="CatID", OtherKey="Categu")]
		public EntitySet<Asset> Assets
		{
			get
			{
				return this._Assets;
			}
			set
			{
				this._Assets.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_Assets(Asset entity)
		{
			this.SendPropertyChanging();
			entity.Categ = this;
		}
		
		private void detach_Assets(Asset entity)
		{
			this.SendPropertyChanging();
			entity.Categ = null;
		}
	}
	
	[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.WareHouse")]
	public partial class WareHouse101 : INotifyPropertyChanging, INotifyPropertyChanged
	{
		
		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
		
		private int _WarHouseID;
		
		private string _WareHouseName;
		
		private EntitySet<Asset> _Assets;
		
    #region Extensibility Method Definitions
    partial void OnLoaded();
    partial void OnValidate(System.Data.Linq.ChangeAction action);
    partial void OnCreated();
    partial void OnWarHouseIDChanging(int value);
    partial void OnWarHouseIDChanged();
    partial void OnWareHouseNameChanging(string value);
    partial void OnWareHouseNameChanged();
    #endregion
		
		public WareHouse101()
		{
			this._Assets = new EntitySet<Asset>(new Action<Asset>(this.attach_Assets), new Action<Asset>(this.detach_Assets));
			OnCreated();
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_WarHouseID", AutoSync=AutoSync.OnInsert, DbType="Int NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)]
		public int WarHouseID
		{
			get
			{
				return this._WarHouseID;
			}
			set
			{
				if ((this._WarHouseID != value))
				{
					this.OnWarHouseIDChanging(value);
					this.SendPropertyChanging();
					this._WarHouseID = value;
					this.SendPropertyChanged("WarHouseID");
					this.OnWarHouseIDChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_WareHouseName", DbType="NVarChar(50)")]
		public string WareHouseName
		{
			get
			{
				return this._WareHouseName;
			}
			set
			{
				if ((this._WareHouseName != value))
				{
					this.OnWareHouseNameChanging(value);
					this.SendPropertyChanging();
					this._WareHouseName = value;
					this.SendPropertyChanged("WareHouseName");
					this.OnWareHouseNameChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="WareHouse_Asset", Storage="_Assets", ThisKey="WarHouseID", OtherKey="MakanID")]
		public EntitySet<Asset> Assets
		{
			get
			{
				return this._Assets;
			}
			set
			{
				this._Assets.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_Assets(Asset entity)
		{
			this.SendPropertyChanging();
			entity.WareHouse101 = this;
		}
		
		private void detach_Assets(Asset entity)
		{
			this.SendPropertyChanging();
			entity.WareHouse101 = null;
		}
	}
	
	[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.Sefareshat")]
	public partial class Sefareshat : INotifyPropertyChanging, INotifyPropertyChanged
	{
		
		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
		
		private int _SefareshID;
		
		private System.Nullable<int> _UnitID;
		
		private System.Nullable<int> _AssetID;
		
		private System.Nullable<int> _Tedad;
		
		private System.Nullable<double> _DateSef;
		
		private bool _Purch;
		
		private string _DateShOfSefaresh;
		
		private string _DateShOfSefaresh1;
		
		private EntitySet<TahvilShodegan> _TahvilShodegans;
		
    #region Extensibility Method Definitions
    partial void OnLoaded();
    partial void OnValidate(System.Data.Linq.ChangeAction action);
    partial void OnCreated();
    partial void OnSefareshIDChanging(int value);
    partial void OnSefareshIDChanged();
    partial void OnUnitIDChanging(System.Nullable<int> value);
    partial void OnUnitIDChanged();
    partial void OnAssetIDChanging(System.Nullable<int> value);
    partial void OnAssetIDChanged();
    partial void OnTedadChanging(System.Nullable<int> value);
    partial void OnTedadChanged();
    partial void OnDateSefChanging(System.Nullable<double> value);
    partial void OnDateSefChanged();
    partial void OnPurchChanging(bool value);
    partial void OnPurchChanged();
    partial void OnDateShOfSefareshChanging(string value);
    partial void OnDateShOfSefareshChanged();
    partial void OnDateShOfSefaresh1Changing(string value);
    partial void OnDateShOfSefaresh1Changed();
    #endregion
		
		public Sefareshat()
		{
			this._TahvilShodegans = new EntitySet<TahvilShodegan>(new Action<TahvilShodegan>(this.attach_TahvilShodegans), new Action<TahvilShodegan>(this.detach_TahvilShodegans));
			OnCreated();
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_SefareshID", AutoSync=AutoSync.OnInsert, DbType="Int NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)]
		public int SefareshID
		{
			get
			{
				return this._SefareshID;
			}
			set
			{
				if ((this._SefareshID != value))
				{
					this.OnSefareshIDChanging(value);
					this.SendPropertyChanging();
					this._SefareshID = value;
					this.SendPropertyChanged("SefareshID");
					this.OnSefareshIDChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UnitID", DbType="Int")]
		public System.Nullable<int> UnitID
		{
			get
			{
				return this._UnitID;
			}
			set
			{
				if ((this._UnitID != value))
				{
					this.OnUnitIDChanging(value);
					this.SendPropertyChanging();
					this._UnitID = value;
					this.SendPropertyChanged("UnitID");
					this.OnUnitIDChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_AssetID", DbType="Int")]
		public System.Nullable<int> AssetID
		{
			get
			{
				return this._AssetID;
			}
			set
			{
				if ((this._AssetID != value))
				{
					this.OnAssetIDChanging(value);
					this.SendPropertyChanging();
					this._AssetID = value;
					this.SendPropertyChanged("AssetID");
					this.OnAssetIDChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Tedad", DbType="Int")]
		public System.Nullable<int> Tedad
		{
			get
			{
				return this._Tedad;
			}
			set
			{
				if ((this._Tedad != value))
				{
					this.OnTedadChanging(value);
					this.SendPropertyChanging();
					this._Tedad = value;
					this.SendPropertyChanged("Tedad");
					this.OnTedadChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_DateSef", DbType="Float")]
		public System.Nullable<double> DateSef
		{
			get
			{
				return this._DateSef;
			}
			set
			{
				if ((this._DateSef != value))
				{
					this.OnDateSefChanging(value);
					this.SendPropertyChanging();
					this._DateSef = value;
					this.SendPropertyChanged("DateSef");
					this.OnDateSefChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Purch", DbType="Bit NOT NULL")]
		public bool Purch
		{
			get
			{
				return this._Purch;
			}
			set
			{
				if ((this._Purch != value))
				{
					this.OnPurchChanging(value);
					this.SendPropertyChanging();
					this._Purch = value;
					this.SendPropertyChanged("Purch");
					this.OnPurchChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_DateShOfSefaresh", DbType="Text", UpdateCheck=UpdateCheck.Never)]
		public string DateShOfSefaresh
		{
			get
			{
				return this._DateShOfSefaresh;
			}
			set
			{
				if ((this._DateShOfSefaresh != value))
				{
					this.OnDateShOfSefareshChanging(value);
					this.SendPropertyChanging();
					this._DateShOfSefaresh = value;
					this.SendPropertyChanged("DateShOfSefaresh");
					this.OnDateShOfSefareshChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_DateShOfSefaresh1", DbType="NVarChar(50)")]
		public string DateShOfSefaresh1
		{
			get
			{
				return this._DateShOfSefaresh1;
			}
			set
			{
				if ((this._DateShOfSefaresh1 != value))
				{
					this.OnDateShOfSefaresh1Changing(value);
					this.SendPropertyChanging();
					this._DateShOfSefaresh1 = value;
					this.SendPropertyChanged("DateShOfSefaresh1");
					this.OnDateShOfSefaresh1Changed();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Sefareshat_TahvilShodegan", Storage="_TahvilShodegans", ThisKey="SefareshID", OtherKey="SefareshID")]
		public EntitySet<TahvilShodegan> TahvilShodegans
		{
			get
			{
				return this._TahvilShodegans;
			}
			set
			{
				this._TahvilShodegans.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_TahvilShodegans(TahvilShodegan entity)
		{
			this.SendPropertyChanging();
			entity.Sefareshat = this;
		}
		
		private void detach_TahvilShodegans(TahvilShodegan entity)
		{
			this.SendPropertyChanging();
			entity.Sefareshat = null;
		}
	}
	
	[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.TahvilShodegan")]
	public partial class TahvilShodegan : INotifyPropertyChanging, INotifyPropertyChanged
	{
		
		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
		
		private int _TahvilID;
		
		private int _SefareshID;
		
		private System.Nullable<int> _TahvilUnit;
		
		private string _TahvilDate;
		
		private string _Notes;
		
		private EntityRef<Sefareshat> _Sefareshat;
		
		private EntityRef<Unit> _Unit;
		
    #region Extensibility Method Definitions
    partial void OnLoaded();
    partial void OnValidate(System.Data.Linq.ChangeAction action);
    partial void OnCreated();
    partial void OnTahvilIDChanging(int value);
    partial void OnTahvilIDChanged();
    partial void OnSefareshIDChanging(int value);
    partial void OnSefareshIDChanged();
    partial void OnTahvilUnitChanging(System.Nullable<int> value);
    partial void OnTahvilUnitChanged();
    partial void OnTahvilDateChanging(string value);
    partial void OnTahvilDateChanged();
    partial void OnNotesChanging(string value);
    partial void OnNotesChanged();
    #endregion
		
		public TahvilShodegan()
		{
			this._Sefareshat = default(EntityRef<Sefareshat>);
			this._Unit = default(EntityRef<Unit>);
			OnCreated();
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_TahvilID", AutoSync=AutoSync.OnInsert, DbType="Int NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)]
		public int TahvilID
		{
			get
			{
				return this._TahvilID;
			}
			set
			{
				if ((this._TahvilID != value))
				{
					this.OnTahvilIDChanging(value);
					this.SendPropertyChanging();
					this._TahvilID = value;
					this.SendPropertyChanged("TahvilID");
					this.OnTahvilIDChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_SefareshID", DbType="Int NOT NULL")]
		public int SefareshID
		{
			get
			{
				return this._SefareshID;
			}
			set
			{
				if ((this._SefareshID != value))
				{
					if (this._Sefareshat.HasLoadedOrAssignedValue)
					{
						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
					}
					this.OnSefareshIDChanging(value);
					this.SendPropertyChanging();
					this._SefareshID = value;
					this.SendPropertyChanged("SefareshID");
					this.OnSefareshIDChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_TahvilUnit", DbType="Int")]
		public System.Nullable<int> TahvilUnit
		{
			get
			{
				return this._TahvilUnit;
			}
			set
			{
				if ((this._TahvilUnit != value))
				{
					if (this._Unit.HasLoadedOrAssignedValue)
					{
						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
					}
					this.OnTahvilUnitChanging(value);
					this.SendPropertyChanging();
					this._TahvilUnit = value;
					this.SendPropertyChanged("TahvilUnit");
					this.OnTahvilUnitChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_TahvilDate", DbType="NVarChar(53)")]
		public string TahvilDate
		{
			get
			{
				return this._TahvilDate;
			}
			set
			{
				if ((this._TahvilDate != value))
				{
					this.OnTahvilDateChanging(value);
					this.SendPropertyChanging();
					this._TahvilDate = value;
					this.SendPropertyChanged("TahvilDate");
					this.OnTahvilDateChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Notes", DbType="NVarChar(1200)")]
		public string Notes
		{
			get
			{
				return this._Notes;
			}
			set
			{
				if ((this._Notes != value))
				{
					this.OnNotesChanging(value);
					this.SendPropertyChanging();
					this._Notes = value;
					this.SendPropertyChanged("Notes");
					this.OnNotesChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Sefareshat_TahvilShodegan", Storage="_Sefareshat", ThisKey="SefareshID", OtherKey="SefareshID", IsForeignKey=true, DeleteOnNull=true, DeleteRule="CASCADE")]
		public Sefareshat Sefareshat
		{
			get
			{
				return this._Sefareshat.Entity;
			}
			set
			{
				Sefareshat previousValue = this._Sefareshat.Entity;
				if (((previousValue != value) 
							|| (this._Sefareshat.HasLoadedOrAssignedValue == false)))
				{
					this.SendPropertyChanging();
					if ((previousValue != null))
					{
						this._Sefareshat.Entity = null;
						previousValue.TahvilShodegans.Remove(this);
					}
					this._Sefareshat.Entity = value;
					if ((value != null))
					{
						value.TahvilShodegans.Add(this);
						this._SefareshID = value.SefareshID;
					}
					else
					{
						this._SefareshID = default(int);
					}
					this.SendPropertyChanged("Sefareshat");
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Unit_TahvilShodegan", Storage="_Unit", ThisKey="TahvilUnit", OtherKey="UnitID", IsForeignKey=true, DeleteRule="CASCADE")]
		public Unit Unit
		{
			get
			{
				return this._Unit.Entity;
			}
			set
			{
				Unit previousValue = this._Unit.Entity;
				if (((previousValue != value) 
							|| (this._Unit.HasLoadedOrAssignedValue == false)))
				{
					this.SendPropertyChanging();
					if ((previousValue != null))
					{
						this._Unit.Entity = null;
						previousValue.TahvilShodegans.Remove(this);
					}
					this._Unit.Entity = value;
					if ((value != null))
					{
						value.TahvilShodegans.Add(this);
						this._TahvilUnit = value.UnitID;
					}
					else
					{
						this._TahvilUnit = default(Nullable<int>);
					}
					this.SendPropertyChanged("Unit");
				}
			}
		}
		
		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));
			}
		}
	}
}
#pragma warning restore 1591
