

#pragma warning disable 1591
//------------------------------------------------------------------------------
// <auto-generated>
//     此代码由工具生成。
//     运行时版本:2.0.50727.3082
//
//     对此文件的更改可能会导致不正确的行为，并且如果
//     重新生成代码，这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------

namespace Maticsoft.Model
{
	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="codematic")]
	public partial class CodematicDataContext : System.Data.Linq.DataContext
	{
		
		private static System.Data.Linq.Mapping.MappingSource mappingSource = new AttributeMappingSource();
		
    #region Extensibility Method Definitions
    partial void OnCreated();
    partial void InsertProduct(Product instance);
    partial void UpdateProduct(Product instance);
    partial void DeleteProduct(Product instance);
    #endregion
		
		public CodematicDataContext() : 
				base(global::Maticsoft.Model.Properties.Settings.Default.codematicConnectionString1, mappingSource)
		{
			OnCreated();
		}
		
		public CodematicDataContext(string connection) : 
				base(connection, mappingSource)
		{
			OnCreated();
		}
		
		public CodematicDataContext(System.Data.IDbConnection connection) : 
				base(connection, mappingSource)
		{
			OnCreated();
		}
		
		public CodematicDataContext(string connection, System.Data.Linq.Mapping.MappingSource mappingSource) : 
				base(connection, mappingSource)
		{
			OnCreated();
		}
		
		public CodematicDataContext(System.Data.IDbConnection connection, System.Data.Linq.Mapping.MappingSource mappingSource) : 
				base(connection, mappingSource)
		{
			OnCreated();
		}
		
		public System.Data.Linq.Table<Product> Product
		{
			get
			{
				return this.GetTable<Product>();
			}
		}
		
		public System.Data.Linq.Table<News> News
		{
			get
			{
				return this.GetTable<News>();
			}
		}
	}
	
	[Table(Name="P_Product")]
	public partial class Product : INotifyPropertyChanging, INotifyPropertyChanged
	{
		
		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
		
		private int _ID;
		
		private string _ProductId;
		
		private string _CategoryId;
		
		private string _BrandId;
		
		private string _Name;
		
		private string _Descn;
		
		private string _Image="";
		
		private string _ImageSmall="";
		
		private System.Nullable<decimal> _Price=0;
		
		private System.Nullable<decimal> _VipPrice=0;
		
		private System.Nullable<int> _Cheapness=0;
		
    #region Extensibility Method Definitions
    partial void OnLoaded();
    partial void OnValidate(System.Data.Linq.ChangeAction action);
    partial void OnCreated();
    partial void OnIDChanging(int value);
    partial void OnIDChanged();
    partial void OnProductIdChanging(string value);
    partial void OnProductIdChanged();
    partial void OnCategoryIdChanging(string value);
    partial void OnCategoryIdChanged();
    partial void OnBrandIdChanging(string value);
    partial void OnBrandIdChanged();
    partial void OnNameChanging(string value);
    partial void OnNameChanged();
    partial void OnDescnChanging(string value);
    partial void OnDescnChanged();
    partial void OnImageChanging(string value);
    partial void OnImageChanged();
    partial void OnImageSmallChanging(string value);
    partial void OnImageSmallChanged();
    partial void OnPriceChanging(System.Nullable<decimal> value);
    partial void OnPriceChanged();
    partial void OnVipPriceChanging(System.Nullable<decimal> value);
    partial void OnVipPriceChanged();
    partial void OnCheapnessChanging(System.Nullable<int> value);
    partial void OnCheapnessChanged();
    #endregion
		
		public Product()
		{
			OnCreated();
		}

        //[Column(Storage = "_ID", AutoSync = AutoSync.Always, DbType = "Int NOT NULL IDENTITY", IsDbGenerated = true)]
        //public int ID
        //{
        //    get
        //    {
        //        return this._ID;
        //    }
        //    set
        //    {
        //        if ((this._ID != value))
        //        {
        //            this.OnIDChanging(value);
        //            this.SendPropertyChanging();
        //            this._ID = value;
        //            this.SendPropertyChanged("ID");
        //            this.OnIDChanged();
        //        }
        //    }
        //}
		
		[Column(Storage="_ProductId", DbType="VarChar(20) NOT NULL", CanBeNull=false, IsPrimaryKey=true)]
		public string 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="_CategoryId", DbType="VarChar(20)")]
		public string CategoryId
		{
			get
			{
				return this._CategoryId;
			}
			set
			{
				if ((this._CategoryId != value))
				{
					this.OnCategoryIdChanging(value);
					this.SendPropertyChanging();
					this._CategoryId = value;
					this.SendPropertyChanged("CategoryId");
					this.OnCategoryIdChanged();
				}
			}
		}
		
		[Column(Storage="_BrandId", DbType="VarChar(20)")]
		public string BrandId
		{
			get
			{
				return this._BrandId;
			}
			set
			{
				if ((this._BrandId != value))
				{
					this.OnBrandIdChanging(value);
					this.SendPropertyChanging();
					this._BrandId = value;
					this.SendPropertyChanged("BrandId");
					this.OnBrandIdChanged();
				}
			}
		}
		
		[Column(Storage="_Name", DbType="VarChar(80)")]
		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();
				}
			}
		}
		
		[Column(Storage="_Descn", DbType="Text", UpdateCheck=UpdateCheck.Never)]
		public string Descn
		{
			get
			{
				return this._Descn;
			}
			set
			{
				if ((this._Descn != value))
				{
					this.OnDescnChanging(value);
					this.SendPropertyChanging();
					this._Descn = value;
					this.SendPropertyChanged("Descn");
					this.OnDescnChanged();
				}
			}
		}
		
		[Column(Storage="_Image", DbType="VarChar(80)")]
		public string Image
		{
			get
			{
				return this._Image;
			}
			set
			{
				if ((this._Image != value))
				{
					this.OnImageChanging(value);
					this.SendPropertyChanging();
					this._Image = value;
					this.SendPropertyChanged("Image");
					this.OnImageChanged();
				}
			}
		}
		
		[Column(Storage="_ImageSmall", DbType="VarChar(80)")]
		public string ImageSmall
		{
			get
			{
				return this._ImageSmall;
			}
			set
			{
				if ((this._ImageSmall != value))
				{
					this.OnImageSmallChanging(value);
					this.SendPropertyChanging();
					this._ImageSmall = value;
					this.SendPropertyChanged("ImageSmall");
					this.OnImageSmallChanged();
				}
			}
		}
		
		[Column(Storage="_Price", DbType="Decimal(19,2)")]
		public System.Nullable<decimal> Price
		{
			get
			{
				return this._Price;
			}
			set
			{
				if ((this._Price != value))
				{
					this.OnPriceChanging(value);
					this.SendPropertyChanging();
					this._Price = value;
					this.SendPropertyChanged("Price");
					this.OnPriceChanged();
				}
			}
		}
		
		[Column(Storage="_VipPrice", DbType="Decimal(19,2)")]
		public System.Nullable<decimal> VipPrice
		{
			get
			{
				return this._VipPrice;
			}
			set
			{
				if ((this._VipPrice != value))
				{
					this.OnVipPriceChanging(value);
					this.SendPropertyChanging();
					this._VipPrice = value;
					this.SendPropertyChanged("VipPrice");
					this.OnVipPriceChanged();
				}
			}
		}
		
		[Column(Storage="_Cheapness", DbType="Int")]
		public System.Nullable<int> Cheapness
		{
			get
			{
				return this._Cheapness;
			}
			set
			{
				if ((this._Cheapness != value))
				{
					this.OnCheapnessChanging(value);
					this.SendPropertyChanging();
					this._Cheapness = value;
					this.SendPropertyChanged("Cheapness");
					this.OnCheapnessChanged();
				}
			}
		}
		
		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="T_News")]
	public partial class News
	{
		
		private int _NewsId;
		
		private System.Nullable<int> _UserId;
		
		private string _Heading;
		
		private string _Content;
		
		private System.Nullable<int> _Frequency;
		
		private System.Nullable<System.DateTime> _IssueDate;
		
		private string _Dormancy;
		
		private System.Nullable<int> _ClassId;
		
		private string _Focus;
		
		private System.Nullable<int> _Priority;
		
		private System.Nullable<int> _IsTop;
		
		public News()
		{
		}
		
		[Column(Storage="_NewsId", AutoSync=AutoSync.Always, DbType="Int NOT NULL IDENTITY", IsDbGenerated=true)]
		public int NewsId
		{
			get
			{
				return this._NewsId;
			}
			set
			{
				if ((this._NewsId != value))
				{
					this._NewsId = value;
				}
			}
		}
		
		[Column(Storage="_UserId", DbType="Int")]
		public System.Nullable<int> UserId
		{
			get
			{
				return this._UserId;
			}
			set
			{
				if ((this._UserId != value))
				{
					this._UserId = value;
				}
			}
		}
		
		[Column(Storage="_Heading", DbType="VarChar(100)")]
		public string Heading
		{
			get
			{
				return this._Heading;
			}
			set
			{
				if ((this._Heading != value))
				{
					this._Heading = value;
				}
			}
		}
		
		[Column(Storage="_Content", DbType="Text", UpdateCheck=UpdateCheck.Never)]
		public string Content
		{
			get
			{
				return this._Content;
			}
			set
			{
				if ((this._Content != value))
				{
					this._Content = value;
				}
			}
		}
		
		[Column(Storage="_Frequency", DbType="Int")]
		public System.Nullable<int> Frequency
		{
			get
			{
				return this._Frequency;
			}
			set
			{
				if ((this._Frequency != value))
				{
					this._Frequency = value;
				}
			}
		}
		
		[Column(Storage="_IssueDate", DbType="DateTime")]
		public System.Nullable<System.DateTime> IssueDate
		{
			get
			{
				return this._IssueDate;
			}
			set
			{
				if ((this._IssueDate != value))
				{
					this._IssueDate = value;
				}
			}
		}
		
		[Column(Storage="_Dormancy", DbType="VarChar(10)")]
		public string Dormancy
		{
			get
			{
				return this._Dormancy;
			}
			set
			{
				if ((this._Dormancy != value))
				{
					this._Dormancy = value;
				}
			}
		}
		
		[Column(Storage="_ClassId", DbType="Int")]
		public System.Nullable<int> ClassId
		{
			get
			{
				return this._ClassId;
			}
			set
			{
				if ((this._ClassId != value))
				{
					this._ClassId = value;
				}
			}
		}
		
		[Column(Storage="_Focus", DbType="VarChar(10)")]
		public string Focus
		{
			get
			{
				return this._Focus;
			}
			set
			{
				if ((this._Focus != value))
				{
					this._Focus = value;
				}
			}
		}
		
		[Column(Storage="_Priority", DbType="Int")]
		public System.Nullable<int> Priority
		{
			get
			{
				return this._Priority;
			}
			set
			{
				if ((this._Priority != value))
				{
					this._Priority = value;
				}
			}
		}
		
		[Column(Storage="_IsTop", DbType="Int")]
		public System.Nullable<int> IsTop
		{
			get
			{
				return this._IsTop;
			}
			set
			{
				if ((this._IsTop != value))
				{
					this._IsTop = value;
				}
			}
		}
	}
}
#pragma warning restore 1591
