⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 datamapping.designer.cs

📁 经典游戏程序设计:visual c++ 上的杀人游戏源代码
💻 CS
📖 第 1 页 / 共 4 页
字号:
#pragma warning disable 1591
//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//     Runtime Version:2.0.50727.1426
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

namespace DAL
{
	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="KillingGame")]
	public partial class DataMappingDataContext : System.Data.Linq.DataContext
	{
		
		private static System.Data.Linq.Mapping.MappingSource mappingSource = new AttributeMappingSource();
		
    #region Extensibility Method Definitions
    partial void OnCreated();
    partial void InsertActivity(Activity instance);
    partial void UpdateActivity(Activity instance);
    partial void DeleteActivity(Activity instance);
    partial void InsertRole(Role instance);
    partial void UpdateRole(Role instance);
    partial void DeleteRole(Role instance);
    partial void InsertActivityType(ActivityType instance);
    partial void UpdateActivityType(ActivityType instance);
    partial void DeleteActivityType(ActivityType instance);
    partial void InsertGame(Game instance);
    partial void UpdateGame(Game instance);
    partial void DeleteGame(Game instance);
    partial void InsertUser(User instance);
    partial void UpdateUser(User instance);
    partial void DeleteUser(User instance);
    partial void InsertPlayer(Player instance);
    partial void UpdatePlayer(Player instance);
    partial void DeletePlayer(Player instance);
    partial void InsertVote(Vote instance);
    partial void UpdateVote(Vote instance);
    partial void DeleteVote(Vote instance);
    partial void InsertGameStatus(GameStatus instance);
    partial void UpdateGameStatus(GameStatus instance);
    partial void DeleteGameStatus(GameStatus instance);
    #endregion
		
		public DataMappingDataContext() : 
				base(global::DAL.Properties.Settings.Default.KillingGameConnectionString, mappingSource)
		{
			OnCreated();
		}
		
		public DataMappingDataContext(string connection) : 
				base(connection, mappingSource)
		{
			OnCreated();
		}
		
		public DataMappingDataContext(System.Data.IDbConnection connection) : 
				base(connection, mappingSource)
		{
			OnCreated();
		}
		
		public DataMappingDataContext(string connection, System.Data.Linq.Mapping.MappingSource mappingSource) : 
				base(connection, mappingSource)
		{
			OnCreated();
		}
		
		public DataMappingDataContext(System.Data.IDbConnection connection, System.Data.Linq.Mapping.MappingSource mappingSource) : 
				base(connection, mappingSource)
		{
			OnCreated();
		}
		
		public System.Data.Linq.Table<Activity> Activities
		{
			get
			{
				return this.GetTable<Activity>();
			}
		}
		
		public System.Data.Linq.Table<Role> Roles
		{
			get
			{
				return this.GetTable<Role>();
			}
		}
		
		public System.Data.Linq.Table<ActivityType> ActivityTypes
		{
			get
			{
				return this.GetTable<ActivityType>();
			}
		}
		
		public System.Data.Linq.Table<Game> Games
		{
			get
			{
				return this.GetTable<Game>();
			}
		}
		
		public System.Data.Linq.Table<User> Users
		{
			get
			{
				return this.GetTable<User>();
			}
		}
		
		public System.Data.Linq.Table<Player> Players
		{
			get
			{
				return this.GetTable<Player>();
			}
		}
		
		public System.Data.Linq.Table<Vote> Votes
		{
			get
			{
				return this.GetTable<Vote>();
			}
		}
		
		public System.Data.Linq.Table<GameStatus> GameStatus
		{
			get
			{
				return this.GetTable<GameStatus>();
			}
		}
	}
	
	[Table(Name="dbo.Activity")]
	public partial class Activity : INotifyPropertyChanging, INotifyPropertyChanged
	{
		
		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
		
		private int _ActivityNo;
		
		private int _GameNo;
		
		private int _ActivityTypeID;
		
		private int _RoundCount;
		
		private EntitySet<Vote> _Votes;
		
		private EntityRef<ActivityType> _ActivityType;
		
		private EntityRef<Game> _Game;
		
    #region Extensibility Method Definitions
    partial void OnLoaded();
    partial void OnValidate(System.Data.Linq.ChangeAction action);
    partial void OnCreated();
    partial void OnActivityNoChanging(int value);
    partial void OnActivityNoChanged();
    partial void OnGameNoChanging(int value);
    partial void OnGameNoChanged();
    partial void OnActivityTypeIDChanging(int value);
    partial void OnActivityTypeIDChanged();
    partial void OnRoundCountChanging(int value);
    partial void OnRoundCountChanged();
    #endregion
		
		public Activity()
		{
			this._Votes = new EntitySet<Vote>(new Action<Vote>(this.attach_Votes), new Action<Vote>(this.detach_Votes));
			this._ActivityType = default(EntityRef<ActivityType>);
			this._Game = default(EntityRef<Game>);
			OnCreated();
		}
		
		[Column(Storage="_ActivityNo", AutoSync=AutoSync.OnInsert, DbType="Int NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)]
		public int ActivityNo
		{
			get
			{
				return this._ActivityNo;
			}
			set
			{
				if ((this._ActivityNo != value))
				{
					this.OnActivityNoChanging(value);
					this.SendPropertyChanging();
					this._ActivityNo = value;
					this.SendPropertyChanged("ActivityNo");
					this.OnActivityNoChanged();
				}
			}
		}
		
		[Column(Storage="_GameNo", DbType="Int NOT NULL")]
		public int GameNo
		{
			get
			{
				return this._GameNo;
			}
			set
			{
				if ((this._GameNo != value))
				{
					if (this._Game.HasLoadedOrAssignedValue)
					{
						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
					}
					this.OnGameNoChanging(value);
					this.SendPropertyChanging();
					this._GameNo = value;
					this.SendPropertyChanged("GameNo");
					this.OnGameNoChanged();
				}
			}
		}
		
		[Column(Storage="_ActivityTypeID", DbType="Int")]
		public int ActivityTypeID
		{
			get
			{
				return this._ActivityTypeID;
			}
			set
			{
				if ((this._ActivityTypeID != value))
				{
					if (this._ActivityType.HasLoadedOrAssignedValue)
					{
						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
					}
					this.OnActivityTypeIDChanging(value);
					this.SendPropertyChanging();
					this._ActivityTypeID = value;
					this.SendPropertyChanged("ActivityTypeID");
					this.OnActivityTypeIDChanged();
				}
			}
		}
		
		[Column(Storage="_RoundCount", DbType="Int NOT NULL")]
		public int RoundCount
		{
			get
			{
				return this._RoundCount;
			}
			set
			{
				if ((this._RoundCount != value))
				{
					this.OnRoundCountChanging(value);
					this.SendPropertyChanging();
					this._RoundCount = value;
					this.SendPropertyChanged("RoundCount");
					this.OnRoundCountChanged();
				}
			}
		}
		
		[Association(Name="Activity_Vote", Storage="_Votes", OtherKey="ActivityNo")]
		public EntitySet<Vote> Votes
		{
			get
			{
				return this._Votes;
			}
			set
			{
				this._Votes.Assign(value);
			}
		}
		
		[Association(Name="ActivityType_Activity", Storage="_ActivityType", ThisKey="ActivityTypeID", IsForeignKey=true)]
		public ActivityType ActivityType
		{
			get
			{
				return this._ActivityType.Entity;
			}
			set
			{
				ActivityType previousValue = this._ActivityType.Entity;
				if (((previousValue != value) 
							|| (this._ActivityType.HasLoadedOrAssignedValue == false)))
				{
					this.SendPropertyChanging();
					if ((previousValue != null))
					{
						this._ActivityType.Entity = null;
						previousValue.Activities.Remove(this);
					}
					this._ActivityType.Entity = value;
					if ((value != null))
					{
						value.Activities.Add(this);
						this._ActivityTypeID = value.ActivityTypeID;
					}
					else
					{
						this._ActivityTypeID = default(int);
					}
					this.SendPropertyChanged("ActivityType");
				}
			}
		}
		
		[Association(Name="Game_Activity", Storage="_Game", ThisKey="GameNo", IsForeignKey=true)]
		public Game Game
		{
			get
			{
				return this._Game.Entity;
			}
			set
			{
				Game previousValue = this._Game.Entity;
				if (((previousValue != value) 
							|| (this._Game.HasLoadedOrAssignedValue == false)))
				{
					this.SendPropertyChanging();
					if ((previousValue != null))
					{
						this._Game.Entity = null;
						previousValue.Activities.Remove(this);
					}
					this._Game.Entity = value;
					if ((value != null))
					{
						value.Activities.Add(this);
						this._GameNo = value.GameNo;
					}
					else
					{
						this._GameNo = default(int);
					}
					this.SendPropertyChanged("Game");
				}
			}
		}
		
		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_Votes(Vote entity)
		{
			this.SendPropertyChanging();
			entity.Activity = this;
		}
		
		private void detach_Votes(Vote entity)
		{
			this.SendPropertyChanging();
			entity.Activity = null;
		}
	}
	
	[Table(Name="dbo.Role")]
	public partial class Role : INotifyPropertyChanging, INotifyPropertyChanged
	{
		
		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
		
		private int _RoleID;
		
		private string _Name;
		
		private EntitySet<Player> _PlayerInGames;
		
    #region Extensibility Method Definitions
    partial void OnLoaded();
    partial void OnValidate(System.Data.Linq.ChangeAction action);
    partial void OnCreated();
    partial void OnRoleIDChanging(int value);
    partial void OnRoleIDChanged();
    partial void OnNameChanging(string value);
    partial void OnNameChanged();
    #endregion
		
		public Role()
		{
			this._PlayerInGames = new EntitySet<Player>(new Action<Player>(this.attach_PlayerInGames), new Action<Player>(this.detach_PlayerInGames));
			OnCreated();
		}
		
		[Column(Storage="_RoleID", DbType="Int NOT NULL", IsPrimaryKey=true)]
		public int RoleID
		{
			get
			{
				return this._RoleID;
			}
			set
			{
				if ((this._RoleID != value))
				{
					this.OnRoleIDChanging(value);
					this.SendPropertyChanging();
					this._RoleID = value;
					this.SendPropertyChanged("RoleID");
					this.OnRoleIDChanged();
				}
			}
		}
		
		[Column(Storage="_Name", DbType="NVarChar(50) NOT NULL", CanBeNull=false)]
		public string Name
		{
			get
			{
				return this._Name;
			}
			set
			{
				if ((this._Name != value))
				{
					this.OnNameChanging(value);
					this.SendPropertyChanging();
					this._Name = value;
					this.SendPropertyChanged("Name");
					this.OnNameChanged();
				}
			}
		}
		
		[Association(Name="Role_Player", Storage="_PlayerInGames", OtherKey="RoleID")]
		public EntitySet<Player> Players
		{
			get
			{
				return this._PlayerInGames;
			}
			set
			{
				this._PlayerInGames.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)
		{

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -