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

📄 northwind.designer.cs

📁 数据库连接查询
💻 CS
📖 第 1 页 / 共 4 页
字号:
	
	[Column(Storage="_ShippedDate", DbType="DateTime")]
	public System.Nullable<System.DateTime> ShippedDate
	{
		get
		{
			return this._ShippedDate;
		}
		set
		{
			if ((this._ShippedDate != value))
			{
				this.OnShippedDateChanging(value);
				this.SendPropertyChanging();
				this._ShippedDate = value;
				this.SendPropertyChanged("ShippedDate");
				this.OnShippedDateChanged();
			}
		}
	}
	
	[Column(Storage="_ShipVia", DbType="Int")]
	public System.Nullable<int> ShipVia
	{
		get
		{
			return this._ShipVia;
		}
		set
		{
			if ((this._ShipVia != value))
			{
				this.OnShipViaChanging(value);
				this.SendPropertyChanging();
				this._ShipVia = value;
				this.SendPropertyChanged("ShipVia");
				this.OnShipViaChanged();
			}
		}
	}
	
	[Column(Storage="_Freight", DbType="Money")]
	public System.Nullable<decimal> Freight
	{
		get
		{
			return this._Freight;
		}
		set
		{
			if ((this._Freight != value))
			{
				this.OnFreightChanging(value);
				this.SendPropertyChanging();
				this._Freight = value;
				this.SendPropertyChanged("Freight");
				this.OnFreightChanged();
			}
		}
	}
	
	[Column(Storage="_ShipName", DbType="NVarChar(40)")]
	public string ShipName
	{
		get
		{
			return this._ShipName;
		}
		set
		{
			if ((this._ShipName != value))
			{
				this.OnShipNameChanging(value);
				this.SendPropertyChanging();
				this._ShipName = value;
				this.SendPropertyChanged("ShipName");
				this.OnShipNameChanged();
			}
		}
	}
	
	[Column(Storage="_ShipAddress", DbType="NVarChar(60)")]
	public string ShipAddress
	{
		get
		{
			return this._ShipAddress;
		}
		set
		{
			if ((this._ShipAddress != value))
			{
				this.OnShipAddressChanging(value);
				this.SendPropertyChanging();
				this._ShipAddress = value;
				this.SendPropertyChanged("ShipAddress");
				this.OnShipAddressChanged();
			}
		}
	}
	
	[Column(Storage="_ShipCity", DbType="NVarChar(15)")]
	public string ShipCity
	{
		get
		{
			return this._ShipCity;
		}
		set
		{
			if ((this._ShipCity != value))
			{
				this.OnShipCityChanging(value);
				this.SendPropertyChanging();
				this._ShipCity = value;
				this.SendPropertyChanged("ShipCity");
				this.OnShipCityChanged();
			}
		}
	}
	
	[Column(Storage="_ShipRegion", DbType="NVarChar(15)")]
	public string ShipRegion
	{
		get
		{
			return this._ShipRegion;
		}
		set
		{
			if ((this._ShipRegion != value))
			{
				this.OnShipRegionChanging(value);
				this.SendPropertyChanging();
				this._ShipRegion = value;
				this.SendPropertyChanged("ShipRegion");
				this.OnShipRegionChanged();
			}
		}
	}
	
	[Column(Storage="_ShipPostalCode", DbType="NVarChar(10)")]
	public string ShipPostalCode
	{
		get
		{
			return this._ShipPostalCode;
		}
		set
		{
			if ((this._ShipPostalCode != value))
			{
				this.OnShipPostalCodeChanging(value);
				this.SendPropertyChanging();
				this._ShipPostalCode = value;
				this.SendPropertyChanged("ShipPostalCode");
				this.OnShipPostalCodeChanged();
			}
		}
	}
	
	[Column(Storage="_ShipCountry", DbType="NVarChar(15)")]
	public string ShipCountry
	{
		get
		{
			return this._ShipCountry;
		}
		set
		{
			if ((this._ShipCountry != value))
			{
				this.OnShipCountryChanging(value);
				this.SendPropertyChanging();
				this._ShipCountry = value;
				this.SendPropertyChanged("ShipCountry");
				this.OnShipCountryChanged();
			}
		}
	}
	
	[Association(Name="Order_Order_Detail", Storage="_Order_Details", OtherKey="OrderID")]
	public EntitySet<Order_Detail> Order_Details
	{
		get
		{
			return this._Order_Details;
		}
		set
		{
			this._Order_Details.Assign(value);
		}
	}
	
	[Association(Name="Customer_Order", Storage="_Customer", ThisKey="CustomerID", IsForeignKey=true)]
	public Customer Customer
	{
		get
		{
			return this._Customer.Entity;
		}
		set
		{
			Customer previousValue = this._Customer.Entity;
			if (((previousValue != value) 
						|| (this._Customer.HasLoadedOrAssignedValue == false)))
			{
				this.SendPropertyChanging();
				if ((previousValue != null))
				{
					this._Customer.Entity = null;
					previousValue.Orders.Remove(this);
				}
				this._Customer.Entity = value;
				if ((value != null))
				{
					value.Orders.Add(this);
					this._CustomerID = value.CustomerID;
				}
				else
				{
					this._CustomerID = default(string);
				}
				this.SendPropertyChanged("Customer");
			}
		}
	}
	
	[Association(Name="Employee_Order", Storage="_Employee", ThisKey="EmployeeID", IsForeignKey=true)]
	public Employee Employee
	{
		get
		{
			return this._Employee.Entity;
		}
		set
		{
			Employee previousValue = this._Employee.Entity;
			if (((previousValue != value) 
						|| (this._Employee.HasLoadedOrAssignedValue == false)))
			{
				this.SendPropertyChanging();
				if ((previousValue != null))
				{
					this._Employee.Entity = null;
					previousValue.Orders.Remove(this);
				}
				this._Employee.Entity = value;
				if ((value != null))
				{
					value.Orders.Add(this);
					this._EmployeeID = value.EmployeeID;
				}
				else
				{
					this._EmployeeID = default(Nullable<int>);
				}
				this.SendPropertyChanged("Employee");
			}
		}
	}
	
	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_Order_Details(Order_Detail entity)
	{
		this.SendPropertyChanging();
		entity.Order = this;
		this.SendPropertyChanged("Order_Details");
	}
	
	private void detach_Order_Details(Order_Detail entity)
	{
		this.SendPropertyChanging();
		entity.Order = null;
		this.SendPropertyChanged("Order_Details");
	}
}

