using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Web;
using System.Web.Services;
using System.Data.SqlClient;
using System.Web.Security;
using Microsoft.ApplicationBlocks.Data;

namespace BookCommunityService
{
	[WebService(Namespace="http://www.BookCommunity.org")]
	public class DataService : System.Web.Services.WebService
	{
		public DataService()
		{
			//CODEGEN: 该调用是 ASP.NET Web 服务设计器所必需的
			InitializeComponent();
		}

		#region Auto Fields

		private System.Data.SqlClient.SqlConnection dbConn;
		private System.Data.SqlClient.SqlDataAdapter daBook;
		private System.Data.SqlClient.SqlCommand sqlSelectCommand2;
		private System.Data.SqlClient.SqlCommand sqlInsertCommand2;
		private System.Data.SqlClient.SqlCommand sqlUpdateCommand2;
		private System.Data.SqlClient.SqlCommand sqlDeleteCommand2;
		private System.Data.SqlClient.SqlDataAdapter daOnlineInfo;
		private System.Data.SqlClient.SqlCommand sqlSelectCommand4;
		private System.Data.SqlClient.SqlCommand sqlInsertCommand4;
		private System.Data.SqlClient.SqlCommand sqlUpdateCommand4;
		private System.Data.SqlClient.SqlCommand sqlDeleteCommand4;
		private System.Data.SqlClient.SqlDataAdapter daShareInfo;
		private System.Data.SqlClient.SqlCommand sqlSelectCommand5;
		private System.Data.SqlClient.SqlCommand sqlInsertCommand5;
		private System.Data.SqlClient.SqlCommand sqlUpdateCommand5;
		private System.Data.SqlClient.SqlCommand sqlDeleteCommand5;
		private System.Data.SqlClient.SqlDataAdapter daMessage;
		private System.Data.SqlClient.SqlCommand sqlSelectCommand3;
		private System.Data.SqlClient.SqlCommand sqlInsertCommand3;
		private System.Data.SqlClient.SqlCommand sqlUpdateCommand3;
		private System.Data.SqlClient.SqlCommand sqlDeleteCommand3;
		private System.Data.SqlClient.SqlDataAdapter daUserInfo;
		private System.Data.SqlClient.SqlCommand sqlSelectCommand1;
		private System.Data.SqlClient.SqlCommand sqlInsertCommand1;
		private System.Data.SqlClient.SqlCommand sqlUpdateCommand1;
		private System.Data.SqlClient.SqlCommand sqlDeleteCommand1;
		#endregion


		#region 组件设计器生成的代码
		
		//Web 服务设计器所必需的
		private IContainer components = null;
				
