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

📄 northwind.designer.cs

📁 数据库连接查询
💻 CS
📖 第 1 页 / 共 4 页
字号:
				this._LastName = value;
				this.SendPropertyChanged("LastName");
				this.OnLastNameChanged();
			}
		}
	}
	
	[Column(Storage="_FirstName", DbType="NVarChar(10) NOT NULL", CanBeNull=false)]
	public string FirstName
	{
		get
		{
			return this._FirstName;
		}
		set
		{
			if ((this._FirstName != value))
			{
				this.OnFirstNameChanging(value);
				this.SendPropertyChanging();
				this._FirstName = value;
				this.SendPropertyChanged("FirstName");
				this.OnFirstNameChanged();
			}
		}
	}
	
	[Column(Storage="_Title", DbType="NVarChar(30)")]
	public string Title
	{
		get
		{
			return this._Title;
		}
		set
		{
			if ((this._Title != value))
			{
				this.OnTitleChanging(value);
				this.SendPropertyChanging();
				this._Title = value;
				this.SendPropertyChanged("Title");
				this.OnTitleChanged();
			}
		}
	}
	
	[Column(Storage="_TitleOfCourtesy", DbType="NVarChar(25)")]
	public string TitleOfCourtesy
	{
		get
		{
			return this._TitleOfCourtesy;
		}
		set
		{
			if ((this._TitleOfCourtesy != value))
			{
				this.OnTitleOfCourtesyChanging(value);
				this.SendPropertyChanging();
				this._TitleOfCourtesy = value;
				this.SendPropertyChanged("TitleOfCourtesy");
				this.OnTitleOfCourtesyChanged();
			}
		}
	}
	
	[Column(Storage="_BirthDate", DbType="DateTime")]
	public System.Nullable<System.DateTime> BirthDate
	{
		get
		{
			return this._BirthDate;
		}
		set
		{
			if ((this._BirthDate != value))
			{
				this.OnBirthDateChanging(value);
				this.SendPropertyChanging();
				this._BirthDate = value;
				this.SendPropertyChanged("BirthDate");
				this.OnBirthDateChanged();
			}
		}
	}
	
	[Column(Storage="_HireDate", DbType="DateTime")]
	public System.Nullable<System.DateTime> HireDate
	{
		get
		{
			return this._HireDate;
		}
		set
		{
			if ((this._HireDate != value))
			{
				this.OnHireDateChanging(value);
				this.SendPropertyChanging();
				this._HireDate = value;
				this.SendPropertyChanged("HireDate");
				this.OnHireDateChanged();
			}
		}
	}
	
	[Column(Storage="_Address", DbType="NVarChar(60)")]
	public string Address
	{
		get
		{
			return this._Address;
		}
		set
		{
			if ((this._Address != value))
			{
				this.OnAddressChanging(value);
				this.SendPropertyChanging();
				this._Address = value;
				this.SendPropertyChanged("Address");
				this.OnAddressChanged();
			}
		}
	}
	
	[Column(Storage="_City", DbType="NVarChar(15)")]
	public string City
	{
		get
		{
			return this._City;
		}
		set
		{
			if ((this._City != value))
			{
				this.OnCityChanging(value);
				this.SendPropertyChanging();
				this._City = value;
				this.SendPropertyChanged("City");
				this.OnCityChanged();
			}
		}
	}
	
	[Column(Storage="_Region", DbType="NVarChar(15)")]
	public string Region
	{
		get
		{
			return this._Region;
		}
		set
		{
			if ((this._Region != value))
			{
				this.OnRegionChanging(value);
				this.SendPropertyChanging();
				this._Region = value;
				this.SendPropertyChanged("Region");
				this.OnRegionChanged();
			}
		}
	}
	
	[Column(Storage="_PostalCode", DbType="NVarChar(10)")]
	public string PostalCode
	{
		get
		{
			return this._PostalCode;
		}
		set
		{
			if ((this._PostalCode != value))
			{
				this.OnPostalCodeChanging(value);
				this.SendPropertyChanging();
				this._PostalCode = value;
				this.SendPropertyChanged("PostalCode");
				this.OnPostalCodeChanged();
			}
		}
	}
	
	[Column(Storage="_Country", DbType="NVarChar(15)")]
	public string Country
	{
		get
		{
			return this._Country;
		}
		set
		{
			if ((this._Country != value))
			{
				this.OnCountryChanging(value);
				this.SendPropertyChanging();
				this._Country = value;
				this.SendPropertyChanged("Country");
				this.OnCountryChanged();
			}
		}
	}
	
	[Column(Storage="_HomePhone", DbType="NVarChar(24)")]
	public string HomePhone
	{
		get
		{
			return this._HomePhone;
		}
		set
		{
			if ((this._HomePhone != value))
			{
				this.OnHomePhoneChanging(value);
				this.SendPropertyChanging();
				this._HomePhone = value;
				this.SendPropertyChanged("HomePhone");
				this.OnHomePhoneChanged();
			}
		}
	}
	
	[Column(Storage="_Extension", DbType="NVarChar(4)")]
	public string Extension
	{
		get
		{
			return this._Extension;
		}
		set
		{
			if ((this._Extension != value))
			{
				this.OnExtensionChanging(value);
				this.SendPropertyChanging();
				this._Extension = value;
				this.SendPropertyChanged("Extension");
				this.OnExtensionChanged();
			}
		}
	}
	
	[Column(Storage="_Photo", DbType="Image", UpdateCheck=UpdateCheck.Never)]
	public byte[] Photo
	{
		get
		{
			return this._Photo;
		}
		set
		{
			if ((this._Photo != value))
			{
				this.OnPhotoChanging(value);
				this.SendPropertyChanging();
				this._Photo = value;
				this.SendPropertyChanged("Photo");
				this.OnPhotoChanged();
			}
		}
	}
	
	[Column(Storage="_Notes", DbType="NText", UpdateCheck=UpdateCheck.Never)]
	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();
			}
		}
	}
	
	[Column(Storage="_ReportsTo", DbType="Int")]
	public System.Nullable<int> ReportsTo
	{
		get
		{
			return this._ReportsTo;
		}
		set
		{
			if ((this._ReportsTo != value))
			{
				if (this._Employee1.HasLoadedOrAssignedValue)
				{
					throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
				}
				this.OnReportsToChanging(value);
				this.SendPropertyChanging();
				this._ReportsTo = value;
				this.SendPropertyChanged("ReportsTo");
				this.OnReportsToChanged();
			}
		}
	}
	
	[Column(Storage="_PhotoPath", DbType="NVarChar(255)")]
	public string PhotoPath
	{
		get
		{
			return this._PhotoPath;
		}
		set
		{
			if ((this._PhotoPath != value))
			{
				this.OnPhotoPathChanging(value);
				this.SendPropertyChanging();
				this._PhotoPath = value;
				this.SendPropertyChanged("PhotoPath");
				this.OnPhotoPathChanged();
			}
		}
	}
	
	[Association(Name="Employee_Employee", Storage="_Employees", OtherKey="ReportsTo")]
	public EntitySet<Employee> Employees
	{
		get
		{
			return this._Employees;
		}
		set
		{
			this._Employees.Assign(value);
		}
	}
	
	[Association(Name="Employee_Order", Storage="_Orders", OtherKey="EmployeeID")]
	public EntitySet<Order> Orders
	{
		get
		{
			return this._Orders;
		}
		set
		{
			this._Orders.Assign(value);
		}
	}
	
	[Association(Name="Employee_Employee", Storage="_Employee1", ThisKey="ReportsTo", IsForeignKey=true)]
	public Employee Employee1
	{
		get
		{
			return this._Employee1.Entity;
		}
		set
		{
			Employee previousValue = this._Employee1.Entity;
			if (((previousValue != value) 
						|| (this._Employee1.HasLoadedOrAssignedValue == false)))
			{
				this.SendPropertyChanging();
				if ((previousValue != null))
				{
					this._Employee1.Entity = null;
					previousValue.Employees.Remove(this);
				}
				this._Employee1.Entity = value;
				if ((value != null))
				{
					value.Employees.Add(this);
					this._ReportsTo = value.EmployeeID;
				}
				else
				{
					this._ReportsTo = default(Nullable<int>);
				}
				this.SendPropertyChanged("Employee1");
			}
		}
	}
	
	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_Employees(Employee entity)
	{
		this.SendPropertyChanging();
		entity.Employee1 = this;
		this.SendPropertyChanged("Employees");
	}
	
	private void detach_Employees(Employee entity)
	{
		this.SendPropertyChanging();
		entity.Employee1 = null;
		this.SendPropertyChanged("Employees");
	}
	
	private void attach_Orders(Order entity)
	{
		this.SendPropertyChanging();
		entity.Employee = this;
		this.SendPropertyChanged("Orders");
	}
	
	private void detach_Orders(Order entity)
	{
		this.SendPropertyChanging();
		entity.Employee = null;
		this.SendPropertyChanged("Orders");
	}
}

[Table(Name="dbo.Orders")]
public partial class Order : INotifyPropertyChanging, INotifyPropertyChanged
{
	
	private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
	
	private int _OrderID;
	
	private string _CustomerID;
	
	private System.Nullable<int> _EmployeeID;
	
	private System.Nullable<System.DateTime> _OrderDate;
	
	private System.Nullable<System.DateTime> _RequiredDate;
	
	private System.Nullable<System.DateTime> _ShippedDate;
	
	private System.Nullable<int> _ShipVia;
	
	private System.Nullable<decimal> _Freight;
	
	private string _ShipName;
	
	private string _ShipAddress;
	
	private string _ShipCity;
	
	private string _ShipRegion;
	
	private string _ShipPostalCode;
	
	private string _ShipCountry;
	
	private EntitySet<Order_Detail> _Order_Details;
	
	private EntityRef<Customer> _Customer;
	
	private EntityRef<Employee> _Employee;
	
    #region Extensibility Method Definitions
    partial void OnLoaded();
    partial void OnValidate();
    partial void OnCreated();
    partial void OnOrderIDChanging(int value);
    partial void OnOrderIDChanged();
    partial void OnCustomerIDChanging(string value);
    partial void OnCustomerIDChanged();
    partial void OnEmployeeIDChanging(System.Nullable<int> value);
    partial void OnEmployeeIDChanged();
    partial void OnOrderDateChanging(System.Nullable<System.DateTime> value);
    partial void OnOrderDateChanged();
    partial void OnRequiredDateChanging(System.Nullable<System.DateTime> value);
    partial void OnRequiredDateChanged();
    partial void OnShippedDateChanging(System.Nullable<System.DateTime> value);
    partial void OnShippedDateChanged();
    partial void OnShipViaChanging(System.Nullable<int> value);
    partial void OnShipViaChanged();
    partial void OnFreightChanging(System.Nullable<decimal> value);
    partial void OnFreightChanged();
    partial void OnShipNameChanging(string value);
    partial void OnShipNameChanged();
    partial void OnShipAddressChanging(string value);
    partial void OnShipAddressChanged();
    partial void OnShipCityChanging(string value);
    partial void OnShipCityChanged();
    partial void OnShipRegionChanging(string value);
    partial void OnShipRegionChanged();
    partial void OnShipPostalCodeChanging(string value);
    partial void OnShipPostalCodeChanged();
    partial void OnShipCountryChanging(string value);
    partial void OnShipCountryChanged();
    #endregion
	
	public Order()
	{
		OnCreated();
		this._Order_Details = new EntitySet<Order_Detail>(new Action<Order_Detail>(this.attach_Order_Details), new Action<Order_Detail>(this.detach_Order_Details));
		this._Customer = default(EntityRef<Customer>);
		this._Employee = default(EntityRef<Employee>);
	}
	
	[Column(Storage="_OrderID", AutoSync=AutoSync.OnInsert, DbType="Int NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)]
	public int OrderID
	{
		get
		{
			return this._OrderID;
		}
		set
		{
			if ((this._OrderID != value))
			{
				this.OnOrderIDChanging(value);
				this.SendPropertyChanging();
				this._OrderID = value;
				this.SendPropertyChanged("OrderID");
				this.OnOrderIDChanged();
			}
		}
	}
	
	[Column(Storage="_CustomerID", DbType="NChar(5)")]
	public string CustomerID
	{
		get
		{
			return this._CustomerID;
		}
		set
		{
			if ((this._CustomerID != value))
			{
				if (this._Customer.HasLoadedOrAssignedValue)
				{
					throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
				}
				this.OnCustomerIDChanging(value);
				this.SendPropertyChanging();
				this._CustomerID = value;
				this.SendPropertyChanged("CustomerID");
				this.OnCustomerIDChanged();
			}
		}
	}
	
	[Column(Storage="_EmployeeID", DbType="Int")]
	public System.Nullable<int> EmployeeID
	{
		get
		{
			return this._EmployeeID;
		}
		set
		{
			if ((this._EmployeeID != value))
			{
				if (this._Employee.HasLoadedOrAssignedValue)
				{
					throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
				}
				this.OnEmployeeIDChanging(value);
				this.SendPropertyChanging();
				this._EmployeeID = value;
				this.SendPropertyChanged("EmployeeID");
				this.OnEmployeeIDChanged();
			}
		}
	}
	
	[Column(Storage="_OrderDate", DbType="DateTime")]
	public System.Nullable<System.DateTime> OrderDate
	{
		get
		{
			return this._OrderDate;
		}
		set
		{
			if ((this._OrderDate != value))
			{
				this.OnOrderDateChanging(value);
				this.SendPropertyChanging();
				this._OrderDate = value;
				this.SendPropertyChanged("OrderDate");
				this.OnOrderDateChanged();
			}
		}
	}
	
	[Column(Storage="_RequiredDate", DbType="DateTime")]
	public System.Nullable<System.DateTime> RequiredDate
	{
		get
		{
			return this._RequiredDate;
		}
		set
		{
			if ((this._RequiredDate != value))
			{
				this.OnRequiredDateChanging(value);
				this.SendPropertyChanging();
				this._RequiredDate = value;
				this.SendPropertyChanged("RequiredDate");
				this.OnRequiredDateChanged();
			}
		}
	}

⌨️ 快捷键说明

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