[Table(Name="dbo.[Order Details]")]
public partial class Order_Detail : INotifyPropertyChanging, INotifyPropertyChanged
{
	
	private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
	
	private int _OrderID;
	
	private int _ProductID;
	
	private decimal _UnitPrice;
	
	private short _Quantity;
	
	private float _Discount;
	
	private EntityRef<Order> _Order;
	
	private EntityRef<Product> _Product;
	
    #region Extensibility Method Definitions
    partial void OnLoaded();
    partial void OnValidate();
    partial void OnCreated();
    partial void OnOrderIDChanging(int value);
    partial void OnOrderIDChanged();
    partial void OnProductIDChanging(int value);
    partial void OnProductIDChanged();
    partial void OnUnitPriceChanging(decimal value);
    partial void OnUnitPriceChanged();
    partial void OnQuantityChanging(short value);
    partial void OnQuantityChanged();
    partial void OnDiscountChanging(float value);
    partial void OnDiscountChanged();
    #endregion
	
	public Order_Detail()
	{
		OnCreated();
		this._Order = default(EntityRef<Order>);
		this._Product = default(EntityRef<Product>);
	}
	
	[Column(Storage="_OrderID", DbType="Int NOT NULL", IsPrimaryKey=true)]
	public int OrderID
	{
		get
		{
			return this._OrderID;
		}
		set
		{
			if ((this._OrderID != value))
			{
				if (this._Order.HasLoadedOrAssignedValue)
				{
					throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
				}
				this.OnOrderIDChanging(value);
				this.SendPropertyChanging();
				this._OrderID = value;
				this.SendPropertyChanged("OrderID");
				this.OnOrderIDChanged();
			}
		}
	}
	
	[Column(Storage="_ProductID", DbType="Int NOT NULL", IsPrimaryKey=true)]
	public int ProductID
	{
		get
		{
			return this._ProductID;
		}
		set
		{
			if ((this._ProductID != value))
			{
				if (this._Product.HasLoadedOrAssignedValue)
				{
					throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
				}
				this.OnProductIDChanging(value);
				this.SendPropertyChanging();
				this._ProductID = value;
				this.SendPropertyChanged("ProductID");
				this.OnProductIDChanged();
			}
		}
	}
	
	[Column(Storage="_UnitPrice", DbType="Money NOT NULL")]
	public decimal UnitPrice
	{
		get
		{
			return this._UnitPrice;
		}
		set
		{
			if ((this._UnitPrice != value))
			{
				this.OnUnitPriceChanging(value);
				this.SendPropertyChanging();
				this._UnitPrice = value;
				this.SendPropertyChanged("UnitPrice");
				this.OnUnitPriceChanged();
			}
		}
	}
	
	[Column(Storage="_Quantity", DbType="SmallInt NOT NULL")]
	public short Quantity
	{
		get
		{
			return this._Quantity;
		}
		set
		{
			if ((this._Quantity != value))
			{
				this.OnQuantityChanging(value);
				this.SendPropertyChanging();
				this._Quantity = value;
				this.SendPropertyChanged("Quantity");
				this.OnQuantityChanged();
			}
		}
	}
	