		/// <summary>
		/// 设计器支持所需的方法 - 不要使用代码编辑器修改
		/// 此方法的内容。
		/// </summary>
		private void InitializeComponent()
		{
			System.Configuration.AppSettingsReader configurationAppSettings = new System.Configuration.AppSettingsReader();
			this.dbConn = new System.Data.SqlClient.SqlConnection();
			this.daBook = new System.Data.SqlClient.SqlDataAdapter();
			this.sqlDeleteCommand2 = new System.Data.SqlClient.SqlCommand();
			this.sqlInsertCommand2 = new System.Data.SqlClient.SqlCommand();
			this.sqlSelectCommand2 = new System.Data.SqlClient.SqlCommand();
			this.sqlUpdateCommand2 = new System.Data.SqlClient.SqlCommand();
			this.daOnlineInfo = new System.Data.SqlClient.SqlDataAdapter();
			this.sqlDeleteCommand4 = new System.Data.SqlClient.SqlCommand();
			this.sqlInsertCommand4 = new System.Data.SqlClient.SqlCommand();
			this.sqlSelectCommand4 = new System.Data.SqlClient.SqlCommand();
			this.sqlUpdateCommand4 = new System.Data.SqlClient.SqlCommand();
			this.daShareInfo = new System.Data.SqlClient.SqlDataAdapter();
			this.sqlDeleteCommand5 = new System.Data.SqlClient.SqlCommand();
			this.sqlInsertCommand5 = new System.Data.SqlClient.SqlCommand();
			this.sqlSelectCommand5 = new System.Data.SqlClient.SqlCommand();
			this.sqlUpdateCommand5 = new System.Data.SqlClient.SqlCommand();
			this.daMessage = new System.Data.SqlClient.SqlDataAdapter();
			this.sqlDeleteCommand3 = new System.Data.SqlClient.SqlCommand();
			this.sqlInsertCommand3 = new System.Data.SqlClient.SqlCommand();
			this.sqlSelectCommand3 = new System.Data.SqlClient.SqlCommand();
			this.sqlUpdateCommand3 = new System.Data.SqlClient.SqlCommand();
			this.daUserInfo = new System.Data.SqlClient.SqlDataAdapter();
			this.sqlSelectCommand1 = new System.Data.SqlClient.SqlCommand();
			this.sqlInsertCommand1 = new System.Data.SqlClient.SqlCommand();
			this.sqlUpdateCommand1 = new System.Data.SqlClient.SqlCommand();
			this.sqlDeleteCommand1 = new System.Data.SqlClient.SqlCommand();
			// 
			// dbConn
			// 
			this.dbConn.ConnectionString = ((string)(configurationAppSettings.GetValue("dbConn.ConnectionString", typeof(string))));
			// 
			// daBook
			// 
			this.daBook.DeleteCommand = this.sqlDeleteCommand2;
			this.daBook.InsertCommand = this.sqlInsertCommand2;
			this.daBook.SelectCommand = this.sqlSelectCommand2;
			this.daBook.TableMappings.AddRange(new System.Data.Common.DataTableMapping[] {
																							 new System.Data.Common.DataTableMapping("Table", "BOOK_INFO", new System.Data.Common.DataColumnMapping[] {
																																																		  new System.Data.Common.DataColumnMapping("ID", "ID"),
																																																		  new System.Data.Common.DataColumnMapping("BookNameEng", "BookNameEng"),
																																																		  new System.Data.Common.DataColumnMapping("BookNameChn", "BookNameChn"),
																																																		  new System.Data.Common.DataColumnMapping("Author", "Author"),
																																																		  new System.Data.Common.DataColumnMapping("Translator", "Translator"),
																																																		  new System.Data.Common.DataColumnMapping("Press", "Press"),
																																																		  new System.Data.Common.DataColumnMapping("ISBN", "ISBN"),
																																																		  new System.Data.Common.DataColumnMapping("Summary", "Summary"),
																																																		  new System.Data.Common.DataColumnMapping("CoverPage", "CoverPage"),
																																																		  new System.Data.Common.DataColumnMapping("Contents", "Contents"),
																																																		  new System.Data.Common.DataColumnMapping("Status", "Status"),
																																																		  new System.Data.Common.DataColumnMapping("Owner", "Owner"),
																																																		  new System.Data.Common.DataColumnMapping("CurrentShareInfo", "CurrentShareInfo")})});
			this.daBook.UpdateCommand = this.sqlUpdateCommand2;
			// 
			// sqlDeleteCommand2
			// 
			this.sqlDeleteCommand2.CommandText = "[BookDeleteCommand]";
			this.sqlDeleteCommand2.CommandType = System.Data.CommandType.StoredProcedure;
			this.sqlDeleteCommand2.Connection = this.dbConn;
			this.sqlDeleteCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@RETURN_VALUE", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.ReturnValue, false, ((System.Byte)(0)), ((System.Byte)(0)), "", System.Data.DataRowVersion.Current, null));
			this.sqlDeleteCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_ID", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "ID", System.Data.DataRowVersion.Original, null));
			this.sqlDeleteCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_Author", System.Data.SqlDbType.NVarChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "Author", System.Data.DataRowVersion.Original, null));
			this.sqlDeleteCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_BookNameChn", System.Data.SqlDbType.NVarChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "BookNameChn", System.Data.DataRowVersion.Original, null));
			this.sqlDeleteCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_BookNameEng", System.Data.SqlDbType.NVarChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "BookNameEng", System.Data.DataRowVersion.Original, null));
			this.sqlDeleteCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_CoverPage", System.Data.SqlDbType.NVarChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "CoverPage", System.Data.DataRowVersion.Original, null));
			this.sqlDeleteCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_CurrentShareInfo", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "CurrentShareInfo", System.Data.DataRowVersion.Original, null));
			this.sqlDeleteCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_ISBN", System.Data.SqlDbType.NVarChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "ISBN", System.Data.DataRowVersion.Original, null));
			this.sqlDeleteCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_Owner", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "Owner", System.Data.DataRowVersion.Original, null));
			this.sqlDeleteCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_Press", System.Data.SqlDbType.NVarChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "Press", System.Data.DataRowVersion.Original, null));
			this.sqlDeleteCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_Status", System.Data.SqlDbType.NVarChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "Status", System.Data.DataRowVersion.Original, null));
			this.sqlDeleteCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_Translator", System.Data.SqlDbType.NVarChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "Translator", System.Data.DataRowVersion.Original, null));
			// 
			// sqlInsertCommand2
			// 
			this.sqlInsertCommand2.CommandText = "[BookInsertCommand]";
			this.sqlInsertCommand2.CommandType = System.Data.CommandType.StoredProcedure;
			this.sqlInsertCommand2.Connection = this.dbConn;
			this.sqlInsertCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@RETURN_VALUE", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.ReturnValue, false, ((System.Byte)(0)), ((System.Byte)(0)), "", System.Data.DataRowVersion.Current, null));
			this.sqlInsertCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@BookNameEng", System.Data.SqlDbType.NVarChar, 50, "BookNameEng"));
			this.sqlInsertCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@BookNameChn", System.Data.SqlDbType.NVarChar, 50, "BookNameChn"));
			this.sqlInsertCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Author", System.Data.SqlDbType.NVarChar, 50, "Author"));
			this.sqlInsertCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Translator", System.Data.SqlDbType.NVarChar, 50, "Translator"));
			this.sqlInsertCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Press", System.Data.SqlDbType.NVarChar, 50, "Press"));
			this.sqlInsertCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@ISBN", System.Data.SqlDbType.NVarChar, 50, "ISBN"));
			this.sqlInsertCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Summary", System.Data.SqlDbType.NVarChar, 4000, "Summary"));
			this.sqlInsertCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@CoverPage", System.Data.SqlDbType.NVarChar, 50, "CoverPage"));
			this.sqlInsertCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Contents", System.Data.SqlDbType.NVarChar, 200, "Contents"));
			this.sqlInsertCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Status", System.Data.SqlDbType.NVarChar, 50, "Status"));
			this.sqlInsertCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Owner", System.Data.SqlDbType.Int, 4, "Owner"));
			this.sqlInsertCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@CurrentShareInfo", System.Data.SqlDbType.Int, 4, "CurrentShareInfo"));
			// 
			// sqlSelectCommand2
			// 
			this.sqlSelectCommand2.CommandText = "[BookSelectCommand]";
			this.sqlSelectCommand2.CommandType = System.Data.CommandType.StoredProcedure;
			this.sqlSelectCommand2.Connection = this.dbConn;
			this.sqlSelectCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@RETURN_VALUE", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.ReturnValue, false, ((System.Byte)(0)), ((System.Byte)(0)), "", System.Data.DataRowVersion.Current, null));
			// 
			// sqlUpdateCommand2
			// 
			this.sqlUpdateCommand2.CommandText = "[BookUpdateCommand]";
			this.sqlUpdateCommand2.CommandType = System.Data.CommandType.StoredProcedure;
			this.sqlUpdateCommand2.Connection = this.dbConn;
			this.sqlUpdateCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@RETURN_VALUE", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.ReturnValue, false, ((System.Byte)(0)), ((System.Byte)(0)), "", System.Data.DataRowVersion.Current, null));
			this.sqlUpdateCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@BookNameEng", System.Data.SqlDbType.NVarChar, 50, "BookNameEng"));
			this.sqlUpdateCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@BookNameChn", System.Data.SqlDbType.NVarChar, 50, "BookNameChn"));
			this.sqlUpdateCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Author", System.Data.SqlDbType.NVarChar, 50, "Author"));
			this.sqlUpdateCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Translator", System.Data.SqlDbType.NVarChar, 50, "Translator"));
			this.sqlUpdateCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Press", System.Data.SqlDbType.NVarChar, 50, "Press"));
			this.sqlUpdateCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@ISBN", System.Data.SqlDbType.NVarChar, 50, "ISBN"));
			this.sqlUpdateCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Summary", System.Data.SqlDbType.NVarChar, 4000, "Summary"));
			this.sqlUpdateCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@CoverPage", System.Data.SqlDbType.NVarChar, 50, "CoverPage"));
			this.sqlUpdateCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Contents", System.Data.SqlDbType.NVarChar, 200, "Contents"));
			this.sqlUpdateCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Status", System.Data.SqlDbType.NVarChar, 50, "Status"));
			this.sqlUpdateCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Owner", System.Data.SqlDbType.Int, 4, "Owner"));
			this.sqlUpdateCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@CurrentShareInfo", System.Data.SqlDbType.Int, 4, "CurrentShareInfo"));
			this.sqlUpdateCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_ID", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "ID", System.Data.DataRowVersion.Original, null));
			this.sqlUpdateCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_Author", System.Data.SqlDbType.NVarChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "Author", System.Data.DataRowVersion.Original, null));
			this.sqlUpdateCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_BookNameChn", System.Data.SqlDbType.NVarChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "BookNameChn", System.Data.DataRowVersion.Original, null));
			this.sqlUpdateCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_BookNameEng", System.Data.SqlDbType.NVarChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "BookNameEng", System.Data.DataRowVersion.Original, null));
			this.sqlUpdateCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_CoverPage", System.Data.SqlDbType.NVarChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "CoverPage", System.Data.DataRowVersion.Original, null));
			this.sqlUpdateCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_CurrentShareInfo", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "CurrentShareInfo", System.Data.DataRowVersion.Original, null));
			this.sqlUpdateCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_ISBN", System.Data.SqlDbType.NVarChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "ISBN", System.Data.DataRowVersion.Original, null));
			this.sqlUpdateCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_Owner", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "Owner", System.Data.DataRowVersion.Original, null));
			this.sqlUpdateCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_Press", System.Data.SqlDbType.NVarChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "Press", System.Data.DataRowVersion.Original, null));
			this.sqlUpdateCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_Status", System.Data.SqlDbType.NVarChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "Status", System.Data.DataRowVersion.Original, null));
			this.sqlUpdateCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_Translator", System.Data.SqlDbType.NVarChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "Translator", System.Data.DataRowVersion.Original, null));
			this.sqlUpdateCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@ID", System.Data.SqlDbType.Int, 4, "ID"));
			// 
			// daOnlineInfo
			// 
			this.daOnlineInfo.DeleteCommand = this.sqlDeleteCommand4;
			this.daOnlineInfo.InsertCommand = this.sqlInsertCommand4;
			this.daOnlineInfo.SelectCommand = this.sqlSelectCommand4;
			this.daOnlineInfo.TableMappings.AddRange(new System.Data.Common.DataTableMapping[] {
																								   new System.Data.Common.DataTableMapping("Table", "ONLINE_INFO", new System.Data.Common.DataColumnMapping[] {
																																																				  new System.Data.Common.DataColumnMapping("ID", "ID"),
																																																				  new System.Data.Common.DataColumnMapping("Book", "Book"),
																																																				  new System.Data.Common.DataColumnMapping("Site", "Site"),
																																																				  new System.Data.Common.DataColumnMapping("URL", "URL"),
																																																				  new System.Data.Common.DataColumnMapping("Content", "Content"),
																																																				  new System.Data.Common.DataColumnMapping("Title", "Title")})});
			this.daOnlineInfo.UpdateCommand = this.sqlUpdateCommand4;
			// 
			// sqlDeleteCommand4
			// 
			this.sqlDeleteCommand4.CommandText = "[OnlineInfoDeleteCommand]";
			this.sqlDeleteCommand4.CommandType = System.Data.CommandType.StoredProcedure;
			this.sqlDeleteCommand4.Connection = this.dbConn;
			this.sqlDeleteCommand4.Parameters.Add(new System.Data.SqlClient.SqlParameter("@RETURN_VALUE", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.ReturnValue, false, ((System.Byte)(0)), ((System.Byte)(0)), "", System.Data.DataRowVersion.Current, null));
			this.sqlDeleteCommand4.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_ID", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "ID", System.Data.DataRowVersion.Original, null));
			this.sqlDeleteCommand4.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_Book", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "Book", System.Data.DataRowVersion.Original, null));
			this.sqlDeleteCommand4.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_Site", System.Data.SqlDbType.NVarChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "Site", System.Data.DataRowVersion.Original, null));
			this.sqlDeleteCommand4.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_Title", System.Data.SqlDbType.NVarChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "Title", System.Data.DataRowVersion.Original, null));
			this.sqlDeleteCommand4.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_URL", System.Data.SqlDbType.NVarChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "URL", System.Data.DataRowVersion.Original, null));
			// 
			// sqlInsertCommand4
			// 
			this.sqlInsertCommand4.CommandText = "[OnlineInfoInsertCommand]";
			this.sqlInsertCommand4.CommandType = System.Data.CommandType.StoredProcedure;
			this.sqlInsertCommand4.Connection = this.dbConn;
			this.sqlInsertCommand4.Parameters.Add(new System.Data.SqlClient.SqlParameter("@RETURN_VALUE", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.ReturnValue, false, ((System.Byte)(0)), ((System.Byte)(0)), "", System.Data.DataRowVersion.Current, null));
			this.sqlInsertCommand4.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Book", System.Data.SqlDbType.Int, 4, "Book"));
			this.sqlInsertCommand4.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Site", System.Data.SqlDbType.NVarChar, 50, "Site"));
			this.sqlInsertCommand4.Parameters.Add(new System.Data.SqlClient.SqlParameter("@URL", System.Data.SqlDbType.NVarChar, 50, "URL"));
			this.sqlInsertCommand4.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Content", System.Data.SqlDbType.NVarChar, 4000, "Content"));
			this.sqlInsertCommand4.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Title", System.Data.SqlDbType.NVarChar, 50, "Title"));
			// 
			// sqlSelectCommand4
			// 
			this.sqlSelectCommand4.CommandText = "[OnlineInfoSelectCommand]";
			this.sqlSelectCommand4.CommandType = System.Data.CommandType.StoredProcedure;
			this.sqlSelectCommand4.Connection = this.dbConn;
			this.sqlSelectCommand4.Parameters.Add(new System.Data.SqlClient.SqlParameter("@RETURN_VALUE", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.ReturnValue, false, ((System.Byte)(0)), ((System.Byte)(0)), "", System.Data.DataRowVersion.Current, null));
			// 
			// sqlUpdateCommand4
			// 
			this.sqlUpdateCommand4.CommandText = "[OnlineInfoUpdateCommand]";
			this.sqlUpdateCommand4.CommandType = System.Data.CommandType.StoredProcedure;
			this.sqlUpdateCommand4.Connection = this.dbConn;
			this.sqlUpdateCommand4.Parameters.Add(new System.Data.SqlClient.SqlParameter("@RETURN_VALUE", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.ReturnValue, false, ((System.Byte)(0)), ((System.Byte)(0)), "", System.Data.DataRowVersion.Current, null));
			this.sqlUpdateCommand4.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Book", System.Data.SqlDbType.Int, 4, "Book"));
			this.sqlUpdateCommand4.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Site", System.Data.SqlDbType.NVarChar, 50, "Site"));
			this.sqlUpdateCommand4.Parameters.Add(new System.Data.SqlClient.SqlParameter("@URL", System.Data.SqlDbType.NVarChar, 50, "URL"));
			this.sqlUpdateCommand4.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Content", System.Data.SqlDbType.NVarChar, 4000, "Content"));
			this.sqlUpdateCommand4.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Title", System.Data.SqlDbType.NVarChar, 50, "Title"));
			this.sqlUpdateCommand4.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_ID", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "ID", System.Data.DataRowVersion.Original, null));
			this.sqlUpdateCommand4.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_Book", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "Book", System.Data.DataRowVersion.Original, null));
			this.sqlUpdateCommand4.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_Site", System.Data.SqlDbType.NVarChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "Site", System.Data.DataRowVersion.Original, null));
			this.sqlUpdateCommand4.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_Title", System.Data.SqlDbType.NVarChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "Title", System.Data.DataRowVersion.Original, null));
			this.sqlUpdateCommand4.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_URL", System.Data.SqlDbType.NVarChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "URL", System.Data.DataRowVersion.Original, null));
			this.sqlUpdateCommand4.Parameters.Add(new System.Data.SqlClient.SqlParameter("@ID", System.Data.SqlDbType.Int, 4, "ID"));
			// 
			// daShareInfo
			// 
			this.daShareInfo.DeleteCommand = this.sqlDeleteCommand5;
			this.daShareInfo.InsertCommand = this.sqlInsertCommand5;
			this.daShareInfo.SelectCommand = this.sqlSelectCommand5;
			this.daShareInfo.TableMappings.AddRange(new System.Data.Common.DataTableMapping[] {
																								  new System.Data.Common.DataTableMapping("Table", "SHARE_INFO", new System.Data.Common.DataColumnMapping[] {
																																																				new System.Data.Common.DataColumnMapping("ID", "ID"),
																																																				new System.Data.Common.DataColumnMapping("Book", "Book"),
																																																				new System.Data.Common.DataColumnMapping("ShareTo", "ShareTo"),
																																																				new System.Data.Common.DataColumnMapping("ShareFrom", "ShareFrom"),
																																																				new System.Data.Common.DataColumnMapping("ActualBeginDate", "ActualBeginDate"),
																																																				new System.Data.Common.DataColumnMapping("ActualEndDate", "ActualEndDate"),
																																																				new System.Data.Common.DataColumnMapping("PlanBeginDate", "PlanBeginDate"),
																																																				new System.Data.Common.DataColumnMapping("PlanEndDate", "PlanEndDate"),
																																																				new System.Data.Common.DataColumnMapping("Depreciation", "Depreciation"),
																																																				new System.Data.Common.DataColumnMapping("Status", "Status")})});
			this.daShareInfo.UpdateCommand = this.sqlUpdateCommand5;
			// 
			// sqlDeleteCommand5
			// 
			this.sqlDeleteCommand5.CommandText = "[ShareInfoDeleteCommand]";
			this.sqlDeleteCommand5.CommandType = System.Data.CommandType.StoredProcedure;
			this.sqlDeleteCommand5.Connection = this.dbConn;
			this.sqlDeleteCommand5.Parameters.Add(new System.Data.SqlClient.SqlParameter("@RETURN_VALUE", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.ReturnValue, false, ((System.Byte)(0)), ((System.Byte)(0)), "", System.Data.DataRowVersion.Current, null));
			this.sqlDeleteCommand5.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_ID", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "ID", System.Data.DataRowVersion.Original, null));
			this.sqlDeleteCommand5.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_ActualBeginDate", System.Data.SqlDbType.DateTime, 8, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "ActualBeginDate", System.Data.DataRowVersion.Original, null));
			this.sqlDeleteCommand5.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_ActualEndDate", System.Data.SqlDbType.DateTime, 8, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "ActualEndDate", System.Data.DataRowVersion.Original, null));
			this.sqlDeleteCommand5.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_Book", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "Book", System.Data.DataRowVersion.Original, null));
			this.sqlDeleteCommand5.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_Depreciation", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "Depreciation", System.Data.DataRowVersion.Original, null));
			this.sqlDeleteCommand5.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_PlanBeginDate", System.Data.SqlDbType.DateTime, 8, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "PlanBeginDate", System.Data.DataRowVersion.Original, null));
			this.sqlDeleteCommand5.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_PlanEndDate", System.Data.SqlDbType.DateTime, 8, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "PlanEndDate", System.Data.DataRowVersion.Original, null));
			this.sqlDeleteCommand5.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_ShareFrom", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "ShareFrom", System.Data.DataRowVersion.Original, null));
			this.sqlDeleteCommand5.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_ShareTo", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "ShareTo", System.Data.DataRowVersion.Original, null));
			this.sqlDeleteCommand5.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_Status", System.Data.SqlDbType.NVarChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "Status", System.Data.DataRowVersion.Original, null));
			// 
			// sqlInsertCommand5
			// 
			this.sqlInsertCommand5.CommandText = "[ShareInfoInsertCommand]";
			this.sqlInsertCommand5.CommandType = System.Data.CommandType.StoredProcedure;
			this.sqlInsertCommand5.Connection = this.dbConn;
			this.sqlInsertCommand5.Parameters.Add(new System.Data.SqlClient.SqlParameter("@RETURN_VALUE", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.ReturnValue, false, ((System.Byte)(0)), ((System.Byte)(0)), "", System.Data.DataRowVersion.Current, null));
			this.sqlInsertCommand5.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Book", System.Data.SqlDbType.Int, 4, "Book"));
			this.sqlInsertCommand5.Parameters.Add(new System.Data.SqlClient.SqlParameter("@ShareTo", System.Data.SqlDbType.Int, 4, "ShareTo"));
			this.sqlInsertCommand5.Parameters.Add(new System.Data.SqlClient.SqlParameter("@ShareFrom", System.Data.SqlDbType.Int, 4, "ShareFrom"));
			this.sqlInsertCommand5.Parameters.Add(new System.Data.SqlClient.SqlParameter("@ActualBeginDate", System.Data.SqlDbType.DateTime, 8, "ActualBeginDate"));
			this.sqlInsertCommand5.Parameters.Add(new System.Data.SqlClient.SqlParameter("@ActualEndDate", System.Data.SqlDbType.DateTime, 8, "ActualEndDate"));
			this.sqlInsertCommand5.Parameters.Add(new System.Data.SqlClient.SqlParameter("@PlanBeginDate", System.Data.SqlDbType.DateTime, 8, "PlanBeginDate"));
			this.sqlInsertCommand5.Parameters.Add(new System.Data.SqlClient.SqlParameter("@PlanEndDate", System.Data.SqlDbType.DateTime, 8, "PlanEndDate"));
			this.sqlInsertCommand5.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Depreciation", System.Data.SqlDbType.Int, 4, "Depreciation"));
			this.sqlInsertCommand5.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Status", System.Data.SqlDbType.NVarChar, 50, "Status"));
			// 
			// sqlSelectCommand5
			// 
			this.sqlSelectCommand5.CommandText = "[ShareInfoSelectCommand]";
			this.sqlSelectCommand5.CommandType = System.Data.CommandType.StoredProcedure;
			this.sqlSelectCommand5.Connection = this.dbConn;
			this.sqlSelectCommand5.Parameters.Add(new System.Data.SqlClient.SqlParameter("@RETURN_VALUE", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.ReturnValue, false, ((System.Byte)(0)), ((System.Byte)(0)), "", System.Data.DataRowVersion.Current, null));
			// 
			// sqlUpdateCommand5
			// 
			this.sqlUpdateCommand5.CommandText = "[ShareInfoUpdateCommand]";
			this.sqlUpdateCommand5.CommandType = System.Data.CommandType.StoredProcedure;
			this.sqlUpdateCommand5.Connection = this.dbConn;
			this.sqlUpdateCommand5.Parameters.Add(new System.Data.SqlClient.SqlParameter("@RETURN_VALUE", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.ReturnValue, false, ((System.Byte)(0)), ((System.Byte)(0)), "", System.Data.DataRowVersion.Current, null));
			this.sqlUpdateCommand5.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Book", System.Data.SqlDbType.Int, 4, "Book"));
			this.sqlUpdateCommand5.Parameters.Add(new System.Data.SqlClient.SqlParameter("@ShareTo", System.Data.SqlDbType.Int, 4, "ShareTo"));
			this.sqlUpdateCommand5.Parameters.Add(new System.Data.SqlClient.SqlParameter("@ShareFrom", System.Data.SqlDbType.Int, 4, "ShareFrom"));
			this.sqlUpdateCommand5.Parameters.Add(new System.Data.SqlClient.SqlParameter("@ActualBeginDate", System.Data.SqlDbType.DateTime, 8, "ActualBeginDate"));
			this.sqlUpdateCommand5.Parameters.Add(new System.Data.SqlClient.SqlParameter("@ActualEndDate", System.Data.SqlDbType.DateTime, 8, "ActualEndDate"));
			this.sqlUpdateCommand5.Parameters.Add(new System.Data.SqlClient.SqlParameter("@PlanBeginDate", System.Data.SqlDbType.DateTime, 8, "PlanBeginDate"));
			this.sqlUpdateCommand5.Parameters.Add(new System.Data.SqlClient.SqlParameter("@PlanEndDate", System.Data.SqlDbType.DateTime, 8, "PlanEndDate"));
			this.sqlUpdateCommand5.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Depreciation", System.Data.SqlDbType.Int, 4, "Depreciation"));
			this.sqlUpdateCommand5.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Status", System.Data.SqlDbType.NVarChar, 50, "Status"));
			this.sqlUpdateCommand5.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_ID", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "ID", System.Data.DataRowVersion.Original, null));
			this.sqlUpdateCommand5.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_ActualBeginDate", System.Data.SqlDbType.DateTime, 8, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "ActualBeginDate", System.Data.DataRowVersion.Original, null));
			this.sqlUpdateCommand5.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_ActualEndDate", System.Data.SqlDbType.DateTime, 8, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "ActualEndDate", System.Data.DataRowVersion.Original, null));
			this.sqlUpdateCommand5.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_Book", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "Book", System.Data.DataRowVersion.Original, null));
			this.sqlUpdateCommand5.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_Depreciation", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "Depreciation", System.Data.DataRowVersion.Original, null));
			this.sqlUpdateCommand5.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_PlanBeginDate", System.Data.SqlDbType.DateTime, 8, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "PlanBeginDate", System.Data.DataRowVersion.Original, null));
			this.sqlUpdateCommand5.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_PlanEndDate", System.Data.SqlDbType.DateTime, 8, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "PlanEndDate", System.Data.DataRowVersion.Original, null));
			this.sqlUpdateCommand5.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_ShareFrom", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "ShareFrom", System.Data.DataRowVersion.Original, null));
			this.sqlUpdateCommand5.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_ShareTo", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "ShareTo", System.Data.DataRowVersion.Original, null));
			this.sqlUpdateCommand5.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_Status", System.Data.SqlDbType.NVarChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "Status", System.Data.DataRowVersion.Original, null));
			this.sqlUpdateCommand5.Parameters.Add(new System.Data.SqlClient.SqlParameter("@ID", System.Data.SqlDbType.Int, 4, "ID"));
			// 
			// daMessage
			// 
			this.daMessage.DeleteCommand = this.sqlDeleteCommand3;
			this.daMessage.InsertCommand = this.sqlInsertCommand3;
			this.daMessage.SelectCommand = this.sqlSelectCommand3;
			this.daMessage.TableMappings.AddRange(new System.Data.Common.DataTableMapping[] {
																								new System.Data.Common.DataTableMapping("Table", "MESSAGE_INFO", new System.Data.Common.DataColumnMapping[] {
																																																				new System.Data.Common.DataColumnMapping("ID", "ID"),
																																																				new System.Data.Common.DataColumnMapping("MessageType", "MessageType"),
																																																				new System.Data.Common.DataColumnMapping("MessageTo", "MessageTo"),
																																																				new System.Data.Common.DataColumnMapping("MessageFrom", "MessageFrom"),
																																																				new System.Data.Common.DataColumnMapping("Title", "Title"),
																																																				new System.Data.Common.DataColumnMapping("Body", "Body"),
																																																				new System.Data.Common.DataColumnMapping("HasRead", "HasRead"),
																																																				new System.Data.Common.DataColumnMapping("SendDate", "SendDate"),
																																																				new System.Data.Common.DataColumnMapping("ShareInfo", "ShareInfo")})});
			this.daMessage.UpdateCommand = this.sqlUpdateCommand3;
			// 
			// sqlDeleteCommand3
			// 
			this.sqlDeleteCommand3.CommandText = "[MessageDeleteCommand]";
			this.sqlDeleteCommand3.CommandType = System.Data.CommandType.StoredProcedure;
			this.sqlDeleteCommand3.Connection = this.dbConn;
			this.sqlDeleteCommand3.Parameters.Add(new System.Data.SqlClient.SqlParameter("@RETURN_VALUE", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.ReturnValue, false, ((System.Byte)(0)), ((System.Byte)(0)), "", System.Data.DataRowVersion.Current, null));
			this.sqlDeleteCommand3.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_ID", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "ID", System.Data.DataRowVersion.Original, null));
			this.sqlDeleteCommand3.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_Body", System.Data.SqlDbType.NVarChar, 4000, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "Body", System.Data.DataRowVersion.Original, null));
			this.sqlDeleteCommand3.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_HasRead", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "HasRead", System.Data.DataRowVersion.Original, null));
			this.sqlDeleteCommand3.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_MessageFrom", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "MessageFrom", System.Data.DataRowVersion.Original, null));
			this.sqlDeleteCommand3.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_MessageTo", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "MessageTo", System.Data.DataRowVersion.Original, null));
			this.sqlDeleteCommand3.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_MessageType", System.Data.SqlDbType.NVarChar, 10, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "MessageType", System.Data.DataRowVersion.Original, null));
			this.sqlDeleteCommand3.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_SendDate", System.Data.SqlDbType.DateTime, 8, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "SendDate", System.Data.DataRowVersion.Original, null));
			this.sqlDeleteCommand3.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_ShareInfo", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "ShareInfo", System.Data.DataRowVersion.Original, null));
			this.sqlDeleteCommand3.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_Title", System.Data.SqlDbType.NVarChar, 200, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "Title", System.Data.DataRowVersion.Original, null));
			// 
			// sqlInsertCommand3
			// 
			this.sqlInsertCommand3.CommandText = "[MessageInsertCommand]";
			this.sqlInsertCommand3.CommandType = System.Data.CommandType.StoredProcedure;
			this.sqlInsertCommand3.Connection = this.dbConn;
			this.sqlInsertCommand3.Parameters.Add(new System.Data.SqlClient.SqlParameter("@RETURN_VALUE", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.ReturnValue, false, ((System.Byte)(0)), ((System.Byte)(0)), "", System.Data.DataRowVersion.Current, null));
			this.sqlInsertCommand3.Parameters.Add(new System.Data.SqlClient.SqlParameter("@MessageType", System.Data.SqlDbType.NVarChar, 10, "MessageType"));
			this.sqlInsertCommand3.Parameters.Add(new System.Data.SqlClient.SqlParameter("@MessageTo", System.Data.SqlDbType.Int, 4, "MessageTo"));
			this.sqlInsertCommand3.Parameters.Add(new System.Data.SqlClient.SqlParameter("@MessageFrom", System.Data.SqlDbType.Int, 4, "MessageFrom"));
			this.sqlInsertCommand3.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Title", System.Data.SqlDbType.NVarChar, 200, "Title"));
			this.sqlInsertCommand3.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Body", System.Data.SqlDbType.NVarChar, 4000, "Body"));
			this.sqlInsertCommand3.Parameters.Add(new System.Data.SqlClient.SqlParameter("@HasRead", System.Data.SqlDbType.Int, 4, "HasRead"));
			this.sqlInsertCommand3.Parameters.Add(new System.Data.SqlClient.SqlParameter("@SendDate", System.Data.SqlDbType.DateTime, 8, "SendDate"));
			this.sqlInsertCommand3.Parameters.Add(new System.Data.SqlClient.SqlParameter("@ShareInfo", System.Data.SqlDbType.Int, 4, "ShareInfo"));
			// 
			// sqlSelectCommand3
			// 
			this.sqlSelectCommand3.CommandText = "[MessageSelectCommand]";
			this.sqlSelectCommand3.CommandType = System.Data.CommandType.StoredProcedure;
			this.sqlSelectCommand3.Connection = this.dbConn;
			this.sqlSelectCommand3.Parameters.Add(new System.Data.SqlClient.SqlParameter("@RETURN_VALUE", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.ReturnValue, false, ((System.Byte)(0)), ((System.Byte)(0)), "", System.Data.DataRowVersion.Current, null));
			// 
			// sqlUpdateCommand3
			// 
			this.sqlUpdateCommand3.CommandText = "[MessageUpdateCommand]";
			this.sqlUpdateCommand3.CommandType = System.Data.CommandType.StoredProcedure;
			this.sqlUpdateCommand3.Connection = this.dbConn;
			this.sqlUpdateCommand3.Parameters.Add(new System.Data.SqlClient.SqlParameter("@RETURN_VALUE", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.ReturnValue, false, ((System.Byte)(0)), ((System.Byte)(0)), "", System.Data.DataRowVersion.Current, null));
			this.sqlUpdateCommand3.Parameters.Add(new System.Data.SqlClient.SqlParameter("@MessageType", System.Data.SqlDbType.NVarChar, 10, "MessageType"));
			this.sqlUpdateCommand3.Parameters.Add(new System.Data.SqlClient.SqlParameter("@MessageTo", System.Data.SqlDbType.Int, 4, "MessageTo"));
			this.sqlUpdateCommand3.Parameters.Add(new System.Data.SqlClient.SqlParameter("@MessageFrom", System.Data.SqlDbType.Int, 4, "MessageFrom"));
			this.sqlUpdateCommand3.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Title", System.Data.SqlDbType.NVarChar, 200, "Title"));
			this.sqlUpdateCommand3.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Body", System.Data.SqlDbType.NVarChar, 4000, "Body"));
			this.sqlUpdateCommand3.Parameters.Add(new System.Data.SqlClient.SqlParameter("@HasRead", System.Data.SqlDbType.Int, 4, "HasRead"));
			this.sqlUpdateCommand3.Parameters.Add(new System.Data.SqlClient.SqlParameter("@SendDate", System.Data.SqlDbType.DateTime, 8, "SendDate"));
			this.sqlUpdateCommand3.Parameters.Add(new System.Data.SqlClient.SqlParameter("@ShareInfo", System.Data.SqlDbType.Int, 4, "ShareInfo"));
			this.sqlUpdateCommand3.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_ID", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "ID", System.Data.DataRowVersion.Original, null));
			this.sqlUpdateCommand3.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_Body", System.Data.SqlDbType.NVarChar, 4000, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "Body", System.Data.DataRowVersion.Original, null));
			this.sqlUpdateCommand3.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_HasRead", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "HasRead", System.Data.DataRowVersion.Original, null));
			this.sqlUpdateCommand3.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_MessageFrom", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "MessageFrom", System.Data.DataRowVersion.Original, null));
			this.sqlUpdateCommand3.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_MessageTo", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "MessageTo", System.Data.DataRowVersion.Original, null));
			this.sqlUpdateCommand3.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_MessageType", System.Data.SqlDbType.NVarChar, 10, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "MessageType", System.Data.DataRowVersion.Original, null));
			this.sqlUpdateCommand3.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_SendDate", System.Data.SqlDbType.DateTime, 8, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "SendDate", System.Data.DataRowVersion.Original, null));
			this.sqlUpdateCommand3.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_ShareInfo", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "ShareInfo", System.Data.DataRowVersion.Original, null));
			this.sqlUpdateCommand3.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_Title", System.Data.SqlDbType.NVarChar, 200, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "Title", System.Data.DataRowVersion.Original, null));
			this.sqlUpdateCommand3.Parameters.Add(new System.Data.SqlClient.SqlParameter("@ID", System.Data.SqlDbType.Int, 4, "ID"));
			// 
			// daUserInfo
			// 
			this.daUserInfo.DeleteCommand = this.sqlDeleteCommand1;
			this.daUserInfo.InsertCommand = this.sqlInsertCommand1;
			this.daUserInfo.SelectCommand = this.sqlSelectCommand1;
			this.daUserInfo.TableMappings.AddRange(new System.Data.Common.DataTableMapping[] {
																								 new System.Data.Common.DataTableMapping("Table", "USER_INFO", new System.Data.Common.DataColumnMapping[] {
																																																			  new System.Data.Common.DataColumnMapping("ID", "ID"),
																																																			  new System.Data.Common.DataColumnMapping("RealName", "RealName"),
																																																			  new System.Data.Common.DataColumnMapping("UserName", "UserName"),
																																																			  new System.Data.Common.DataColumnMapping("Password", "Password"),
																																																			  new System.Data.Common.DataColumnMapping("Address", "Address"),
																																																			  new System.Data.Common.DataColumnMapping("Email", "Email"),
																																																			  new System.Data.Common.DataColumnMapping("MobilePhone", "MobilePhone"),
																																																			  new System.Data.Common.DataColumnMapping("HomePhone", "HomePhone"),
																																																			  new System.Data.Common.DataColumnMapping("WorkPhone", "WorkPhone"),
																																																			  new System.Data.Common.DataColumnMapping("Company", "Company"),
																																																			  new System.Data.Common.DataColumnMapping("CompanyAddress", "CompanyAddress"),
																																																			  new System.Data.Common.DataColumnMapping("Credit", "Credit"),
																																																			  new System.Data.Common.DataColumnMapping("RatingNumber", "RatingNumber")})});
			this.daUserInfo.UpdateCommand = this.sqlUpdateCommand1;
			// 
			// sqlSelectCommand1
			// 
			this.sqlSelectCommand1.CommandText = "[UserInfoSelectCommand]";
			this.sqlSelectCommand1.CommandType = System.Data.CommandType.StoredProcedure;
			this.sqlSelectCommand1.Connection = this.dbConn;
			this.sqlSelectCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@RETURN_VALUE", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.ReturnValue, false, ((System.Byte)(0)), ((System.Byte)(0)), "", System.Data.DataRowVersion.Current, null));
			// 
			// sqlInsertCommand1
			// 
			this.sqlInsertCommand1.CommandText = "[UserInfoInsertCommand]";
			this.sqlInsertCommand1.CommandType = System.Data.CommandType.StoredProcedure;
			this.sqlInsertCommand1.Connection = this.dbConn;
			this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@RETURN_VALUE", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.ReturnValue, false, ((System.Byte)(0)), ((System.Byte)(0)), "", System.Data.DataRowVersion.Current, null));
			this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@RealName", System.Data.SqlDbType.NVarChar, 20, "RealName"));
			this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@UserName", System.Data.SqlDbType.NVarChar, 20, "UserName"));
			this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Password", System.Data.SqlDbType.NVarChar, 50, "Password"));
			this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Address", System.Data.SqlDbType.NVarChar, 200, "Address"));
			this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Email", System.Data.SqlDbType.NVarChar, 50, "Email"));
			this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@MobilePhone", System.Data.SqlDbType.NVarChar, 50, "MobilePhone"));
			this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@HomePhone", System.Data.SqlDbType.NVarChar, 50, "HomePhone"));
			this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@WorkPhone", System.Data.SqlDbType.NVarChar, 50, "WorkPhone"));
			this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Company", System.Data.SqlDbType.NVarChar, 100, "Company"));
			this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@CompanyAddress", System.Data.SqlDbType.NVarChar, 200, "CompanyAddress"));
			this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Credit", System.Data.SqlDbType.Int, 4, "Credit"));
			this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@RatingNumber", System.Data.SqlDbType.Int, 4, "RatingNumber"));
			// 
			// sqlUpdateCommand1
			// 
			this.sqlUpdateCommand1.CommandText = "[UserInfoUpdateCommand]";
			this.sqlUpdateCommand1.CommandType = System.Data.CommandType.StoredProcedure;
			this.sqlUpdateCommand1.Connection = this.dbConn;
			this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@RETURN_VALUE", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.ReturnValue, false, ((System.Byte)(0)), ((System.Byte)(0)), "", System.Data.DataRowVersion.Current, null));
			this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@RealName", System.Data.SqlDbType.NVarChar, 20, "RealName"));
			this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@UserName", System.Data.SqlDbType.NVarChar, 20, "UserName"));
			this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Password", System.Data.SqlDbType.NVarChar, 50, "Password"));
			this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Address", System.Data.SqlDbType.NVarChar, 200, "Address"));
			this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Email", System.Data.SqlDbType.NVarChar, 50, "Email"));
			this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@MobilePhone", System.Data.SqlDbType.NVarChar, 50, "MobilePhone"));
			this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@HomePhone", System.Data.SqlDbType.NVarChar, 50, "HomePhone"));
			this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@WorkPhone", System.Data.SqlDbType.NVarChar, 50, "WorkPhone"));
			this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Company", System.Data.SqlDbType.NVarChar, 100, "Company"));
			this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@CompanyAddress", System.Data.SqlDbType.NVarChar, 200, "CompanyAddress"));
			this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Credit", System.Data.SqlDbType.Int, 4, "Credit"));
			this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@RatingNumber", System.Data.SqlDbType.Int, 4, "RatingNumber"));
			this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_ID", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "ID", System.Data.DataRowVersion.Original, null));
			this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_Address", System.Data.SqlDbType.NVarChar, 200, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "Address", System.Data.DataRowVersion.Original, null));
			this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_Company", System.Data.SqlDbType.NVarChar, 100, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "Company", System.Data.DataRowVersion.Original, null));
			this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_CompanyAddress", System.Data.SqlDbType.NVarChar, 200, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "CompanyAddress", System.Data.DataRowVersion.Original, null));
			this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_Credit", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "Credit", System.Data.DataRowVersion.Original, null));
			this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_Email", System.Data.SqlDbType.NVarChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "Email", System.Data.DataRowVersion.Original, null));
			this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_HomePhone", System.Data.SqlDbType.NVarChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "HomePhone", System.Data.DataRowVersion.Original, null));
			this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_MobilePhone", System.Data.SqlDbType.NVarChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "MobilePhone", System.Data.DataRowVersion.Original, null));
			this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_Password", System.Data.SqlDbType.NVarChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "Password", System.Data.DataRowVersion.Original, null));
			this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_RatingNumber", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "RatingNumber", System.Data.DataRowVersion.Original, null));
			this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_RealName", System.Data.SqlDbType.NVarChar, 20, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "RealName", System.Data.DataRowVersion.Original, null));
			this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_UserName", System.Data.SqlDbType.NVarChar, 20, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "UserName", System.Data.DataRowVersion.Original, null));
			this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_WorkPhone", System.Data.SqlDbType.NVarChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "WorkPhone", System.Data.DataRowVersion.Original, null));
			this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@ID", System.Data.SqlDbType.Int, 4, "ID"));
			// 
			// sqlDeleteCommand1
			// 
			this.sqlDeleteCommand1.CommandText = "[UserInfoDeleteCommand]";
			this.sqlDeleteCommand1.CommandType = System.Data.CommandType.StoredProcedure;
			this.sqlDeleteCommand1.Connection = this.dbConn;
			this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@RETURN_VALUE", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.ReturnValue, false, ((System.Byte)(0)), ((System.Byte)(0)), "", System.Data.DataRowVersion.Current, null));
			this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_ID", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "ID", System.Data.DataRowVersion.Original, null));
			this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_Address", System.Data.SqlDbType.NVarChar, 200, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "Address", System.Data.DataRowVersion.Original, null));
			this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_Company", System.Data.SqlDbType.NVarChar, 100, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "Company", System.Data.DataRowVersion.Original, null));
			this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_CompanyAddress", System.Data.SqlDbType.NVarChar, 200, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "CompanyAddress", System.Data.DataRowVersion.Original, null));
			this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_Credit", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "Credit", System.Data.DataRowVersion.Original, null));
			this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_Email", System.Data.SqlDbType.NVarChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "Email", System.Data.DataRowVersion.Original, null));
			this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_HomePhone", System.Data.SqlDbType.NVarChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "HomePhone", System.Data.DataRowVersion.Original, null));
			this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_MobilePhone", System.Data.SqlDbType.NVarChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "MobilePhone", System.Data.DataRowVersion.Original, null));
			this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_Password", System.Data.SqlDbType.NVarChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "Password", System.Data.DataRowVersion.Original, null));
			this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_RatingNumber", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "RatingNumber", System.Data.DataRowVersion.Original, null));
			this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_RealName", System.Data.SqlDbType.NVarChar, 20, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "RealName", System.Data.DataRowVersion.Original, null));
			this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_UserName", System.Data.SqlDbType.NVarChar, 20, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "UserName", System.Data.DataRowVersion.Original, null));
			this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_WorkPhone", System.Data.SqlDbType.NVarChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "WorkPhone", System.Data.DataRowVersion.Original, null));

		}

		/// <summary>
		/// 清理所有正在使用的资源。
		/// </summary>
		protected override void Dispose( bool disposing )
		{
			if(disposing && components != null)
			{
				components.Dispose();
			}
			base.Dispose(disposing);		
		}
		
		#endregion

		// WEB 服务示例
		// HelloWorld() 示例服务返回字符串 Hello World
		// 若要生成，请取消注释下列行，然后保存并生成项目
		// 若要测试此 Web 服务，请按 F5 键

//		[WebMethod]
//		public string HelloWorld()
//		{
//			return "Hello World";
//		}
		private bool IsTicketValid(string ticket, bool IsAdminCall)
		{
			//I should remove the line below while debug with client
			//return true;

			if (ticket == null )//|| Context.Cache[ticket] == null)
			{
				// not authenticated
				return false;
			}
			else
			{
				// check the user authorization
				int userID = int.Parse(FormsAuthentication.Decrypt(ticket).Name);

				DataSet ds;
						
				try
				{
					ds = SqlHelper.ExecuteDataset(dbConn, "GetUserInfo", userID);
				}
				finally
				{
					dbConn.Close();
				}
                
				//UserInformation userInfo = new UserInformation();

				//With ds.Tables(0).Rows(0)
				//DataRow dr = ds.Tables[0].Rows[0];

				return ds.Tables[0].Rows.Count>0;

//				userInfo.IsAdministrator = (bool) dr["IsAdministrator"];
//				userInfo.IsAccountLocked = (bool) dr["IsAccountLocked"];
//
//				if (userInfo.IsAccountLocked)
//				{
//					return false;
//				}
//				else
//				{
//					// check admin status (for admin required calls)
//					if (IsAdminCall && !userInfo.IsAdministrator)
//						return false;
//
//					return true;
//				}
			}
		}


		#region General update service
		[WebMethod(Description="Update with DataSetBook Info.")]
		public DataSetBook UpdateBookInfo(string ticket, DataSetBook dsBook)
		{
			if (!IsTicketValid(ticket, false))
				return null;

			// we're doing a loop on the update function and breaking out on a successful update
			// or returning prematurely from a data collision, this allows us to handle
			// missing data without returning to the client.
			do
			{
				try
				{
					// try to update the db
					this.daBook.Update(dsBook, "BOOK_INFO");
					break; //this is the most common path
				}
				catch (DBConcurrencyException dbEx)
				{
					// we're here because either the row was changed by someone else
					// or deleted by the dba, let's try get the updated row
					DataSet ds = new DataSet();

					SqlCommand cmd = new SqlCommand("GetOneBook", dbConn);
					cmd.CommandType = CommandType.StoredProcedure;

					// get the updated row
					SqlDataAdapter da = new SqlDataAdapter(cmd);
					da.SelectCommand.Parameters.Add("@ID", dbEx.Row["ID"]);
					da.Fill(ds);

					// if the row still exists
					if (ds.Tables[0].Rows.Count > 0)
					{
						DataRow proposedRow = dbEx.Row.Table.NewRow();
						DataRow databaseRow = ds.Tables[0].Rows[0];

						// copy the attempted changes
						proposedRow.ItemArray = dbEx.Row.ItemArray;

						// set the row with what's in the database and then re-apply
						// the proposed changes.
						dbEx.Row.Table.Columns["ID"].ReadOnly = false;
						dbEx.Row.ItemArray = databaseRow.ItemArray;
						dbEx.Row.AcceptChanges();
						dbEx.Row.ItemArray = proposedRow.ItemArray;
						dbEx.Row.Table.Columns["ID"].ReadOnly = true;
						
						// note: because this row triggers an ADO.NET exception,
						// the row was tagged with a rowerror property which we'll leave for the client app
						return dsBook;
					}
					else
					{
						// row was deleted from underneath user, deletion always wins
						dbEx.Row.Delete();
						dbEx.Row.AcceptChanges();
					}
				}
			} while(true);

			// all updates successful
			// dump the data and get a clean table
			dsBook.Clear();

			daBook.Fill(dsBook, "BOOK_INFO");

			return dsBook;
		}


