#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 HesabdariSubSys
{
	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="DbHesabDari")]
	public partial class LSC_HesabdariSubSysDataContext : System.Data.Linq.DataContext
	{
		
		private static System.Data.Linq.Mapping.MappingSource mappingSource = new AttributeMappingSource();
		
    #region Extensibility Method Definitions
    partial void OnCreated();
    partial void InserttblUser(tblUser instance);
    partial void UpdatetblUser(tblUser instance);
    partial void DeletetblUser(tblUser instance);
    partial void InserttblBookNumber(tblBookNumber instance);
    partial void UpdatetblBookNumber(tblBookNumber instance);
    partial void DeletetblBookNumber(tblBookNumber instance);
    partial void InserttblCashBook(tblCashBook instance);
    partial void UpdatetblCashBook(tblCashBook instance);
    partial void DeletetblCashBook(tblCashBook instance);
    partial void InserttblCheck(tblCheck instance);
    partial void UpdatetblCheck(tblCheck instance);
    partial void DeletetblCheck(tblCheck instance);
    partial void InserttblInhebitantEndBook(tblInhebitantEndBook instance);
    partial void UpdatetblInhebitantEndBook(tblInhebitantEndBook instance);
    partial void DeletetblInhebitantEndBook(tblInhebitantEndBook instance);
    partial void InserttblPensionBook(tblPensionBook instance);
    partial void UpdatetblPensionBook(tblPensionBook instance);
    partial void DeletetblPensionBook(tblPensionBook instance);
    partial void InserttblSalary(tblSalary instance);
    partial void UpdatetblSalary(tblSalary instance);
    partial void DeletetblSalary(tblSalary instance);
    partial void InserttblTotalDayBook(tblTotalDayBook instance);
    partial void UpdatetblTotalDayBook(tblTotalDayBook instance);
    partial void DeletetblTotalDayBook(tblTotalDayBook instance);
    partial void InserttblMerchanDiseBuyBook(tblMerchanDiseBuyBook instance);
    partial void UpdatetblMerchanDiseBuyBook(tblMerchanDiseBuyBook instance);
    partial void DeletetblMerchanDiseBuyBook(tblMerchanDiseBuyBook instance);
    #endregion
		
		public LSC_HesabdariSubSysDataContext() : 
				base(global::HesabdariSubSys.Properties.Settings.Default.DbHesabDariConnectionString, mappingSource)
		{
			OnCreated();
		}
		
		public LSC_HesabdariSubSysDataContext(string connection) : 
				base(connection, mappingSource)
		{
			OnCreated();
		}
		
		public LSC_HesabdariSubSysDataContext(System.Data.IDbConnection connection) : 
				base(connection, mappingSource)
		{
			OnCreated();
		}
		
		public LSC_HesabdariSubSysDataContext(string connection, System.Data.Linq.Mapping.MappingSource mappingSource) : 
				base(connection, mappingSource)
		{
			OnCreated();
		}
		
		public LSC_HesabdariSubSysDataContext(System.Data.IDbConnection connection, System.Data.Linq.Mapping.MappingSource mappingSource) : 
				base(connection, mappingSource)
		{
			OnCreated();
		}
		
		public System.Data.Linq.Table<tblUser> tblUsers
		{
			get
			{
				return this.GetTable<tblUser>();
			}
		}
		
		public System.Data.Linq.Table<tblBookNumber> tblBookNumbers
		{
			get
			{
				return this.GetTable<tblBookNumber>();
			}
		}
		
		public System.Data.Linq.Table<tblCashBook> tblCashBooks
		{
			get
			{
				return this.GetTable<tblCashBook>();
			}
		}
		
		public System.Data.Linq.Table<tblCheck> tblChecks
		{
			get
			{
				return this.GetTable<tblCheck>();
			}
		}
		
		public System.Data.Linq.Table<tblInhebitantEndBook> tblInhebitantEndBooks
		{
			get
			{
				return this.GetTable<tblInhebitantEndBook>();
			}
		}
		
		public System.Data.Linq.Table<tblPensionBook> tblPensionBooks
		{
			get
			{
				return this.GetTable<tblPensionBook>();
			}
		}
		
		public System.Data.Linq.Table<tblSalary> tblSalaries
		{
			get
			{
				return this.GetTable<tblSalary>();
			}
		}
		
		public System.Data.Linq.Table<tblTotalDayBook> tblTotalDayBooks
		{
			get
			{
				return this.GetTable<tblTotalDayBook>();
			}
		}
		
		public System.Data.Linq.Table<tblMerchanDiseBuyBook> tblMerchanDiseBuyBooks
		{
			get
			{
				return this.GetTable<tblMerchanDiseBuyBook>();
			}
		}
		
		public System.Data.Linq.Table<xtblBookHa> xtblBookHas
		{
			get
			{
				return this.GetTable<xtblBookHa>();
			}
		}
	}
	
	[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.tblUsers")]
	public partial class tblUser : INotifyPropertyChanging, INotifyPropertyChanged
	{
		
		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
		
		private int _UserID;
		
		private string _UserName;
		
		private string _UsersPassword;
		
    #region Extensibility Method Definitions
    partial void OnLoaded();
    partial void OnValidate(System.Data.Linq.ChangeAction action);
    partial void OnCreated();
    partial void OnUserIDChanging(int value);
    partial void OnUserIDChanged();
    partial void OnUserNameChanging(string value);
    partial void OnUserNameChanged();
    partial void OnUsersPasswordChanging(string value);
    partial void OnUsersPasswordChanged();
    #endregion
		
		public tblUser()
		{
			OnCreated();
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UserID", AutoSync=AutoSync.OnInsert, DbType="Int NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)]
		public int UserID
		{
			get
			{
				return this._UserID;
			}
			set
			{
				if ((this._UserID != value))
				{
					this.OnUserIDChanging(value);
					this.SendPropertyChanging();
					this._UserID = value;
					this.SendPropertyChanged("UserID");
					this.OnUserIDChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UserName", DbType="NVarChar(100) NOT NULL", CanBeNull=false)]
		public string UserName
		{
			get
			{
				return this._UserName;
			}
			set
			{
				if ((this._UserName != value))
				{
					this.OnUserNameChanging(value);
					this.SendPropertyChanging();
					this._UserName = value;
					this.SendPropertyChanged("UserName");
					this.OnUserNameChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UsersPassword", DbType="NVarChar(100) NOT NULL", CanBeNull=false)]
		public string UsersPassword
		{
			get
			{
				return this._UsersPassword;
			}
			set
			{
				if ((this._UsersPassword != value))
				{
					this.OnUsersPasswordChanging(value);
					this.SendPropertyChanging();
					this._UsersPassword = value;
					this.SendPropertyChanged("UsersPassword");
					this.OnUsersPasswordChanged();
				}
			}
		}
		
		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.tblBookNumbers")]
	public partial class tblBookNumber : INotifyPropertyChanging, INotifyPropertyChanged
	{
		
		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
		
		private int _BookNumber;
		
		private string _BookName;
		
		private EntitySet<tblCashBook> _tblCashBooks;
		
    #region Extensibility Method Definitions
    partial void OnLoaded();
    partial void OnValidate(System.Data.Linq.ChangeAction action);
    partial void OnCreated();
    partial void OnBookNumberChanging(int value);
    partial void OnBookNumberChanged();
    partial void OnBookNameChanging(string value);
    partial void OnBookNameChanged();
    #endregion
		
		public tblBookNumber()
		{
			this._tblCashBooks = new EntitySet<tblCashBook>(new Action<tblCashBook>(this.attach_tblCashBooks), new Action<tblCashBook>(this.detach_tblCashBooks));
			OnCreated();
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_BookNumber", AutoSync=AutoSync.OnInsert, DbType="Int NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)]
		public int BookNumber
		{
			get
			{
				return this._BookNumber;
			}
			set
			{
				if ((this._BookNumber != value))
				{
					this.OnBookNumberChanging(value);
					this.SendPropertyChanging();
					this._BookNumber = value;
					this.SendPropertyChanged("BookNumber");
					this.OnBookNumberChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_BookName", DbType="NVarChar(150) NOT NULL", CanBeNull=false)]
		public string BookName
		{
			get
			{
				return this._BookName;
			}
			set
			{
				if ((this._BookName != value))
				{
					this.OnBookNameChanging(value);
					this.SendPropertyChanging();
					this._BookName = value;
					this.SendPropertyChanged("BookName");
					this.OnBookNameChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="tblBookNumber_tblCashBook", Storage="_tblCashBooks", ThisKey="BookNumber", OtherKey="BookNumber")]
		public EntitySet<tblCashBook> tblCashBooks
		{
			get
			{
				return this._tblCashBooks;
			}
			set
			{
				this._tblCashBooks.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_tblCashBooks(tblCashBook entity)
		{
			this.SendPropertyChanging();
			entity.tblBookNumber = this;
		}
		
		private void detach_tblCashBooks(tblCashBook entity)
		{
			this.SendPropertyChanging();
			entity.tblBookNumber = null;
		}
	}
	
	[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.tblCashBook")]
	public partial class tblCashBook : INotifyPropertyChanging, INotifyPropertyChanged
	{
		
		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
		
		private decimal _CashBookCOde;
		
		private string _DateSabt;
		
		private System.Nullable<int> _BookNumber;
		
		private System.Nullable<decimal> _NumberBook;
		
		private System.Nullable<decimal> _Deptor;
		
		private System.Nullable<decimal> _Creditor;
		
		private EntityRef<tblBookNumber> _tblBookNumber;
		
    #region Extensibility Method Definitions
    partial void OnLoaded();
    partial void OnValidate(System.Data.Linq.ChangeAction action);
    partial void OnCreated();
    partial void OnCashBookCOdeChanging(decimal value);
    partial void OnCashBookCOdeChanged();
    partial void OnDateSabtChanging(string value);
    partial void OnDateSabtChanged();
    partial void OnBookNumberChanging(System.Nullable<int> value);
    partial void OnBookNumberChanged();
    partial void OnNumberBookChanging(System.Nullable<decimal> value);
    partial void OnNumberBookChanged();
    partial void OnDeptorChanging(System.Nullable<decimal> value);
    partial void OnDeptorChanged();
    partial void OnCreditorChanging(System.Nullable<decimal> value);
    partial void OnCreditorChanged();
    #endregion
		
		public tblCashBook()
		{
			this._tblBookNumber = default(EntityRef<tblBookNumber>);
			OnCreated();
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CashBookCOde", AutoSync=AutoSync.OnInsert, DbType="Decimal(18,0) NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)]
		public decimal CashBookCOde
		{
			get
			{
				return this._CashBookCOde;
			}
			set
			{
				if ((this._CashBookCOde != value))
				{
					this.OnCashBookCOdeChanging(value);
					this.SendPropertyChanging();
					this._CashBookCOde = value;
					this.SendPropertyChanged("CashBookCOde");
					this.OnCashBookCOdeChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_DateSabt", DbType="NVarChar(10)")]
		public string DateSabt
		{
			get
			{
				return this._DateSabt;
			}
			set
			{
				if ((this._DateSabt != value))
				{
					this.OnDateSabtChanging(value);
					this.SendPropertyChanging();
					this._DateSabt = value;
					this.SendPropertyChanged("DateSabt");
					this.OnDateSabtChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_BookNumber", DbType="Int")]
		public System.Nullable<int> BookNumber
		{
			get
			{
				return this._BookNumber;
			}
			set
			{
				if ((this._BookNumber != value))
				{
					if (this._tblBookNumber.HasLoadedOrAssignedValue)
					{
						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
					}
					this.OnBookNumberChanging(value);
					this.SendPropertyChanging();
					this._BookNumber = value;
					this.SendPropertyChanged("BookNumber");
					this.OnBookNumberChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_NumberBook", DbType="Decimal(18,0)")]
		public System.Nullable<decimal> NumberBook
		{
			get
			{
				return this._NumberBook;
			}
			set
			{
				if ((this._NumberBook != value))
				{
					this.OnNumberBookChanging(value);
					this.SendPropertyChanging();
					this._NumberBook = value;
					this.SendPropertyChanged("NumberBook");
					this.OnNumberBookChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Deptor", DbType="Decimal(18,0)")]
		public System.Nullable<decimal> Deptor
		{
			get
			{
				return this._Deptor;
			}
			set
			{
				if ((this._Deptor != value))
				{
					this.OnDeptorChanging(value);
					this.SendPropertyChanging();
					this._Deptor = value;
					this.SendPropertyChanged("Deptor");
					this.OnDeptorChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Creditor", DbType="Decimal(18,0)")]
		public System.Nullable<decimal> Creditor
		{
			get
			{
				return this._Creditor;
			}
			set
			{
				if ((this._Creditor != value))
				{
					this.OnCreditorChanging(value);
					this.SendPropertyChanging();
					this._Creditor = value;
					this.SendPropertyChanged("Creditor");
					this.OnCreditorChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="tblBookNumber_tblCashBook", Storage="_tblBookNumber", ThisKey="BookNumber", OtherKey="BookNumber", IsForeignKey=true, DeleteRule="CASCADE")]
		public tblBookNumber tblBookNumber
		{
			get
			{
				return this._tblBookNumber.Entity;
			}
			set
			{
				tblBookNumber previousValue = this._tblBookNumber.Entity;
				if (((previousValue != value) 
							|| (this._tblBookNumber.HasLoadedOrAssignedValue == false)))
				{
					this.SendPropertyChanging();
					if ((previousValue != null))
					{
						this._tblBookNumber.Entity = null;
						previousValue.tblCashBooks.Remove(this);
					}
					this._tblBookNumber.Entity = value;
					if ((value != null))
					{
						value.tblCashBooks.Add(this);
						this._BookNumber = value.BookNumber;
					}
					else
					{
						this._BookNumber = default(Nullable<int>);
					}
					this.SendPropertyChanged("tblBookNumber");
				}
			}
		}
		
		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.tblChecks")]
	public partial class tblCheck : INotifyPropertyChanging, INotifyPropertyChanged
	{
		
		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
		
		private decimal _CheckCode;
		
		private string _SerialNo;
		
		private string _CheckNumber;
		
		private string _BankName;
		
		private string _BankBranck;
		
		private string _DateOfCheck;
		
		private decimal _CostOfCheck;
		
		private string _PaymentTo;
		
		private string _AccountNumber;
		
		private string _SignerName;
		
		private string _ExplNotes;
		
		private EntitySet<tblInhebitantEndBook> _tblInhebitantEndBooks;
		
		private EntitySet<tblTotalDayBook> _tblTotalDayBooks;
		
		private EntitySet<tblMerchanDiseBuyBook> _tblMerchanDiseBuyBooks;
		
    #region Extensibility Method Definitions
    partial void OnLoaded();
    partial void OnValidate(System.Data.Linq.ChangeAction action);
    partial void OnCreated();
    partial void OnCheckCodeChanging(decimal value);
    partial void OnCheckCodeChanged();
    partial void OnSerialNoChanging(string value);
    partial void OnSerialNoChanged();
    partial void OnCheckNumberChanging(string value);
    partial void OnCheckNumberChanged();
    partial void OnBankNameChanging(string value);
    partial void OnBankNameChanged();
    partial void OnBankBranckChanging(string value);
    partial void OnBankBranckChanged();
    partial void OnDateOfCheckChanging(string value);
    partial void OnDateOfCheckChanged();
    partial void OnCostOfCheckChanging(decimal value);
    partial void OnCostOfCheckChanged();
    partial void OnPaymentToChanging(string value);
    partial void OnPaymentToChanged();
    partial void OnAccountNumberChanging(string value);
    partial void OnAccountNumberChanged();
    partial void OnSignerNameChanging(string value);
    partial void OnSignerNameChanged();
    partial void OnExplNotesChanging(string value);
    partial void OnExplNotesChanged();
    #endregion
		
		public tblCheck()
		{
			this._tblInhebitantEndBooks = new EntitySet<tblInhebitantEndBook>(new Action<tblInhebitantEndBook>(this.attach_tblInhebitantEndBooks), new Action<tblInhebitantEndBook>(this.detach_tblInhebitantEndBooks));
			this._tblTotalDayBooks = new EntitySet<tblTotalDayBook>(new Action<tblTotalDayBook>(this.attach_tblTotalDayBooks), new Action<tblTotalDayBook>(this.detach_tblTotalDayBooks));
			this._tblMerchanDiseBuyBooks = new EntitySet<tblMerchanDiseBuyBook>(new Action<tblMerchanDiseBuyBook>(this.attach_tblMerchanDiseBuyBooks), new Action<tblMerchanDiseBuyBook>(this.detach_tblMerchanDiseBuyBooks));
			OnCreated();
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CheckCode", AutoSync=AutoSync.OnInsert, DbType="Decimal(18,0) NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)]
		public decimal CheckCode
		{
			get
			{
				return this._CheckCode;
			}
			set
			{
				if ((this._CheckCode != value))
				{
					this.OnCheckCodeChanging(value);
					this.SendPropertyChanging();
					this._CheckCode = value;
					this.SendPropertyChanged("CheckCode");
					this.OnCheckCodeChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_SerialNo", DbType="NVarChar(50) NOT NULL", CanBeNull=false)]
		public string SerialNo
		{
			get
			{
				return this._SerialNo;
			}
			set
			{
				if ((this._SerialNo != value))
				{
					this.OnSerialNoChanging(value);
					this.SendPropertyChanging();
					this._SerialNo = value;
					this.SendPropertyChanged("SerialNo");
					this.OnSerialNoChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CheckNumber", DbType="NVarChar(50) NOT NULL", CanBeNull=false)]
		public string CheckNumber
		{
			get
			{
				return this._CheckNumber;
			}
			set
			{
				if ((this._CheckNumber != value))
				{
					this.OnCheckNumberChanging(value);
					this.SendPropertyChanging();
					this._CheckNumber = value;
					this.SendPropertyChanged("CheckNumber");
					this.OnCheckNumberChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_BankName", DbType="NVarChar(100) NOT NULL", CanBeNull=false)]
		public string BankName
		{
			get
			{
				return this._BankName;
			}
			set
			{
				if ((this._BankName != value))
				{
					this.OnBankNameChanging(value);
					this.SendPropertyChanging();
					this._BankName = value;
					this.SendPropertyChanged("BankName");
					this.OnBankNameChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_BankBranck", DbType="NVarChar(100) NOT NULL", CanBeNull=false)]
		public string BankBranck
		{
			get
			{
				return this._BankBranck;
			}
			set
			{
				if ((this._BankBranck != value))
				{
					this.OnBankBranckChanging(value);
					this.SendPropertyChanging();
					this._BankBranck = value;
					this.SendPropertyChanged("BankBranck");
					this.OnBankBranckChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_DateOfCheck", DbType="NVarChar(10) NOT NULL", CanBeNull=false)]
		public string DateOfCheck
		{
			get
			{
				return this._DateOfCheck;
			}
			set
			{
				if ((this._DateOfCheck != value))
				{
					this.OnDateOfCheckChanging(value);
					this.SendPropertyChanging();
					this._DateOfCheck = value;
					this.SendPropertyChanged("DateOfCheck");
					this.OnDateOfCheckChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CostOfCheck", DbType="Decimal(18,0) NOT NULL")]
		public decimal CostOfCheck
		{
			get
			{
				return this._CostOfCheck;
			}
			set
			{
				if ((this._CostOfCheck != value))
				{
					this.OnCostOfCheckChanging(value);
					this.SendPropertyChanging();
					this._CostOfCheck = value;
					this.SendPropertyChanged("CostOfCheck");
					this.OnCostOfCheckChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PaymentTo", DbType="NVarChar(100) NOT NULL", CanBeNull=false)]
		public string PaymentTo
		{
			get
			{
				return this._PaymentTo;
			}
			set
			{
				if ((this._PaymentTo != value))
				{
					this.OnPaymentToChanging(value);
					this.SendPropertyChanging();
					this._PaymentTo = value;
					this.SendPropertyChanged("PaymentTo");
					this.OnPaymentToChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_AccountNumber", DbType="NVarChar(50) NOT NULL", CanBeNull=false)]
		public string AccountNumber
		{
			get
			{
				return this._AccountNumber;
			}
			set
			{
				if ((this._AccountNumber != value))
				{
					this.OnAccountNumberChanging(value);
					this.SendPropertyChanging();
					this._AccountNumber = value;
					this.SendPropertyChanged("AccountNumber");
					this.OnAccountNumberChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_SignerName", DbType="NVarChar(150) NOT NULL", CanBeNull=false)]
		public string SignerName
		{
			get
			{
				return this._SignerName;
			}
			set
			{
				if ((this._SignerName != value))
				{
					this.OnSignerNameChanging(value);
					this.SendPropertyChanging();
					this._SignerName = value;
					this.SendPropertyChanged("SignerName");
					this.OnSignerNameChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ExplNotes", DbType="NVarChar(500) NOT NULL", CanBeNull=false)]
		public string ExplNotes
		{
			get
			{
				return this._ExplNotes;
			}
			set
			{
				if ((this._ExplNotes != value))
				{
					this.OnExplNotesChanging(value);
					this.SendPropertyChanging();
					this._ExplNotes = value;
					this.SendPropertyChanged("ExplNotes");
					this.OnExplNotesChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="tblCheck_tblInhebitantEndBook", Storage="_tblInhebitantEndBooks", ThisKey="CheckCode", OtherKey="CheckCode")]
		public EntitySet<tblInhebitantEndBook> tblInhebitantEndBooks
		{
			get
			{
				return this._tblInhebitantEndBooks;
			}
			set
			{
				this._tblInhebitantEndBooks.Assign(value);
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="tblCheck_tblTotalDayBook", Storage="_tblTotalDayBooks", ThisKey="CheckCode", OtherKey="CheckCOde")]
		public EntitySet<tblTotalDayBook> tblTotalDayBooks
		{
			get
			{
				return this._tblTotalDayBooks;
			}
			set
			{
				this._tblTotalDayBooks.Assign(value);
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="tblCheck_tblMerchanDiseBuyBook", Storage="_tblMerchanDiseBuyBooks", ThisKey="CheckCode", OtherKey="CheckCode")]
		public EntitySet<tblMerchanDiseBuyBook> tblMerchanDiseBuyBooks
		{
			get
			{
				return this._tblMerchanDiseBuyBooks;
			}
			set
			{
				this._tblMerchanDiseBuyBooks.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_tblInhebitantEndBooks(tblInhebitantEndBook entity)
		{
			this.SendPropertyChanging();
			entity.tblCheck = this;
		}
		
		private void detach_tblInhebitantEndBooks(tblInhebitantEndBook entity)
		{
			this.SendPropertyChanging();
			entity.tblCheck = null;
		}
		
		private void attach_tblTotalDayBooks(tblTotalDayBook entity)
		{
			this.SendPropertyChanging();
			entity.tblCheck = this;
		}
		
		private void detach_tblTotalDayBooks(tblTotalDayBook entity)
		{
			this.SendPropertyChanging();
			entity.tblCheck = null;
		}
		
		private void attach_tblMerchanDiseBuyBooks(tblMerchanDiseBuyBook entity)
		{
			this.SendPropertyChanging();
			entity.tblCheck = this;
		}
		
		private void detach_tblMerchanDiseBuyBooks(tblMerchanDiseBuyBook entity)
		{
			this.SendPropertyChanging();
			entity.tblCheck = null;
		}
	}
	
	[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.tblInhebitantEndBook")]
	public partial class tblInhebitantEndBook : INotifyPropertyChanging, INotifyPropertyChanged
	{
		
		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
		
		private decimal _InhebitantEndBookCode;
		
		private string _RoomNumber;
		
		private decimal _CheckCode;
		
		private decimal _Debtor;
		
		private decimal _Creditor;
		
		private EntityRef<tblCheck> _tblCheck;
		
    #region Extensibility Method Definitions
    partial void OnLoaded();
    partial void OnValidate(System.Data.Linq.ChangeAction action);
    partial void OnCreated();
    partial void OnInhebitantEndBookCodeChanging(decimal value);
    partial void OnInhebitantEndBookCodeChanged();
    partial void OnRoomNumberChanging(string value);
    partial void OnRoomNumberChanged();
    partial void OnCheckCodeChanging(decimal value);
    partial void OnCheckCodeChanged();
    partial void OnDebtorChanging(decimal value);
    partial void OnDebtorChanged();
    partial void OnCreditorChanging(decimal value);
    partial void OnCreditorChanged();
    #endregion
		
		public tblInhebitantEndBook()
		{
			this._tblCheck = default(EntityRef<tblCheck>);
			OnCreated();
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_InhebitantEndBookCode", AutoSync=AutoSync.OnInsert, DbType="Decimal(18,0) NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)]
		public decimal InhebitantEndBookCode
		{
			get
			{
				return this._InhebitantEndBookCode;
			}
			set
			{
				if ((this._InhebitantEndBookCode != value))
				{
					this.OnInhebitantEndBookCodeChanging(value);
					this.SendPropertyChanging();
					this._InhebitantEndBookCode = value;
					this.SendPropertyChanged("InhebitantEndBookCode");
					this.OnInhebitantEndBookCodeChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_RoomNumber", DbType="NVarChar(100) NOT NULL", CanBeNull=false)]
		public string RoomNumber
		{
			get
			{
				return this._RoomNumber;
			}
			set
			{
				if ((this._RoomNumber != value))
				{
					this.OnRoomNumberChanging(value);
					this.SendPropertyChanging();
					this._RoomNumber = value;
					this.SendPropertyChanged("RoomNumber");
					this.OnRoomNumberChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CheckCode", DbType="Decimal(18,0) NOT NULL")]
		public decimal CheckCode
		{
			get
			{
				return this._CheckCode;
			}
			set
			{
				if ((this._CheckCode != value))
				{
					if (this._tblCheck.HasLoadedOrAssignedValue)
					{
						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
					}
					this.OnCheckCodeChanging(value);
					this.SendPropertyChanging();
					this._CheckCode = value;
					this.SendPropertyChanged("CheckCode");
					this.OnCheckCodeChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Debtor", DbType="Decimal(18,0) NOT NULL")]
		public decimal Debtor
		{
			get
			{
				return this._Debtor;
			}
			set
			{
				if ((this._Debtor != value))
				{
					this.OnDebtorChanging(value);
					this.SendPropertyChanging();
					this._Debtor = value;
					this.SendPropertyChanged("Debtor");
					this.OnDebtorChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Creditor", DbType="Decimal(18,0) NOT NULL")]
		public decimal Creditor
		{
			get
			{
				return this._Creditor;
			}
			set
			{
				if ((this._Creditor != value))
				{
					this.OnCreditorChanging(value);
					this.SendPropertyChanging();
					this._Creditor = value;
					this.SendPropertyChanged("Creditor");
					this.OnCreditorChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="tblCheck_tblInhebitantEndBook", Storage="_tblCheck", ThisKey="CheckCode", OtherKey="CheckCode", IsForeignKey=true, DeleteOnNull=true, DeleteRule="CASCADE")]
		public tblCheck tblCheck
		{
			get
			{
				return this._tblCheck.Entity;
			}
			set
			{
				tblCheck previousValue = this._tblCheck.Entity;
				if (((previousValue != value) 
							|| (this._tblCheck.HasLoadedOrAssignedValue == false)))
				{
					this.SendPropertyChanging();
					if ((previousValue != null))
					{
						this._tblCheck.Entity = null;
						previousValue.tblInhebitantEndBooks.Remove(this);
					}
					this._tblCheck.Entity = value;
					if ((value != null))
					{
						value.tblInhebitantEndBooks.Add(this);
						this._CheckCode = value.CheckCode;
					}
					else
					{
						this._CheckCode = default(decimal);
					}
					this.SendPropertyChanged("tblCheck");
				}
			}
		}
		
		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.tblPensionBook")]
	public partial class tblPensionBook : INotifyPropertyChanging, INotifyPropertyChanged
	{
		
		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
		
		private decimal _PeinsionBookCode;
		
		private string _RoomNumber;
		
		private string _CustomerCode;
		
		private string _RequestServideDescription;
		
    #region Extensibility Method Definitions
    partial void OnLoaded();
    partial void OnValidate(System.Data.Linq.ChangeAction action);
    partial void OnCreated();
    partial void OnPeinsionBookCodeChanging(decimal value);
    partial void OnPeinsionBookCodeChanged();
    partial void OnRoomNumberChanging(string value);
    partial void OnRoomNumberChanged();
    partial void OnCustomerCodeChanging(string value);
    partial void OnCustomerCodeChanged();
    partial void OnRequestServideDescriptionChanging(string value);
    partial void OnRequestServideDescriptionChanged();
    #endregion
		
		public tblPensionBook()
		{
			OnCreated();
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PeinsionBookCode", AutoSync=AutoSync.OnInsert, DbType="Decimal(18,0) NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)]
		public decimal PeinsionBookCode
		{
			get
			{
				return this._PeinsionBookCode;
			}
			set
			{
				if ((this._PeinsionBookCode != value))
				{
					this.OnPeinsionBookCodeChanging(value);
					this.SendPropertyChanging();
					this._PeinsionBookCode = value;
					this.SendPropertyChanged("PeinsionBookCode");
					this.OnPeinsionBookCodeChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_RoomNumber", DbType="NVarChar(100) NOT NULL", CanBeNull=false)]
		public string RoomNumber
		{
			get
			{
				return this._RoomNumber;
			}
			set
			{
				if ((this._RoomNumber != value))
				{
					this.OnRoomNumberChanging(value);
					this.SendPropertyChanging();
					this._RoomNumber = value;
					this.SendPropertyChanged("RoomNumber");
					this.OnRoomNumberChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CustomerCode", DbType="NVarChar(100) NOT NULL", CanBeNull=false)]
		public string CustomerCode
		{
			get
			{
				return this._CustomerCode;
			}
			set
			{
				if ((this._CustomerCode != value))
				{
					this.OnCustomerCodeChanging(value);
					this.SendPropertyChanging();
					this._CustomerCode = value;
					this.SendPropertyChanged("CustomerCode");
					this.OnCustomerCodeChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_RequestServideDescription", DbType="NVarChar(500) NOT NULL", CanBeNull=false)]
		public string RequestServideDescription
		{
			get
			{
				return this._RequestServideDescription;
			}
			set
			{
				if ((this._RequestServideDescription != value))
				{
					this.OnRequestServideDescriptionChanging(value);
					this.SendPropertyChanging();
					this._RequestServideDescription = value;
					this.SendPropertyChanged("RequestServideDescription");
					this.OnRequestServideDescriptionChanged();
				}
			}
		}
		
		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.tblSalary")]
	public partial class tblSalary : INotifyPropertyChanging, INotifyPropertyChanged
	{
		
		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
		
		private decimal _SalaryCode;
		
		private string _PayDate;
		
		private string _EmployeeCode;
		
		private decimal _Deptor;
		
		private decimal _Creditor;
		
    #region Extensibility Method Definitions
    partial void OnLoaded();
    partial void OnValidate(System.Data.Linq.ChangeAction action);
    partial void OnCreated();
    partial void OnSalaryCodeChanging(decimal value);
    partial void OnSalaryCodeChanged();
    partial void OnPayDateChanging(string value);
    partial void OnPayDateChanged();
    partial void OnEmployeeCodeChanging(string value);
    partial void OnEmployeeCodeChanged();
    partial void OnDeptorChanging(decimal value);
    partial void OnDeptorChanged();
    partial void OnCreditorChanging(decimal value);
    partial void OnCreditorChanged();
    #endregion
		
		public tblSalary()
		{
			OnCreated();
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_SalaryCode", AutoSync=AutoSync.OnInsert, DbType="Decimal(18,0) NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)]
		public decimal SalaryCode
		{
			get
			{
				return this._SalaryCode;
			}
			set
			{
				if ((this._SalaryCode != value))
				{
					this.OnSalaryCodeChanging(value);
					this.SendPropertyChanging();
					this._SalaryCode = value;
					this.SendPropertyChanged("SalaryCode");
					this.OnSalaryCodeChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PayDate", DbType="NVarChar(10) NOT NULL", CanBeNull=false)]
		public string PayDate
		{
			get
			{
				return this._PayDate;
			}
			set
			{
				if ((this._PayDate != value))
				{
					this.OnPayDateChanging(value);
					this.SendPropertyChanging();
					this._PayDate = value;
					this.SendPropertyChanged("PayDate");
					this.OnPayDateChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_EmployeeCode", DbType="NVarChar(100) NOT NULL", CanBeNull=false)]
		public string EmployeeCode
		{
			get
			{
				return this._EmployeeCode;
			}
			set
			{
				if ((this._EmployeeCode != value))
				{
					this.OnEmployeeCodeChanging(value);
					this.SendPropertyChanging();
					this._EmployeeCode = value;
					this.SendPropertyChanged("EmployeeCode");
					this.OnEmployeeCodeChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Deptor", DbType="Decimal(18,0) NOT NULL")]
		public decimal Deptor
		{
			get
			{
				return this._Deptor;
			}
			set
			{
				if ((this._Deptor != value))
				{
					this.OnDeptorChanging(value);
					this.SendPropertyChanging();
					this._Deptor = value;
					this.SendPropertyChanged("Deptor");
					this.OnDeptorChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Creditor", DbType="Decimal(18,0) NOT NULL")]
		public decimal Creditor
		{
			get
			{
				return this._Creditor;
			}
			set
			{
				if ((this._Creditor != value))
				{
					this.OnCreditorChanging(value);
					this.SendPropertyChanging();
					this._Creditor = value;
					this.SendPropertyChanged("Creditor");
					this.OnCreditorChanged();
				}
			}
		}
		
		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.tblTotalDayBook")]
	public partial class tblTotalDayBook : INotifyPropertyChanging, INotifyPropertyChanged
	{
		
		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
		
		private decimal _RooznamehCode;
		
		private string _DateOfSabt;
		
		private string _ExplNotes;
		
		private decimal _CheckCOde;
		
		private decimal _Debtor;
		
		private decimal _Creditor;
		
		private EntityRef<tblCheck> _tblCheck;
		
    #region Extensibility Method Definitions
    partial void OnLoaded();
    partial void OnValidate(System.Data.Linq.ChangeAction action);
    partial void OnCreated();
    partial void OnRooznamehCodeChanging(decimal value);
    partial void OnRooznamehCodeChanged();
    partial void OnDateOfSabtChanging(string value);
    partial void OnDateOfSabtChanged();
    partial void OnExplNotesChanging(string value);
    partial void OnExplNotesChanged();
    partial void OnCheckCOdeChanging(decimal value);
    partial void OnCheckCOdeChanged();
    partial void OnDebtorChanging(decimal value);
    partial void OnDebtorChanged();
    partial void OnCreditorChanging(decimal value);
    partial void OnCreditorChanged();
    #endregion
		
		public tblTotalDayBook()
		{
			this._tblCheck = default(EntityRef<tblCheck>);
			OnCreated();
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_RooznamehCode", AutoSync=AutoSync.OnInsert, DbType="Decimal(18,0) NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)]
		public decimal RooznamehCode
		{
			get
			{
				return this._RooznamehCode;
			}
			set
			{
				if ((this._RooznamehCode != value))
				{
					this.OnRooznamehCodeChanging(value);
					this.SendPropertyChanging();
					this._RooznamehCode = value;
					this.SendPropertyChanged("RooznamehCode");
					this.OnRooznamehCodeChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_DateOfSabt", DbType="NVarChar(10) NOT NULL", CanBeNull=false)]
		public string DateOfSabt
		{
			get
			{
				return this._DateOfSabt;
			}
			set
			{
				if ((this._DateOfSabt != value))
				{
					this.OnDateOfSabtChanging(value);
					this.SendPropertyChanging();
					this._DateOfSabt = value;
					this.SendPropertyChanged("DateOfSabt");
					this.OnDateOfSabtChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ExplNotes", DbType="NVarChar(500) NOT NULL", CanBeNull=false)]
		public string ExplNotes
		{
			get
			{
				return this._ExplNotes;
			}
			set
			{
				if ((this._ExplNotes != value))
				{
					this.OnExplNotesChanging(value);
					this.SendPropertyChanging();
					this._ExplNotes = value;
					this.SendPropertyChanged("ExplNotes");
					this.OnExplNotesChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CheckCOde", DbType="Decimal(18,0) NOT NULL")]
		public decimal CheckCOde
		{
			get
			{
				return this._CheckCOde;
			}
			set
			{
				if ((this._CheckCOde != value))
				{
					if (this._tblCheck.HasLoadedOrAssignedValue)
					{
						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
					}
					this.OnCheckCOdeChanging(value);
					this.SendPropertyChanging();
					this._CheckCOde = value;
					this.SendPropertyChanged("CheckCOde");
					this.OnCheckCOdeChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Debtor", DbType="Decimal(18,0) NOT NULL")]
		public decimal Debtor
		{
			get
			{
				return this._Debtor;
			}
			set
			{
				if ((this._Debtor != value))
				{
					this.OnDebtorChanging(value);
					this.SendPropertyChanging();
					this._Debtor = value;
					this.SendPropertyChanged("Debtor");
					this.OnDebtorChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Creditor", DbType="Decimal(18,0) NOT NULL")]
		public decimal Creditor
		{
			get
			{
				return this._Creditor;
			}
			set
			{
				if ((this._Creditor != value))
				{
					this.OnCreditorChanging(value);
					this.SendPropertyChanging();
					this._Creditor = value;
					this.SendPropertyChanged("Creditor");
					this.OnCreditorChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="tblCheck_tblTotalDayBook", Storage="_tblCheck", ThisKey="CheckCOde", OtherKey="CheckCode", IsForeignKey=true, DeleteOnNull=true, DeleteRule="CASCADE")]
		public tblCheck tblCheck
		{
			get
			{
				return this._tblCheck.Entity;
			}
			set
			{
				tblCheck previousValue = this._tblCheck.Entity;
				if (((previousValue != value) 
							|| (this._tblCheck.HasLoadedOrAssignedValue == false)))
				{
					this.SendPropertyChanging();
					if ((previousValue != null))
					{
						this._tblCheck.Entity = null;
						previousValue.tblTotalDayBooks.Remove(this);
					}
					this._tblCheck.Entity = value;
					if ((value != null))
					{
						value.tblTotalDayBooks.Add(this);
						this._CheckCOde = value.CheckCode;
					}
					else
					{
						this._CheckCOde = default(decimal);
					}
					this.SendPropertyChanged("tblCheck");
				}
			}
		}
		
		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.tblMerchanDiseBuyBook")]
	public partial class tblMerchanDiseBuyBook : INotifyPropertyChanging, INotifyPropertyChanged
	{
		
		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
		
		private decimal _MerchanDiseBuyBookCode;
		
		private string _BuyFactorCode;
		
		private decimal _CheckCode;
		
		private decimal _Debtor;
		
		private decimal _Creditor;
		
		private string _ExplNotes;
		
		private EntityRef<tblCheck> _tblCheck;
		
    #region Extensibility Method Definitions
    partial void OnLoaded();
    partial void OnValidate(System.Data.Linq.ChangeAction action);
    partial void OnCreated();
    partial void OnMerchanDiseBuyBookCodeChanging(decimal value);
    partial void OnMerchanDiseBuyBookCodeChanged();
    partial void OnBuyFactorCodeChanging(string value);
    partial void OnBuyFactorCodeChanged();
    partial void OnCheckCodeChanging(decimal value);
    partial void OnCheckCodeChanged();
    partial void OnDebtorChanging(decimal value);
    partial void OnDebtorChanged();
    partial void OnCreditorChanging(decimal value);
    partial void OnCreditorChanged();
    partial void OnExplNotesChanging(string value);
    partial void OnExplNotesChanged();
    #endregion
		
		public tblMerchanDiseBuyBook()
		{
			this._tblCheck = default(EntityRef<tblCheck>);
			OnCreated();
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_MerchanDiseBuyBookCode", AutoSync=AutoSync.OnInsert, DbType="Decimal(18,0) NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)]
		public decimal MerchanDiseBuyBookCode
		{
			get
			{
				return this._MerchanDiseBuyBookCode;
			}
			set
			{
				if ((this._MerchanDiseBuyBookCode != value))
				{
					this.OnMerchanDiseBuyBookCodeChanging(value);
					this.SendPropertyChanging();
					this._MerchanDiseBuyBookCode = value;
					this.SendPropertyChanged("MerchanDiseBuyBookCode");
					this.OnMerchanDiseBuyBookCodeChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_BuyFactorCode", DbType="NVarChar(20) NOT NULL", CanBeNull=false)]
		public string BuyFactorCode
		{
			get
			{
				return this._BuyFactorCode;
			}
			set
			{
				if ((this._BuyFactorCode != value))
				{
					this.OnBuyFactorCodeChanging(value);
					this.SendPropertyChanging();
					this._BuyFactorCode = value;
					this.SendPropertyChanged("BuyFactorCode");
					this.OnBuyFactorCodeChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CheckCode", DbType="Decimal(18,0) NOT NULL")]
		public decimal CheckCode
		{
			get
			{
				return this._CheckCode;
			}
			set
			{
				if ((this._CheckCode != value))
				{
					if (this._tblCheck.HasLoadedOrAssignedValue)
					{
						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
					}
					this.OnCheckCodeChanging(value);
					this.SendPropertyChanging();
					this._CheckCode = value;
					this.SendPropertyChanged("CheckCode");
					this.OnCheckCodeChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Debtor", DbType="Decimal(18,0) NOT NULL")]
		public decimal Debtor
		{
			get
			{
				return this._Debtor;
			}
			set
			{
				if ((this._Debtor != value))
				{
					this.OnDebtorChanging(value);
					this.SendPropertyChanging();
					this._Debtor = value;
					this.SendPropertyChanged("Debtor");
					this.OnDebtorChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Creditor", DbType="Decimal(18,0) NOT NULL")]
		public decimal Creditor
		{
			get
			{
				return this._Creditor;
			}
			set
			{
				if ((this._Creditor != value))
				{
					this.OnCreditorChanging(value);
					this.SendPropertyChanging();
					this._Creditor = value;
					this.SendPropertyChanged("Creditor");
					this.OnCreditorChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ExplNotes", DbType="NVarChar(500) NOT NULL", CanBeNull=false)]
		public string ExplNotes
		{
			get
			{
				return this._ExplNotes;
			}
			set
			{
				if ((this._ExplNotes != value))
				{
					this.OnExplNotesChanging(value);
					this.SendPropertyChanging();
					this._ExplNotes = value;
					this.SendPropertyChanged("ExplNotes");
					this.OnExplNotesChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="tblCheck_tblMerchanDiseBuyBook", Storage="_tblCheck", ThisKey="CheckCode", OtherKey="CheckCode", IsForeignKey=true, DeleteOnNull=true, DeleteRule="CASCADE")]
		public tblCheck tblCheck
		{
			get
			{
				return this._tblCheck.Entity;
			}
			set
			{
				tblCheck previousValue = this._tblCheck.Entity;
				if (((previousValue != value) 
							|| (this._tblCheck.HasLoadedOrAssignedValue == false)))
				{
					this.SendPropertyChanging();
					if ((previousValue != null))
					{
						this._tblCheck.Entity = null;
						previousValue.tblMerchanDiseBuyBooks.Remove(this);
					}
					this._tblCheck.Entity = value;
					if ((value != null))
					{
						value.tblMerchanDiseBuyBooks.Add(this);
						this._CheckCode = value.CheckCode;
					}
					else
					{
						this._CheckCode = default(decimal);
					}
					this.SendPropertyChanged("tblCheck");
				}
			}
		}
		
		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.xtblBookHa")]
	public partial class xtblBookHa
	{
		
		private int _BN1;
		
		private string _BN2;
		
		public xtblBookHa()
		{
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_BN1", AutoSync=AutoSync.Always, DbType="Int NOT NULL IDENTITY", IsDbGenerated=true)]
		public int BN1
		{
			get
			{
				return this._BN1;
			}
			set
			{
				if ((this._BN1 != value))
				{
					this._BN1 = value;
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_BN2", DbType="NVarChar(150) NOT NULL", CanBeNull=false)]
		public string BN2
		{
			get
			{
				return this._BN2;
			}
			set
			{
				if ((this._BN2 != value))
				{
					this._BN2 = value;
				}
			}
		}
	}
}
#pragma warning restore 1591
