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

📄 northwind.designer.cs

📁 数据库连接查询
💻 CS
📖 第 1 页 / 共 4 页
字号:
//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//     Runtime Version:2.0.50727.1378
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.Linq;
using System.Data.Linq.Mapping;
using System.Linq;
using System.Linq.Expressions;
using System.Reflection;



[System.Data.Linq.Mapping.DatabaseAttribute(Name="Northwind")]
public partial class NorthwindDataContext : System.Data.Linq.DataContext
{
	
	private static System.Data.Linq.Mapping.MappingSource mappingSource = new AttributeMappingSource();
	
  #region Extensibility Method Definitions
  partial void OnCreated();
  partial void InsertCustomer(Customer instance);
  partial void UpdateCustomer(Customer instance);
  partial void DeleteCustomer(Customer instance);
  partial void InsertEmployee(Employee instance);
  partial void UpdateEmployee(Employee instance);
  partial void DeleteEmployee(Employee instance);
  partial void InsertOrder(Order instance);
  partial void UpdateOrder(Order instance);
  partial void DeleteOrder(Order instance);
  partial void InsertOrder_Detail(Order_Detail instance);
  partial void UpdateOrder_Detail(Order_Detail instance);
  partial void DeleteOrder_Detail(Order_Detail instance);
  partial void InsertProduct(Product instance);
  partial void UpdateProduct(Product instance);
  partial void DeleteProduct(Product instance);
  partial void InsertCategory(Category instance);
  partial void UpdateCategory(Category instance);
  partial void DeleteCategory(Category instance);
  #endregion
	
	static NorthwindDataContext()
	{
	}
	
	public NorthwindDataContext(string connection) : 
			base(connection, mappingSource)
	{
		OnCreated();
	}
	
	public NorthwindDataContext(System.Data.IDbConnection connection) : 
			base(connection, mappingSource)
	{
		OnCreated();
	}
	
	public NorthwindDataContext(string connection, System.Data.Linq.Mapping.MappingSource mappingSource) : 
			base(connection, mappingSource)
	{
		OnCreated();
	}
	
	public NorthwindDataContext(System.Data.IDbConnection connection, System.Data.Linq.Mapping.MappingSource mappingSource) : 
			base(connection, mappingSource)
	{
		OnCreated();
	}
	
	public NorthwindDataContext() : 
			base(global::System.Configuration.ConfigurationManager.ConnectionStrings["NorthwindConnectionString"].ConnectionString, mappingSource)
	{
		OnCreated();
	}
	
	public System.Data.Linq.Table<Customer> Customers
	{
		get
		{
			return this.GetTable<Customer>();
		}
	}
	
	public System.Data.Linq.Table<Employee> Employees
	{
		get
		{
			return this.GetTable<Employee>();
		}
	}
	
	public System.Data.Linq.Table<Order> Orders
	{
		get
		{
			return this.GetTable<Order>();
		}
	}
	
	public System.Data.Linq.Table<Order_Detail> Order_Details
	{
		get
		{
			return this.GetTable<Order_Detail>();
		}
	}
	
	public System.Data.Linq.Table<Product> Products
	{
		get
		{
			return this.GetTable<Product>();
		}
	}
	
	public System.Data.Linq.Table<Category> Categories
	{
		get
		{
			return this.GetTable<Category>();
		}
	}
	
	[Function(Name="dbo.sp_singleresultset")]
	public ISingleResult<Customer> sp_singleresultset()
	{
		IExecuteResult result = this.ExecuteMethodCall(this, ((MethodInfo)(MethodInfo.GetCurrentMethod())));
		return ((ISingleResult<Customer>)(result.ReturnValue));
	}
	
	[Function(Name="dbo.sp_withparameter")]
	public int sp_withparameter([Parameter(DbType="NChar(5)")] string customerid, [Parameter(DbType="Int")] ref System.Nullable<int> rowcount)
	{
		IExecuteResult result = this.ExecuteMethodCall(this, ((MethodInfo)(MethodInfo.GetCurrentMethod())), customerid, rowcount);
		rowcount = ((System.Nullable<int>)(result.GetParameterValue(1)));
		return ((int)(result.ReturnValue));
	}
	
	[Function(Name="dbo.sp_withreturnvalue")]
	public int sp_withreturnvalue([Parameter(DbType="NChar(5)")] string customerid)
	{
		IExecuteResult result = this.ExecuteMethodCall(this, ((MethodInfo)(MethodInfo.GetCurrentMethod())), customerid);
		return ((int)(result.ReturnValue));
	}
	
	[Function(Name="dbo.sp_multiresultset")]
	public ISingleResult<sp_multiresultsetResult> sp_multiresultset()
	{
		IExecuteResult result = this.ExecuteMethodCall(this, ((MethodInfo)(MethodInfo.GetCurrentMethod())));
		return ((ISingleResult<sp_multiresultsetResult>)(result.ReturnValue));
	}
}

[Table(Name="dbo.Customers")]
public partial class Customer : INotifyPropertyChanging, INotifyPropertyChanged
{
	
	private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
	
	private string _CustomerID;
	
	private string _CompanyName;
	
	private string _ContactName;
	
	private string _ContactTitle;
	
	private string _Address;
	
	private string _City;
	
	private string _Region;
	
	private string _PostalCode;
	
	private string _Country;
	
	private string _Phone;
	
	private string _Fax;
	
	private EntitySet<Order> _Orders;
	
    #region Extensibility Method Definitions
    partial void OnLoaded();
    partial void OnValidate();
    partial void OnCreated();
    partial void OnCustomerIDChanging(string value);
    partial void OnCustomerIDChanged();
    partial void OnCompanyNameChanging(string value);
    partial void OnCompanyNameChanged();
    partial void OnContactNameChanging(string value);
    partial void OnContactNameChanged();
    partial void OnContactTitleChanging(string value);
    partial void OnContactTitleChanged();
    partial void OnAddressChanging(string value);
    partial void OnAddressChanged();
    partial void OnCityChanging(string value);
    partial void OnCityChanged();
    partial void OnRegionChanging(string value);
    partial void OnRegionChanged();
    partial void OnPostalCodeChanging(string value);
    partial void OnPostalCodeChanged();
    partial void OnCountryChanging(string value);
    partial void OnCountryChanged();
    partial void OnPhoneChanging(string value);
    partial void OnPhoneChanged();
    partial void OnFaxChanging(string value);
    partial void OnFaxChanged();
    #endregion
	
	public Customer()
	{
		OnCreated();
		this._Orders = new EntitySet<Order>(new Action<Order>(this.attach_Orders), new Action<Order>(this.detach_Orders));
	}
	
	[Column(Storage="_CustomerID", DbType="NChar(5) NOT NULL", CanBeNull=false, IsPrimaryKey=true, IsVersion=true)]
	public string CustomerID
	{
		get
		{
			return this._CustomerID;
		}
		set
		{
			if ((this._CustomerID != value))
			{
				this.OnCustomerIDChanging(value);
				this.SendPropertyChanging();
				this._CustomerID = value;
				this.SendPropertyChanged("CustomerID");
				this.OnCustomerIDChanged();
			}
		}
	}
	
	[Column(Storage="_CompanyName", DbType="NVarChar(40) NOT NULL", CanBeNull=false)]
	public string CompanyName
	{
		get
		{
			return this._CompanyName;
		}
		set
		{
			if ((this._CompanyName != value))
			{
				this.OnCompanyNameChanging(value);
				this.SendPropertyChanging();
				this._CompanyName = value;
				this.SendPropertyChanged("CompanyName");
				this.OnCompanyNameChanged();
			}
		}
	}
	
	[Column(Storage="_ContactName", DbType="NVarChar(30)")]
	public string ContactName
	{
		get
		{
			return this._ContactName;
		}
		set
		{
			if ((this._ContactName != value))
			{
				this.OnContactNameChanging(value);
				this.SendPropertyChanging();
				this._ContactName = value;
				this.SendPropertyChanged("ContactName");
				this.OnContactNameChanged();
			}
		}
	}
	
	[Column(Storage="_ContactTitle", DbType="NVarChar(30)")]
	public string ContactTitle
	{
		get
		{
			return this._ContactTitle;
		}
		set
		{
			if ((this._ContactTitle != value))
			{
				this.OnContactTitleChanging(value);
				this.SendPropertyChanging();
				this._ContactTitle = value;
				this.SendPropertyChanged("ContactTitle");
				this.OnContactTitleChanged();
			}
		}
	}
	