		[WebMethod(Description="Update with DataSetMessage Info.")]
		public DataSetMessage UpdateMessageInfo(string ticket, DataSetMessage dsMessage)
		{
			if (!IsTicketValid(ticket, false))
				return null;

			// we're doing a loop on the update function and breaking out on a successful update
			// or returning prematurely from a data collision, this allows us to handle
			// missing data without returning to the client.
			do
			{
				try
				{
					// try to update the db
					this.daMessage.Update(dsMessage, "MESSAGE_INFO");
					break; //this is the most common path
				}
				catch (DBConcurrencyException dbEx)
				{
					// we're here because either the row was changed by someone else
					// or deleted by the dba, let's try get the updated row
					DataSet ds = new DataSet();

					SqlCommand cmd = new SqlCommand("GetOneMessage", dbConn);
					cmd.CommandType = CommandType.StoredProcedure;

					// get the updated row
					SqlDataAdapter da = new SqlDataAdapter(cmd);
					da.SelectCommand.Parameters.Add("@ID", dbEx.Row["ID"]);
					da.Fill(ds);

					// if the row still exists
					if (ds.Tables[0].Rows.Count > 0)
					{
						DataRow proposedRow = dbEx.Row.Table.NewRow();
						DataRow databaseRow = ds.Tables[0].Rows[0];

						// copy the attempted changes
						proposedRow.ItemArray = dbEx.Row.ItemArray;

						// set the row with what's in the database and then re-apply
						// the proposed changes.
						dbEx.Row.Table.Columns["ID"].ReadOnly = false;
						dbEx.Row.ItemArray = databaseRow.ItemArray;
						dbEx.Row.AcceptChanges();
						dbEx.Row.ItemArray = proposedRow.ItemArray;
						dbEx.Row.Table.Columns["ID"].ReadOnly = true;
						
						// note: because this row triggers an ADO.NET exception,
						// the row was tagged with a rowerror property which we'll leave for the client app
						return dsMessage;
					}
					else
					{
						// row was deleted from underneath user, deletion always wins
						dbEx.Row.Delete();
						dbEx.Row.AcceptChanges();
					}
				}
			} while(true);

			// all updates successful
			// dump the data and get a clean table
			// BUT because we cannot return whole messages, 
			// WE USE GetMyMessages instead.

			return GetMyMessages(ticket);
		}