	[Column(Storage="_Discount", DbType="Real NOT NULL")]
	public float Discount
	{
		get
		{
			return this._Discount;
		}
		set
		{
			if ((this._Discount != value))
			{
				this.OnDiscountChanging(value);
				this.SendPropertyChanging();
				this._Discount = value;
				this.SendPropertyChanged("Discount");
				this.OnDiscountChanged();
			}
		}
	}
	
	[Association(Name="Order_Order_Detail", Storage="_Order", ThisKey="OrderID", IsForeignKey=true)]
	public Order Order
	{
		get
		{
			return this._Order.Entity;
		}
		set
		{
			Order previousValue = this._Order.Entity;
			if (((previousValue != value) 
						|| (this._Order.HasLoadedOrAssignedValue == false)))
			{
				this.SendPropertyChanging();
				if ((previousValue != null))
				{
					this._Order.Entity = null;
					previousValue.Order_Details.Remove(this);
				}
				this._Order.Entity = value;
				if ((value != null))
				{
					value.Order_Details.Add(this);
					this._OrderID = value.OrderID;
				}
				else
				{
					this._OrderID = default(int);
				}
				this.SendPropertyChanged("Order");
			}
		}
	}
	
	[Association(Name="Product_Order_Detail", Storage="_Product", ThisKey="ProductID", IsForeignKey=true)]
	public Product Product
	{
		get
		{
			return this._Product.Entity;
		}
		set
		{
			Product previousValue = this._Product.Entity;
			if (((previousValue != value) 
						|| (this._Product.HasLoadedOrAssignedValue == false)))
			{
				this.SendPropertyChanging();
				if ((previousValue != null))
				{
					this._Product.Entity = null;
					previousValue.Order_Details.Remove(this);
				}
				this._Product.Entity = value;
				if ((value != null))
				{
					value.Order_Details.Add(this);
					this._ProductID = value.ProductID;
				}
				else
				{
					this._ProductID = default(int);
				}
				this.SendPropertyChanged("Product");
			}
		}
	}
	
	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.Products")]
public partial class Product : INotifyPropertyChanging, INotifyPropertyChanged
{
	
	private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
	
	private int _ProductID;
	
	private string _ProductName;
	
	private System.Nullable<int> _SupplierID;
	
	private System.Nullable<int> _CategoryID;
	
	private string _QuantityPerUnit;
	
	private System.Nullable<decimal> _UnitPrice;
	
	private System.Nullable<short> _UnitsInStock;
	
	private System.Nullable<short> _UnitsOnOrder;
	
	private System.Nullable<short> _ReorderLevel;
	
	private bool _Discontinued;
	
	private EntitySet<Order_Detail> _Order_Details;
	
	private EntityRef<Category> _Category;
	
    #region Extensibility Method Definitions
    partial void OnLoaded();
    partial void OnValidate();
    partial void OnCreated();
    partial void OnProductIDChanging(int value);
    partial void OnProductIDChanged();
    partial void OnProductNameChanging(string value);
    partial void OnProductNameChanged();
    partial void OnSupplierIDChanging(System.Nullable<int> value);
    partial void OnSupplierIDChanged();
    partial void OnCategoryIDChanging(System.Nullable<int> value);
    partial void OnCategoryIDChanged();
    partial void OnQuantityPerUnitChanging(string value);
    partial void OnQuantityPerUnitChanged();
    partial void OnUnitPriceChanging(System.Nullable<decimal> value);
    partial void OnUnitPriceChanged();
    partial void OnUnitsInStockChanging(System.Nullable<short> value);
    partial void OnUnitsInStockChanged();
    partial void OnUnitsOnOrderChanging(System.Nullable<short> value);
    partial void OnUnitsOnOrderChanged();
    partial void OnReorderLevelChanging(System.Nullable<short> value);
    partial void OnReorderLevelChanged();
    partial void OnDiscontinuedChanging(bool value);
    partial void OnDiscontinuedChanged();
    #endregion
	
	public Product()
	{
		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._Category = default(EntityRef<Category>);
	}
	
	[Column(Storage="_ProductID", AutoSync=AutoSync.OnInsert, DbType="Int NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)]
	public int ProductID
	{
		get
		{
			return this._ProductID;
		}
		set
		{
			if ((this._ProductID != value))
			{
				this.OnProductIDChanging(value);
				this.SendPropertyChanging();
				this._ProductID = value;
				this.SendPropertyChanged("ProductID");
				this.OnProductIDChanged();
			}
		}
	}
	
	[Column(Storage="_ProductName", DbType="NVarChar(40) NOT NULL", CanBeNull=false)]
	public string ProductName
	{
		get
		{
			return this._ProductName;
		}
		set
		{

⌨️ 快捷键说明

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