	[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="_Phone", DbType="NVarChar(24)")]
	public string Phone
	{
		get
		{
			return this._Phone;
		}
		set
		{
			if ((this._Phone != value))
			{
				this.OnPhoneChanging(value);
				this.SendPropertyChanging();
				this._Phone = value;
				this.SendPropertyChanged("Phone");
				this.OnPhoneChanged();
			}
		}
	}
	
	[Column(Storage="_Fax", DbType="NVarChar(24)")]
	public string Fax
	{
		get
		{
			return this._Fax;
		}
		set
		{
			if ((this._Fax != value))
			{
				this.OnFaxChanging(value);
				this.SendPropertyChanging();
				this._Fax = value;
				this.SendPropertyChanged("Fax");
				this.OnFaxChanged();
			}
		}
	}
	
	[Association(Name="Customer_Order", Storage="_Orders", OtherKey="CustomerID")]
	public EntitySet<Order> Orders
	{
		get
		{
			return this._Orders;
		}
		set
		{
			this._Orders.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_Orders(Order entity)
	{
		this.SendPropertyChanging();
		entity.Customer = this;
		this.SendPropertyChanged("Orders");
	}
	
	private void detach_Orders(Order entity)
	{
		this.SendPropertyChanging();
		entity.Customer = null;
		this.SendPropertyChanged("Orders");
	}
}

[Table(Name="dbo.Employees")]
public partial class Employee : INotifyPropertyChanging, INotifyPropertyChanged
{
	
	private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
	
	private int _EmployeeID;
	
	private string _LastName;
	
	private string _FirstName;
	
	private string _Title;
	
	private string _TitleOfCourtesy;
	
	private System.Nullable<System.DateTime> _BirthDate;
	
	private System.Nullable<System.DateTime> _HireDate;
	
	private string _Address;
	
	private string _City;
	
	private string _Region;
	
	private string _PostalCode;
	
	private string _Country;
	
	private string _HomePhone;
	
	private string _Extension;
	
	private byte[] _Photo;
	
	private string _Notes;
	
	private System.Nullable<int> _ReportsTo;
	
	private string _PhotoPath;
	
	private EntitySet<Employee> _Employees;
	
	private EntitySet<Order> _Orders;
	
	private EntityRef<Employee> _Employee1;
	
    #region Extensibility Method Definitions
    partial void OnLoaded();
    partial void OnValidate();
    partial void OnCreated();
    partial void OnEmployeeIDChanging(int value);
    partial void OnEmployeeIDChanged();
    partial void OnLastNameChanging(string value);
    partial void OnLastNameChanged();
    partial void OnFirstNameChanging(string value);
    partial void OnFirstNameChanged();
    partial void OnTitleChanging(string value);
    partial void OnTitleChanged();
    partial void OnTitleOfCourtesyChanging(string value);
    partial void OnTitleOfCourtesyChanged();
    partial void OnBirthDateChanging(System.Nullable<System.DateTime> value);
    partial void OnBirthDateChanged();
    partial void OnHireDateChanging(System.Nullable<System.DateTime> value);
    partial void OnHireDateChanged();
    partial void OnAddressChanging(string value);
    partial void OnAddressChanged();
    partial void OnCityChanging(string value);
    partial void OnCityChanged();
    partial void OnRegionChanging(string value);
    partial void OnRegionChanged();
    partial void OnPostalCodeChanging(string value);
    partial void OnPostalCodeChanged();
    partial void OnCountryChanging(string value);
    partial void OnCountryChanged();
    partial void OnHomePhoneChanging(string value);
    partial void OnHomePhoneChanged();
    partial void OnExtensionChanging(string value);
    partial void OnExtensionChanged();
    partial void OnPhotoChanging(byte[] value);
    partial void OnPhotoChanged();
    partial void OnNotesChanging(string value);
    partial void OnNotesChanged();
    partial void OnReportsToChanging(System.Nullable<int> value);
    partial void OnReportsToChanged();
    partial void OnPhotoPathChanging(string value);
    partial void OnPhotoPathChanged();
    #endregion
	
	public Employee()
	{
		OnCreated();
		this._Employees = new EntitySet<Employee>(new Action<Employee>(this.attach_Employees), new Action<Employee>(this.detach_Employees));
		this._Orders = new EntitySet<Order>(new Action<Order>(this.attach_Orders), new Action<Order>(this.detach_Orders));
		this._Employee1 = default(EntityRef<Employee>);
	}

    [Column(IsVersion = true, Name = "version")]
    public int Version { get;  set; }

	[Column(Storage="_EmployeeID", DbType="Int NOT NULL", IsPrimaryKey=true)]
	public int EmployeeID
	{
		get
		{
			return this._EmployeeID;
		}
		set
		{
			if ((this._EmployeeID != value))
			{
				this.OnEmployeeIDChanging(value);
				this.SendPropertyChanging();
				this._EmployeeID = value;
				this.SendPropertyChanged("EmployeeID");
				this.OnEmployeeIDChanged();
			}
		}
	}

	
	[Column(Storage="_LastName", DbType="NVarChar(20) NOT NULL", CanBeNull=false)]
	public string LastName
	{
		get
		{
			return this._LastName;
		}
		set
		{
			if ((this._LastName != value))
			{
				this.OnLastNameChanging(value);
				this.SendPropertyChanging();

⌨️ 快捷键说明

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