		[WebMethod(Description="Update with DataSetOnlineInfo Info.")]
		public DataSetOnlineInfo UpdateOnlineInfo(string ticket, DataSetOnlineInfo dsOnlineInfo)
		{
			if (!IsTicketValid(ticket, false))
				return null;

			// before we do any thing, record the book id first
			int bookid = -1;
			if(dsOnlineInfo.ONLINE_INFO.Rows.Count>0)
			{
				bookid = dsOnlineInfo.ONLINE_INFO[0].Book;
			}

			// we're doing a loop on the update function and breaking out on a successful update
			// or returning prematurely from a data collision, this allows us to handle
			// missing data without returning to the client.
			do
			{
				try
				{
					// try to update the db
					this.daOnlineInfo.Update(dsOnlineInfo, "ONLINE_INFO");
					break; //this is the most common path
				}
				catch (DBConcurrencyException dbEx)
				{
					// we're here because either the row was changed by someone else
					// or deleted by the dba, let's try get the updated row
					DataSet ds = new DataSet();

					SqlCommand cmd = new SqlCommand("GetOneOnlineInfo", dbConn);
					cmd.CommandType = CommandType.StoredProcedure;

					// get the updated row
					SqlDataAdapter da = new SqlDataAdapter(cmd);
					da.SelectCommand.Parameters.Add("@ID", dbEx.Row["ID"]);
					da.Fill(ds);

					// if the row still exists
					if (ds.Tables[0].Rows.Count > 0)
					{
						DataRow proposedRow = dbEx.Row.Table.NewRow();
						DataRow databaseRow = ds.Tables[0].Rows[0];

						// copy the attempted changes
						proposedRow.ItemArray = dbEx.Row.ItemArray;

						// set the row with what's in the database and then re-apply
						// the proposed changes.
						dbEx.Row.Table.Columns["ID"].ReadOnly = false;
						dbEx.Row.ItemArray = databaseRow.ItemArray;
						dbEx.Row.AcceptChanges();
						dbEx.Row.ItemArray = proposedRow.ItemArray;
						dbEx.Row.Table.Columns["ID"].ReadOnly = true;
						
						// note: because this row triggers an ADO.NET exception,
						// the row was tagged with a rowerror property which we'll leave for the client app
						return dsOnlineInfo;
					}
					else
					{
						// row was deleted from underneath user, deletion always wins
						dbEx.Row.Delete();
						dbEx.Row.AcceptChanges();
					}
				}
			} while(true);

			// all updates successful
			// dump the data and get a clean table
			dsOnlineInfo.Clear();
			
			// we can only return onlineinfos when 
			// book id is recorded
			if(bookid>0)
			{
				//daOnlineInfo.Fill(dsOnlineInfo, "ONLINE_INFO");
				dsOnlineInfo = this.GetOnlineInfos(ticket,bookid);
			}

			return dsOnlineInfo;
		}


		[WebMethod(Description="Update with DataSetShareInfo Info.")]
		public DataSetShareInfo UpdateShareInfo(string ticket, DataSetShareInfo dsShareInfo)
		{
			if (!IsTicketValid(ticket, false))
				return null;

			// we're doing a loop on the update function and breaking out on a successful update
			// or returning prematurely from a data collision, this allows us to handle
			// missing data without returning to the client.
			do
			{
				try
				{
					// try to update the db
					this.daShareInfo.Update(dsShareInfo, "SHARE_INFO");
					break; //this is the most common path
				}
				catch (DBConcurrencyException dbEx)
				{
					// we're here because either the row was changed by someone else
					// or deleted by the dba, let's try get the updated row
					DataSet ds = new DataSet();

					SqlCommand cmd = new SqlCommand("GetOneShareInfo", dbConn);
					cmd.CommandType = CommandType.StoredProcedure;

					// get the updated row
					SqlDataAdapter da = new SqlDataAdapter(cmd);
					da.SelectCommand.Parameters.Add("@ID", dbEx.Row["ID"]);
					da.Fill(ds);

					// if the row still exists
					if (ds.Tables[0].Rows.Count > 0)
					{
						DataRow proposedRow = dbEx.Row.Table.NewRow();
						DataRow databaseRow = ds.Tables[0].Rows[0];

						// copy the attempted changes
						proposedRow.ItemArray = dbEx.Row.ItemArray;

						// set the row with what's in the database and then re-apply
						// the proposed changes.
						dbEx.Row.Table.Columns["ID"].ReadOnly = false;
						dbEx.Row.ItemArray = databaseRow.ItemArray;
						dbEx.Row.AcceptChanges();
						dbEx.Row.ItemArray = proposedRow.ItemArray;
						dbEx.Row.Table.Columns["ID"].ReadOnly = true;
						
						// note: because this row triggers an ADO.NET exception,
						// the row was tagged with a rowerror property which we'll leave for the client app
						return dsShareInfo;
					}
					else
					{
						// row was deleted from underneath user, deletion always wins
						dbEx.Row.Delete();
						dbEx.Row.AcceptChanges();
					}
				}
			} while(true);

			// all updates successful
			// dump the data and get a clean table
			dsShareInfo.Clear();

			dsShareInfo = this.GetMyRelatedShareInfo(ticket);

			return dsShareInfo;
		}


		/// <summary>
		/// Update the USER_INFO table.
		/// </summary>
		/// <param name="ticket"></param>
		/// <param name="dsUserInfo"></param>
		/// <returns>All records of USER_INFO, remember to select to be yours</returns>
		[WebMethod(Description="Update with DataSetUserInfo Info.")]
		public DataSetUserInfo UpdateUserInfo(string ticket, DataSetUserInfo dsUserInfo)
		{
			if (!IsTicketValid(ticket, false))
				return null;

			// we're doing a loop on the update function and breaking out on a successful update
			// or returning prematurely from a data collision, this allows us to handle
			// missing data without returning to the client.
			do
			{
				try
				{
					// try to update the db
					this.daUserInfo.Update(dsUserInfo, "USER_INFO");
					break; //this is the most common path
				}
				catch (DBConcurrencyException dbEx)
				{
					// we're here because either the row was changed by someone else
					// or deleted by the dba, let's try get the updated row
					DataSet ds = new DataSet();

					SqlCommand cmd = new SqlCommand("GetOneUserInfo", dbConn);
					cmd.CommandType = CommandType.StoredProcedure;

					// get the updated row
					SqlDataAdapter da = new SqlDataAdapter(cmd);
					da.SelectCommand.Parameters.Add("@ID", dbEx.Row["ID"]);
					da.Fill(ds);

					// if the row still exists
					if (ds.Tables[0].Rows.Count > 0)
					{
						DataRow proposedRow = dbEx.Row.Table.NewRow();
						DataRow databaseRow = ds.Tables[0].Rows[0];

						// copy the attempted changes
						proposedRow.ItemArray = dbEx.Row.ItemArray;

						// set the row with what's in the database and then re-apply
						// the proposed changes.
						dbEx.Row.Table.Columns["ID"].ReadOnly = false;
						dbEx.Row.ItemArray = databaseRow.ItemArray;
						dbEx.Row.AcceptChanges();
						dbEx.Row.ItemArray = proposedRow.ItemArray;
						dbEx.Row.Table.Columns["ID"].ReadOnly = true;
						
						// note: because this row triggers an ADO.NET exception,
						// the row was tagged with a rowerror property which we'll leave for the client app
						return dsUserInfo;
					}
					else
					{
						// row was deleted from underneath user, deletion always wins
						dbEx.Row.Delete();
						dbEx.Row.AcceptChanges();
					}
				}
			} while(true);

			// all updates successful
			// dump the data and get a clean table
			dsUserInfo.Clear();

			daUserInfo.Fill(dsUserInfo, "USER_INFO");

			return dsUserInfo;
		}
		#endregion

