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

namespace Morakhassi
{
	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;
	
	
	[System.Data.Linq.Mapping.DatabaseAttribute(Name="ArzeshGozari")]
	public partial class lscArzeshGozariDataContext : System.Data.Linq.DataContext
	{
		
		private static System.Data.Linq.Mapping.MappingSource mappingSource = new AttributeMappingSource();
		
    #region Extensibility Method Definitions
    partial void OnCreated();
    partial void InserttblLog(tblLog instance);
    partial void UpdatetblLog(tblLog instance);
    partial void DeletetblLog(tblLog instance);
    partial void InserttblUser(tblUser instance);
    partial void UpdatetblUser(tblUser instance);
    partial void DeletetblUser(tblUser instance);
    partial void InserttblUserType(tblUserType instance);
    partial void UpdatetblUserType(tblUserType instance);
    partial void DeletetblUserType(tblUserType instance);
    #endregion
		
		public lscArzeshGozariDataContext() : 
				base(global::Morakhassi.Properties.Settings.Default.ArzeshGozariConnectionString, mappingSource)
		{
			OnCreated();
		}
		
		public lscArzeshGozariDataContext(string connection) : 
				base(connection, mappingSource)
		{
			OnCreated();
		}
		
		public lscArzeshGozariDataContext(System.Data.IDbConnection connection) : 
				base(connection, mappingSource)
		{
			OnCreated();
		}
		
		public lscArzeshGozariDataContext(string connection, System.Data.Linq.Mapping.MappingSource mappingSource) : 
				base(connection, mappingSource)
		{
			OnCreated();
		}
		
		public lscArzeshGozariDataContext(System.Data.IDbConnection connection, System.Data.Linq.Mapping.MappingSource mappingSource) : 
				base(connection, mappingSource)
		{
			OnCreated();
		}
		
		public System.Data.Linq.Table<tblLog> tblLogs
		{
			get
			{
				return this.GetTable<tblLog>();
			}
		}
		
		public System.Data.Linq.Table<tblUser> tblUsers
		{
			get
			{
				return this.GetTable<tblUser>();
			}
		}
		
		public System.Data.Linq.Table<tblUserType> tblUserTypes
		{
			get
			{
				return this.GetTable<tblUserType>();
			}
		}
	}
	
	[Table(Name="dbo.tblLogs")]
	public partial class tblLog : INotifyPropertyChanging, INotifyPropertyChanged
	{
		
		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
		
		private decimal _LogNumberID;
		
		private string _PersonnelliCode;
		
		private System.DateTime _LogDateTime;
		
		private string _LogDescription;
		
    #region Extensibility Method Definitions
    partial void OnLoaded();
    partial void OnValidate(System.Data.Linq.ChangeAction action);
    partial void OnCreated();
    partial void OnLogNumberIDChanging(decimal value);
    partial void OnLogNumberIDChanged();
    partial void OnPersonnelliCodeChanging(string value);
    partial void OnPersonnelliCodeChanged();
    partial void OnLogDateTimeChanging(System.DateTime value);
    partial void OnLogDateTimeChanged();
    partial void OnLogDescriptionChanging(string value);
    partial void OnLogDescriptionChanged();
    #endregion
		
		public tblLog()
		{
			OnCreated();
		}
		