		#region Message Service
		[WebMethod(Description="Returns a Message DataSet containing My all messages in exactly one table named 'MESSAGE_INFO'.")]
		public DataSetMessage GetMyMessages(string ticket)
		{
			if (!IsTicketValid(ticket, false))
				return null;

			DataSetMessage ds = new DataSetMessage();

			//save the original command for restoring.
			SqlCommand oriCmd = daMessage.SelectCommand;
			
			try
			{

				int userID = int.Parse(FormsAuthentication.Decrypt(ticket).Name);

				//create temp command to search
				SqlCommand cmd = new SqlCommand();
				cmd.CommandText = "[GetMyMessage]";
				cmd.CommandType = System.Data.CommandType.StoredProcedure;
				cmd.Connection = this.dbConn;
				cmd.Parameters.Add(new System.Data.SqlClient.SqlParameter("@RETURN_VALUE", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.ReturnValue, false, ((System.Byte)(0)), ((System.Byte)(0)), "", System.Data.DataRowVersion.Current, null));

				//add parameter to search
				cmd.Parameters.Add(new System.Data.SqlClient.SqlParameter("@MessageTo", System.Data.SqlDbType.Int, 4, "MessageTo"));
				
				daMessage.SelectCommand = cmd;

				ds.MESSAGE_INFO.Columns.Add("Receiver",typeof(string));
				ds.MESSAGE_INFO.Columns.Add("Sender",typeof(string));

				cmd.Parameters["@MessageTo"].Value = userID;

				daMessage.Fill(ds, "MESSAGE_INFO");
			}
			catch(Exception ex)
			{
				return null;
			}
			finally
			{
				//restore the command
				daMessage.SelectCommand = oriCmd;
			}

			return ds;
		}


		[WebMethod(Description="Returns a Message DataSet containing all my unread messages in exactly one table named 'MESSAGE_INFO'.")]
		public DataSetMessage GetMyNewMessages(string ticket)
		{
			if (!IsTicketValid(ticket, false))
				return null;

			DataSetMessage ds = new DataSetMessage();

			//save the original command for restoring.
			SqlCommand oriCmd = daMessage.SelectCommand;
			
			try
			{

				int userID = int.Parse(FormsAuthentication.Decrypt(ticket).Name);

				//create temp command to search
				SqlCommand cmd = new SqlCommand();
				cmd.CommandText = "[GetMyNewMessage]";
				cmd.CommandType = System.Data.CommandType.StoredProcedure;
				cmd.Connection = this.dbConn;
				cmd.Parameters.Add(new System.Data.SqlClient.SqlParameter("@RETURN_VALUE", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.ReturnValue, false, ((System.Byte)(0)), ((System.Byte)(0)), "", System.Data.DataRowVersion.Current, null));

				//add parameter to search
				cmd.Parameters.Add(new System.Data.SqlClient.SqlParameter("@MessageTo", System.Data.SqlDbType.Int, 4, "MessageTo"));
				
				daMessage.SelectCommand = cmd;

				cmd.Parameters["@MessageTo"].Value = userID;

				ds.MESSAGE_INFO.Columns.Add("Receiver",typeof(string));
				ds.MESSAGE_INFO.Columns.Add("Sender",typeof(string));

				daMessage.Fill(ds, "MESSAGE_INFO");
			}
			catch(Exception ex)
			{
				return null;
			}
			finally
			{
				//restore the command
				daMessage.SelectCommand = oriCmd;
			}

			return ds;
		}


		[WebMethod(Description="Returns a Message DataSet containing all my unread messages with username in exactly one table named 'MESSAGE_INFO'.")]
		public DataSetMessage GetMyNewMessagesWithUsername(string ticket)
		{
			if (!IsTicketValid(ticket, false))
				return null;

			DataSetMessage ds = new DataSetMessage();

			//save the original command for restoring.
			SqlCommand oriCmd = daMessage.SelectCommand;
			
			try
			{

				int userID = int.Parse(FormsAuthentication.Decrypt(ticket).Name);

				//create temp command to search
				SqlCommand cmd = new SqlCommand();
				cmd.CommandText = "[GetMyNewMessageWithUsername]";
				cmd.CommandType = System.Data.CommandType.StoredProcedure;
				cmd.Connection = this.dbConn;
				cmd.Parameters.Add(new System.Data.SqlClient.SqlParameter("@RETURN_VALUE", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.ReturnValue, false, ((System.Byte)(0)), ((System.Byte)(0)), "", System.Data.DataRowVersion.Current, null));

				//add parameter to search
				cmd.Parameters.Add(new System.Data.SqlClient.SqlParameter("@MessageTo", System.Data.SqlDbType.Int, 4, "MessageTo"));
				
				daMessage.SelectCommand = cmd;

				cmd.Parameters["@MessageTo"].Value = userID;

				ds.MESSAGE_INFO.Columns.Add("Receiver",typeof(string));
				ds.MESSAGE_INFO.Columns.Add("Sender",typeof(string));

				daMessage.Fill(ds, "MESSAGE_INFO");
			}
			catch(Exception ex)
			{
				return null;
			}
			finally
			{
				//restore the command
				daMessage.SelectCommand = oriCmd;
			}

			return ds;
		}

		#endregion

		#region User Service
		[WebMethod(Description="Search userinfo by input value.")]
		public DataSetUserInfo Search(string ticket, string searchValue)
		{
			if (!IsTicketValid(ticket, false))
				return null;

			DataSetUserInfo ds = new DataSetUserInfo();

			//save the original command for restoring.
			SqlCommand oriCmd = this.daUserInfo.SelectCommand;
			
			try
			{
				//create temp command to search
				SqlCommand cmd = new SqlCommand();
				cmd.CommandText = "[SearchUserinfo]";
				cmd.CommandType = System.Data.CommandType.StoredProcedure;
				cmd.Connection = this.dbConn;
				cmd.Parameters.Add(new System.Data.SqlClient.SqlParameter("@RETURN_VALUE", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.ReturnValue, false, ((System.Byte)(0)), ((System.Byte)(0)), "", System.Data.DataRowVersion.Current, null));

				//add parameter to search
				cmd.Parameters.Add(new System.Data.SqlClient.SqlParameter("@SearchValue", System.Data.SqlDbType.NVarChar, 50, "SearchValue"));
				
				daUserInfo.SelectCommand = cmd;

				cmd.Parameters["@SearchValue"].Value = "%"+searchValue+"%";

				daUserInfo.Fill(ds, "USER_INFO");
			}
			catch(Exception ex)
			{
				return null;
			}
			finally
			{
				//restore the command
				daMessage.SelectCommand = oriCmd;
			}

			return ds;
		}


		[WebMethod(Description="Get a user's detail info.")]
		public DataSetUserInfo GetUserDetailInfo(string ticket, int id)
		{
			if (!IsTicketValid(ticket, false))
				return null;

			try
			{
				DataSetUserInfo dsUser = new DataSetUserInfo();
				this.daUserInfo.Fill(dsUser, "USER_INFO");

				//do filter
				DataTable dt = dsUser.USER_INFO.Copy();
				DataRow[] rows = dsUser.USER_INFO.Select(dsUser.USER_INFO.IDColumn.ColumnName+"="+id);
				dt.Clear();
				foreach(DataRow dr in rows)
					dt.ImportRow(dr);
				dsUser.Tables.Clear();
				dsUser.Tables.Add(dt);

				return dsUser;
			}
			catch(Exception ex)
			{
				string str = ex.Message;
				return null;
			}
		}

		#endregion

		#region Book Service
		[WebMethod(Description="Get all books.")]
		public DataSetBook GetAllBooks(string ticket)
		{
			if (!IsTicketValid(ticket, false))
				return null;

			try
			{
				DataSetBook dsRetBook = new DataSetBook();

				dsRetBook.BOOK_INFO.Columns.Add("Ownername",typeof(string));
				this.daBook.Fill(dsRetBook, "BOOK_INFO");
				return dsRetBook;
			}
			catch(Exception ex)
			{
				string str = ex.Message;
				return null;
			}
		}


		[WebMethod(Description="Get specified user's book.")]
		public DataSetBook GetHisBooks(string ticket, string id)
		{
			DataSetBook dsRetBook = this.GetAllBooks(ticket);
			if(dsRetBook == null || dsRetBook.BOOK_INFO.Rows.Count<=0)
				return dsRetBook;

			//do filter
			DataTable dt = dsRetBook.BOOK_INFO.Copy();
			DataRow[] rows = dsRetBook.BOOK_INFO.Select(dsRetBook.BOOK_INFO.OwnerColumn.ColumnName+"="+id);
			dt.Clear();
			foreach(DataRow dr in rows)
				dt.ImportRow(dr);
			dsRetBook.Tables.Clear();
			dsRetBook.Tables.Add(dt);

			return dsRetBook;
		}


		[WebMethod(Description="Search for books with specified exactly condition.")]
		public DataSetBook SearchBooksExactly(string ticket, string BookNameEng	,string BookNameChn
			,string Author,string Translator,string Press,string ISBN,string Summary)
		{
			if (!IsTicketValid(ticket, false))
				return null;

			DataSetBook ds = new DataSetBook();

			//save the original command for restoring.
			SqlCommand oriCmd = this.daBook.SelectCommand;
			
			try
			{

				//int userID = int.Parse(FormsAuthentication.Decrypt(ticket).Name);

				//create temp command to search
				SqlCommand cmd = new SqlCommand();
				cmd.CommandText = "[SearchBooksExactly]";
				cmd.CommandType = System.Data.CommandType.StoredProcedure;
				cmd.Connection = this.dbConn;
				cmd.Parameters.Add(new System.Data.SqlClient.SqlParameter("@RETURN_VALUE", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.ReturnValue, false, ((System.Byte)(0)), ((System.Byte)(0)), "", System.Data.DataRowVersion.Current, null));

				//add parameter to search
				cmd.Parameters.Add(new System.Data.SqlClient.SqlParameter("@BookNameEng", System.Data.SqlDbType.NVarChar, 50, "BookNameEng"));
				cmd.Parameters.Add(new System.Data.SqlClient.SqlParameter("@BookNameChn",System.Data.SqlDbType.NVarChar, 50, "BookNameChn"));
				cmd.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Author", System.Data.SqlDbType.NVarChar, 50, "Author"));
				cmd.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Translator", System.Data.SqlDbType.NVarChar, 50, "Translator"));
				cmd.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Press", System.Data.SqlDbType.NVarChar, 50, "Press"));
				cmd.Parameters.Add(new System.Data.SqlClient.SqlParameter("@ISBN", System.Data.SqlDbType.NVarChar, 50, "ISBN"));
				cmd.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Summary", System.Data.SqlDbType.NVarChar, 50, "Summary"));
				
				daBook.SelectCommand = cmd;

				cmd.Parameters["@BookNameEng"].Value	= "%"+BookNameEng+"%";
				cmd.Parameters["@BookNameChn"].Value	= "%"+BookNameChn+"%";
				cmd.Parameters["@Author"].Value			= "%"+Author+"%";
				cmd.Parameters["@Translator"].Value		= "%"+Translator+"%";
				cmd.Parameters["@Press"].Value			= "%"+Press+"%";
				cmd.Parameters["@ISBN"].Value			= "%"+ISBN+"%";
				cmd.Parameters["@Summary"].Value		= "%"+Summary+"%";

				ds.BOOK_INFO.Columns.Add("Ownername",typeof(string));

				daBook.Fill(ds, "BOOK_INFO");
			}
			catch(Exception ex)
			{
				return null;
			}
			finally
			{
				//restore the command
				daBook.SelectCommand = oriCmd;
			}

			return ds;
		}

		[WebMethod(Description="Search for books with specified fuzzy condition.")]
		public DataSetBook SearchBooksFuzzy(string ticket, string keyword)
		{
			if (!IsTicketValid(ticket, false))
				return null;

			DataSetBook ds = new DataSetBook();

			//save the original command for restoring.
			SqlCommand oriCmd = this.daBook.SelectCommand;
			
			try
			{

				//int userID = int.Parse(FormsAuthentication.Decrypt(ticket).Name);

				//create temp command to search
				SqlCommand cmd = new SqlCommand();
				cmd.CommandText = "[SearchBooksFuzzy]";
				cmd.CommandType = System.Data.CommandType.StoredProcedure;
				cmd.Connection = this.dbConn;
				cmd.Parameters.Add(new System.Data.SqlClient.SqlParameter("@RETURN_VALUE", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.ReturnValue, false, ((System.Byte)(0)), ((System.Byte)(0)), "", System.Data.DataRowVersion.Current, null));

				//add parameter to search
				cmd.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Keyword", System.Data.SqlDbType.NVarChar, 50, "Keyword"));
				
				daBook.SelectCommand = cmd;

				cmd.Parameters["@Keyword"].Value = "%"+keyword+"%";

				ds.BOOK_INFO.Columns.Add("Ownername",typeof(string));

				daBook.Fill(ds, "BOOK_INFO");
			}
			catch(Exception ex)
			{
				return null;
			}
			finally
			{
				//restore the command
				daBook.SelectCommand = oriCmd;
			}

			return ds;

		}
		#endregion

		#region OnlineInfo Service
		[WebMethod(Description="Get specified book's onilne information.")]
		public DataSetOnlineInfo GetOnlineInfos(string ticket, int bookid)
		{
			if (!IsTicketValid(ticket, false))
				return null;

			try
			{
				DataSetOnlineInfo dsOnlineInfo = new DataSetOnlineInfo();
				this.daOnlineInfo.Fill(dsOnlineInfo, "ONLINE_INFO");

				//do filter
				DataTable dt = dsOnlineInfo.ONLINE_INFO.Copy();
				DataRow[] rows = dsOnlineInfo.ONLINE_INFO.Select(dsOnlineInfo.ONLINE_INFO.BookColumn.ColumnName+"="+bookid);
				dt.Clear();
				foreach(DataRow dr in rows)
					dt.ImportRow(dr);
				dsOnlineInfo.Tables.Clear();
				dsOnlineInfo.Tables.Add(dt);

				return dsOnlineInfo;
			}
			catch(Exception ex)
			{
				string str = ex.Message;
				return null;
			}
		}

		#endregion

		#region ShareInfo Service
		[WebMethod(Description="Get specified user's related share information.")]
		public DataSetShareInfo GetMyRelatedShareInfo(string ticket)
		{
			if (!IsTicketValid(ticket, false))
				return null;

			try
			{
				int userID = int.Parse(FormsAuthentication.Decrypt(ticket).Name);

				DataSetShareInfo dsRetShareInfo = new DataSetShareInfo();
				dsRetShareInfo.SHARE_INFO.Columns.Add("BookNameChn",typeof(string));
				dsRetShareInfo.SHARE_INFO.Columns.Add("BookNameEng",typeof(string));
				dsRetShareInfo.SHARE_INFO.Columns.Add("Borrower",typeof(string));
				dsRetShareInfo.SHARE_INFO.Columns.Add("Owner",typeof(string));
				this.daShareInfo.Fill(dsRetShareInfo, "SHARE_INFO");

				//do filter
				DataTable dt = dsRetShareInfo.SHARE_INFO.Copy();
				DataRow[] rows = dsRetShareInfo.SHARE_INFO.Select(
					dsRetShareInfo.SHARE_INFO.ShareFromColumn.ColumnName+"="+userID
					+" OR "
					+dsRetShareInfo.SHARE_INFO.ShareToColumn.ColumnName+"="+userID
					);
				dt.Clear();
				foreach(DataRow dr in rows)
					dt.ImportRow(dr);
				dsRetShareInfo.Tables.Clear();
				dsRetShareInfo.Tables.Add(dt);

				return dsRetShareInfo;
			}
			catch(Exception ex)
			{
				string str = ex.Message;
				return null;
			}
		}

		[WebMethod(Description="Get specified BOOK's queued share information.")]
		public DataSet GetBookCurrentShareInfo(string ticket, int bookid)
		{
			if (!IsTicketValid(ticket, false))
				return null;

			try
			{
//				return dsRetShareInfo;
				DataSet ds;// = new DataSet();
				ds = SqlHelper.ExecuteDataset(this.dbConn,CommandType.Text
					,@" SELECT "
					+@" bookEng,bookChn,ShareTo,ShareFrom, ActualBeginDate, ActualEndDate, "
					+@" PlanBeginDate, PlanEndDate, Depreciation, Status "
					+@" FROM BookRelatedShareInfo WHERE book="+bookid);

				ds.Tables[0].TableName = "BookRelatedShareInfo";

				return ds;
			}
			catch(Exception ex)
			{
				string str = ex.Message;
				return null;
			}
		}

		[WebMethod(Description="Get current user's home info - TodayNotice.")]
		public DataSet GetMyHomeInfo(string ticket)
		{
			if (!IsTicketValid(ticket, false))
				return null;

			try
			{
				int userID = int.Parse(FormsAuthentication.Decrypt(ticket).Name);

				DataSet ds;// = new DataSet();
				SqlParameter sparam = new SqlParameter("@ID",SqlDbType.Int,4);
				sparam.Value = userID;
				ds = SqlHelper.ExecuteDataset(this.dbConn,CommandType.StoredProcedure,@"[GetMyHomeInfos]",sparam);

				//借出
				ds.Tables[0].TableName = "BorrowOut";
				//借入
				ds.Tables[1].TableName = "BorrowIn";
				//等待
				ds.Tables[2].TableName = "InQueue";

				return ds;
			}
			catch(Exception ex)
			{
				string str = ex.Message;
				return null;
			}
		}

		[WebMethod(Description="Get current new books - NewBooks.")]
		public DataSet GetNewBooks(string ticket)
		{
			if (!IsTicketValid(ticket, false))
				return null;

			try
			{
				int userID = int.Parse(FormsAuthentication.Decrypt(ticket).Name);

				DataSet ds;// = new DataSet();
				SqlParameter sparam = new SqlParameter("@ID",SqlDbType.Int,4);
				sparam.Value = userID;
				ds = SqlHelper.ExecuteDataset(this.dbConn,CommandType.StoredProcedure,@"[GetNewBooks]",sparam);

				//新书
				ds.Tables[0].TableName = "NewBooks";

				return ds;
			}
			catch(Exception ex)
			{
				string str = ex.Message;
				return null;
			}
		}

		[WebMethod(Description="Insert single request ShareInfo into table.")]
		public DataSetShareInfo InsertSingleRequestShareInfo(string ticket, 
			int book,int shareTo,int shareFrom,DateTime planBeginDate,DateTime planEndDate)
		{
			if (!IsTicketValid(ticket, false))
				return null;

			try
			{
				DataSet ds;// = new DataSet();
				SqlParameter[] param = {
										   new SqlParameter("@Book",SqlDbType.Int,4)
										   ,new SqlParameter("@ShareTo",SqlDbType.Int,4)
										   ,new SqlParameter("@ShareFrom",SqlDbType.Int,4)
										   ,new SqlParameter("@ActualBeginDate",SqlDbType.DateTime,8)
										   ,new SqlParameter("@ActualEndDate",SqlDbType.DateTime,8)
										   ,new SqlParameter("@PlanBeginDate",SqlDbType.DateTime,8)
										   ,new SqlParameter("@PlanEndDate",SqlDbType.DateTime,8)
										   ,new SqlParameter("@Depreciation",SqlDbType.Int,4)
										   ,new SqlParameter("@Status",SqlDbType.NVarChar,50)
				};
				param[0].Value = book;
				param[1].Value = shareTo;
				param[2].Value = shareFrom;
				param[3].Value = DBNull.Value;
				param[4].Value = DBNull.Value;
				param[5].Value = planBeginDate;
				param[6].Value = planEndDate;
				param[7].Value = DBNull.Value;
				param[8].Value = "REQUEST";

				ds = SqlHelper.ExecuteDataset(this.dbConn,CommandType.StoredProcedure,@"[ShareInfoInsertCommand]",param[0],param[1],param[2],param[3]
					,param[4],param[5],param[6],param[7],param[8]);

				//当前行
				ds.Tables[0].TableName = "SHARE_INFO";
				DataSetShareInfo dsShareInfo = new DataSetShareInfo();
				dsShareInfo.Merge(ds);

				return dsShareInfo;
			}
			catch(Exception ex)
			{
				string str = ex.Message;
				return null;
			}
		}
		#endregion
	}
}