		[Column(Storage="_LogNumberID", AutoSync=AutoSync.OnInsert, DbType="Decimal(18,0) NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)]
		public decimal LogNumberID
		{
			get
			{
				return this._LogNumberID;
			}
			set
			{
				if ((this._LogNumberID != value))
				{
					this.OnLogNumberIDChanging(value);
					this.SendPropertyChanging();
					this._LogNumberID = value;
					this.SendPropertyChanged("LogNumberID");
					this.OnLogNumberIDChanged();
				}
			}
		}
		
		[Column(Storage="_PersonnelliCode", DbType="NVarChar(100) NOT NULL", CanBeNull=false)]
		public string PersonnelliCode
		{
			get
			{
				return this._PersonnelliCode;
			}
			set
			{
				if ((this._PersonnelliCode != value))
				{
					this.OnPersonnelliCodeChanging(value);
					this.SendPropertyChanging();
					this._PersonnelliCode = value;
					this.SendPropertyChanged("PersonnelliCode");
					this.OnPersonnelliCodeChanged();
				}
			}
		}
		
		[Column(Storage="_LogDateTime", DbType="DateTime NOT NULL")]
		public System.DateTime LogDateTime
		{
			get
			{
				return this._LogDateTime;
			}
			set
			{
				if ((this._LogDateTime != value))
				{
					this.OnLogDateTimeChanging(value);
					this.SendPropertyChanging();
					this._LogDateTime = value;
					this.SendPropertyChanged("LogDateTime");
					this.OnLogDateTimeChanged();
				}
			}
		}
		
		[Column(Storage="_LogDescription", DbType="NVarChar(500) NOT NULL", CanBeNull=false)]
		public string LogDescription
		{
			get
			{
				return this._LogDescription;
			}
			set
			{
				if ((this._LogDescription != value))
				{
					this.OnLogDescriptionChanging(value);
					this.SendPropertyChanging();
					this._LogDescription = value;
					this.SendPropertyChanged("LogDescription");
					this.OnLogDescriptionChanged();
				}
			}
		}
		
		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));
			}
		}
	}
	
	[Table(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 _UserPassword;
		
		private int _UserTypeID;
		
		private string _NameOfUser;
		
		private string _UserSname;
		
		private string _PersonnelliCode;
		
		private string _MelliCode;
		
		private System.DateTime _DateOfRegister;
		
		private System.DateTime _DateOfStaffing;
		
		private System.Nullable<bool> _UserBanBit;
		
		private System.Data.Linq.Binary _UserPic;
		
		private EntityRef<tblUserType> _tblUserType;
		
    #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 OnUserPasswordChanging(string value);
    partial void OnUserPasswordChanged();
    partial void OnUserTypeIDChanging(int value);
    partial void OnUserTypeIDChanged();
    partial void OnNameOfUserChanging(string value);
    partial void OnNameOfUserChanged();
    partial void OnUserSnameChanging(string value);
    partial void OnUserSnameChanged();
    partial void OnPersonnelliCodeChanging(string value);
    partial void OnPersonnelliCodeChanged();
    partial void OnMelliCodeChanging(string value);
    partial void OnMelliCodeChanged();
    partial void OnDateOfRegisterChanging(System.DateTime value);
    partial void OnDateOfRegisterChanged();
    partial void OnDateOfStaffingChanging(System.DateTime value);
    partial void OnDateOfStaffingChanged();
    partial void OnUserBanBitChanging(System.Nullable<bool> value);
    partial void OnUserBanBitChanged();
    partial void OnUserPicChanging(System.Data.Linq.Binary value);
    partial void OnUserPicChanged();
    #endregion
		
		public tblUser()
		{
			this._tblUserType = default(EntityRef<tblUserType>);
			OnCreated();
		}
		
		[Column(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();
				}
			}
		}
		
		[Column(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();
				}
			}
		}
		
		[Column(Storage="_UserPassword", DbType="NVarChar(100) NOT NULL", CanBeNull=false)]
		public string UserPassword
		{
			get
			{
				return this._UserPassword;
			}
			set
			{
				if ((this._UserPassword != value))
				{
					this.OnUserPasswordChanging(value);
					this.SendPropertyChanging();
					this._UserPassword = value;
					this.SendPropertyChanged("UserPassword");
					this.OnUserPasswordChanged();
				}
			}
		}
		
		[Column(Storage="_UserTypeID", DbType="Int NOT NULL")]
		public int UserTypeID
		{
			get
			{
				return this._UserTypeID;
			}
			set
			{
				if ((this._UserTypeID != value))
				{
					if (this._tblUserType.HasLoadedOrAssignedValue)
					{
						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
					}
					this.OnUserTypeIDChanging(value);
					this.SendPropertyChanging();
					this._UserTypeID = value;
					this.SendPropertyChanged("UserTypeID");
					this.OnUserTypeIDChanged();
				}
			}
		}
		
		[Column(Storage="_NameOfUser", DbType="NVarChar(100) NOT NULL", CanBeNull=false)]
		public string NameOfUser
		{
			get
			{
				return this._NameOfUser;
			}
			set
			{
				if ((this._NameOfUser != value))
				{
					this.OnNameOfUserChanging(value);
					this.SendPropertyChanging();
					this._NameOfUser = value;
					this.SendPropertyChanged("NameOfUser");
					this.OnNameOfUserChanged();
				}
			}
		}
		
		[Column(Storage="_UserSname", DbType="NVarChar(100) NOT NULL", CanBeNull=false)]
		public string UserSname
		{
			get
			{
				return this._UserSname;
			}
			set
			{
				if ((this._UserSname != value))
				{
					this.OnUserSnameChanging(value);
					this.SendPropertyChanging();
					this._UserSname = value;
					this.SendPropertyChanged("UserSname");
					this.OnUserSnameChanged();
				}
			}
		}
		
		[Column(Storage="_PersonnelliCode", DbType="NVarChar(100) NOT NULL", CanBeNull=false)]
		public string PersonnelliCode
		{
			get
			{
				return this._PersonnelliCode;
			}
			set
			{
				if ((this._PersonnelliCode != value))
				{
					this.OnPersonnelliCodeChanging(value);
					this.SendPropertyChanging();
					this._PersonnelliCode = value;
					this.SendPropertyChanged("PersonnelliCode");
					this.OnPersonnelliCodeChanged();
				}
			}
		}
		
		[Column(Storage="_MelliCode", DbType="NVarChar(10) NOT NULL", CanBeNull=false)]
		public string MelliCode
		{
			get
			{
				return this._MelliCode;
			}
			set
			{
				if ((this._MelliCode != value))
				{
					this.OnMelliCodeChanging(value);
					this.SendPropertyChanging();
					this._MelliCode = value;
					this.SendPropertyChanged("MelliCode");
					this.OnMelliCodeChanged();
				}
			}
		}
		
		[Column(Storage="_DateOfRegister", DbType="DateTime NOT NULL")]
		public System.DateTime DateOfRegister
		{
			get
			{
				return this._DateOfRegister;
			}
			set
			{
				if ((this._DateOfRegister != value))
				{
					this.OnDateOfRegisterChanging(value);
					this.SendPropertyChanging();
					this._DateOfRegister = value;
					this.SendPropertyChanged("DateOfRegister");
					this.OnDateOfRegisterChanged();
				}
			}
		}
		
		[Column(Storage="_DateOfStaffing", DbType="DateTime NOT NULL")]
		public System.DateTime DateOfStaffing
		{
			get
			{
				return this._DateOfStaffing;
			}
			set
			{
				if ((this._DateOfStaffing != value))
				{
					this.OnDateOfStaffingChanging(value);
					this.SendPropertyChanging();
					this._DateOfStaffing = value;
					this.SendPropertyChanged("DateOfStaffing");
					this.OnDateOfStaffingChanged();
				}
			}
		}
		
		[Column(Storage="_UserBanBit", DbType="Bit")]
		public System.Nullable<bool> UserBanBit
		{
			get
			{
				return this._UserBanBit;
			}
			set
			{
				if ((this._UserBanBit != value))
				{
					this.OnUserBanBitChanging(value);
					this.SendPropertyChanging();
					this._UserBanBit = value;
					this.SendPropertyChanged("UserBanBit");
					this.OnUserBanBitChanged();
				}
			}
		}
		
		[Column(Storage="_UserPic", DbType="Image", UpdateCheck=UpdateCheck.Never)]
		public System.Data.Linq.Binary UserPic
		{
			get
			{
				return this._UserPic;
			}
			set
			{
				if ((this._UserPic != value))
				{
					this.OnUserPicChanging(value);
					this.SendPropertyChanging();
					this._UserPic = value;
					this.SendPropertyChanged("UserPic");
					this.OnUserPicChanged();
				}
			}
		}
		
		[Association(Name="tblUserType_tblUser", Storage="_tblUserType", ThisKey="UserTypeID", IsForeignKey=true, DeleteOnNull=true, DeleteRule="CASCADE")]
		public tblUserType tblUserType
		{
			get
			{
				return this._tblUserType.Entity;
			}
			set
			{
				tblUserType previousValue = this._tblUserType.Entity;
				if (((previousValue != value) 
							|| (this._tblUserType.HasLoadedOrAssignedValue == false)))
				{
					this.SendPropertyChanging();
					if ((previousValue != null))
					{
						this._tblUserType.Entity = null;
						previousValue.tblUsers.Remove(this);
					}
					this._tblUserType.Entity = value;
					if ((value != null))
					{
						value.tblUsers.Add(this);
						this._UserTypeID = value.UserTypesID;
					}
					else
					{
						this._UserTypeID = default(int);
					}
					this.SendPropertyChanged("tblUserType");
				}
			}
		}
		
		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));
			}
		}
	}
	
	[Table(Name="dbo.tblUserTypes")]
	public partial class tblUserType : INotifyPropertyChanging, INotifyPropertyChanged
	{
		
		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
		
		private int _UserTypesID;
		
		private string _UserTypeDescription;
		
		private EntitySet<tblUser> _tblUsers;
		
    #region Extensibility Method Definitions
    partial void OnLoaded();
    partial void OnValidate(System.Data.Linq.ChangeAction action);
    partial void OnCreated();
    partial void OnUserTypesIDChanging(int value);
    partial void OnUserTypesIDChanged();
    partial void OnUserTypeDescriptionChanging(string value);
    partial void OnUserTypeDescriptionChanged();
    #endregion
		
		public tblUserType()
		{
			this._tblUsers = new EntitySet<tblUser>(new Action<tblUser>(this.attach_tblUsers), new Action<tblUser>(this.detach_tblUsers));
			OnCreated();
		}
		
		[Column(Storage="_UserTypesID", AutoSync=AutoSync.OnInsert, DbType="Int NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)]
		public int UserTypesID
		{
			get
			{
				return this._UserTypesID;
			}
			set
			{
				if ((this._UserTypesID != value))
				{
					this.OnUserTypesIDChanging(value);
					this.SendPropertyChanging();
					this._UserTypesID = value;
					this.SendPropertyChanged("UserTypesID");
					this.OnUserTypesIDChanged();
				}
			}
		}
		
		[Column(Storage="_UserTypeDescription", DbType="NVarChar(100) NOT NULL", CanBeNull=false)]
		public string UserTypeDescription
		{
			get
			{
				return this._UserTypeDescription;
			}
			set
			{
				if ((this._UserTypeDescription != value))
				{
					this.OnUserTypeDescriptionChanging(value);
					this.SendPropertyChanging();
					this._UserTypeDescription = value;
					this.SendPropertyChanged("UserTypeDescription");
					this.OnUserTypeDescriptionChanged();
				}
			}
		}
		
		[Association(Name="tblUserType_tblUser", Storage="_tblUsers", OtherKey="UserTypeID")]
		public EntitySet<tblUser> tblUsers
		{
			get
			{
				return this._tblUsers;
			}
			set
			{
				this._tblUsers.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_tblUsers(tblUser entity)
		{
			this.SendPropertyChanging();
			entity.tblUserType = this;
		}
		
		private void detach_tblUsers(tblUser entity)
		{
			this.SendPropertyChanging();
			entity.tblUserType = null;
		}
	}
}
#pragma warning restore 1591
