BookStoreDataSet.Designer.cs
资源名称:BookStore.rar [点击查看]
上传用户:xyl529207
上传日期:2022-08-03
资源大小:935k
文件大小:277k
源码类别:
行业应用
开发平台:
SQL
- [System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
- public virtual int Update(System.Data.DataRow dataRow) {
- return this.Adapter.Update(new System.Data.DataRow[] {
- dataRow});
- }
- [System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
- public virtual int Update(System.Data.DataRow[] dataRows) {
- return this.Adapter.Update(dataRows);
- }
- [System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
- [System.ComponentModel.DataObjectMethodAttribute(System.ComponentModel.DataObjectMethodType.Delete, true)]
- public virtual int Delete(int Original_ID, string Original_ISBN, string Original_Name, string Original_Author, string Original_Press, System.Nullable<System.DateTime> Original_PublishDate, decimal Original_Price, System.Nullable<short> Original_Pages, string Original_Barcode, System.Nullable<bool> Original_CD, int Original_Storage) {
- this.Adapter.DeleteCommand.Parameters[0].Value = ((int)(Original_ID));
- if ((Original_ISBN == null)) {
- throw new System.ArgumentNullException("Original_ISBN");
- }
- else {
- this.Adapter.DeleteCommand.Parameters[1].Value = ((string)(Original_ISBN));
- }
- if ((Original_Name == null)) {
- throw new System.ArgumentNullException("Original_Name");
- }
- else {
- this.Adapter.DeleteCommand.Parameters[2].Value = ((string)(Original_Name));
- }
- if ((Original_Author == null)) {
- this.Adapter.DeleteCommand.Parameters[3].Value = ((object)(1));
- this.Adapter.DeleteCommand.Parameters[4].Value = System.DBNull.Value;
- }
- else {
- this.Adapter.DeleteCommand.Parameters[3].Value = ((object)(0));
- this.Adapter.DeleteCommand.Parameters[4].Value = ((string)(Original_Author));
- }
- if ((Original_Press == null)) {
- this.Adapter.DeleteCommand.Parameters[5].Value = ((object)(1));
- this.Adapter.DeleteCommand.Parameters[6].Value = System.DBNull.Value;
- }
- else {
- this.Adapter.DeleteCommand.Parameters[5].Value = ((object)(0));
- this.Adapter.DeleteCommand.Parameters[6].Value = ((string)(Original_Press));
- }
- if ((Original_PublishDate.HasValue == true)) {
- this.Adapter.DeleteCommand.Parameters[7].Value = ((object)(0));
- this.Adapter.DeleteCommand.Parameters[8].Value = ((System.DateTime)(Original_PublishDate.Value));
- }
- else {
- this.Adapter.DeleteCommand.Parameters[7].Value = ((object)(1));
- this.Adapter.DeleteCommand.Parameters[8].Value = System.DBNull.Value;
- }
- this.Adapter.DeleteCommand.Parameters[9].Value = ((decimal)(Original_Price));
- if ((Original_Pages.HasValue == true)) {
- this.Adapter.DeleteCommand.Parameters[10].Value = ((object)(0));
- this.Adapter.DeleteCommand.Parameters[11].Value = ((short)(Original_Pages.Value));
- }
- else {
- this.Adapter.DeleteCommand.Parameters[10].Value = ((object)(1));
- this.Adapter.DeleteCommand.Parameters[11].Value = System.DBNull.Value;
- }
- if ((Original_Barcode == null)) {
- throw new System.ArgumentNullException("Original_Barcode");
- }
- else {
- this.Adapter.DeleteCommand.Parameters[12].Value = ((string)(Original_Barcode));
- }
- if ((Original_CD.HasValue == true)) {
- this.Adapter.DeleteCommand.Parameters[13].Value = ((object)(0));
- this.Adapter.DeleteCommand.Parameters[14].Value = ((bool)(Original_CD.Value));
- }
- else {
- this.Adapter.DeleteCommand.Parameters[13].Value = ((object)(1));
- this.Adapter.DeleteCommand.Parameters[14].Value = System.DBNull.Value;
- }
- this.Adapter.DeleteCommand.Parameters[15].Value = ((int)(Original_Storage));
- System.Data.ConnectionState previousConnectionState = this.Adapter.DeleteCommand.Connection.State;
- if (((this.Adapter.DeleteCommand.Connection.State & System.Data.ConnectionState.Open)
- != System.Data.ConnectionState.Open)) {
- this.Adapter.DeleteCommand.Connection.Open();
- }
- try {
- int returnValue = this.Adapter.DeleteCommand.ExecuteNonQuery();
- return returnValue;
- }
- finally {
- if ((previousConnectionState == System.Data.ConnectionState.Closed)) {
- this.Adapter.DeleteCommand.Connection.Close();
- }
- }
- }
- [System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
- [System.ComponentModel.DataObjectMethodAttribute(System.ComponentModel.DataObjectMethodType.Insert, true)]
- public virtual int Insert(string ISBN, string Name, string Author, string Press, System.Nullable<System.DateTime> PublishDate, decimal Price, System.Nullable<short> Pages, string Barcode, System.Nullable<bool> CD, int Storage) {
- if ((ISBN == null)) {
- throw new System.ArgumentNullException("ISBN");
- }
- else {
- this.Adapter.InsertCommand.Parameters[0].Value = ((string)(ISBN));
- }
- if ((Name == null)) {
- throw new System.ArgumentNullException("Name");
- }
- else {
- this.Adapter.InsertCommand.Parameters[1].Value = ((string)(Name));
- }
- if ((Author == null)) {
- this.Adapter.InsertCommand.Parameters[2].Value = System.DBNull.Value;
- }
- else {
- this.Adapter.InsertCommand.Parameters[2].Value = ((string)(Author));
- }
- if ((Press == null)) {
- this.Adapter.InsertCommand.Parameters[3].Value = System.DBNull.Value;
- }
- else {
- this.Adapter.InsertCommand.Parameters[3].Value = ((string)(Press));
- }
- if ((PublishDate.HasValue == true)) {
- this.Adapter.InsertCommand.Parameters[4].Value = ((System.DateTime)(PublishDate.Value));
- }
- else {
- this.Adapter.InsertCommand.Parameters[4].Value = System.DBNull.Value;
- }
- this.Adapter.InsertCommand.Parameters[5].Value = ((decimal)(Price));
- if ((Pages.HasValue == true)) {
- this.Adapter.InsertCommand.Parameters[6].Value = ((short)(Pages.Value));
- }
- else {
- this.Adapter.InsertCommand.Parameters[6].Value = System.DBNull.Value;
- }
- if ((Barcode == null)) {
- throw new System.ArgumentNullException("Barcode");
- }
- else {
- this.Adapter.InsertCommand.Parameters[7].Value = ((string)(Barcode));
- }
- if ((CD.HasValue == true)) {
- this.Adapter.InsertCommand.Parameters[8].Value = ((bool)(CD.Value));
- }
- else {
- this.Adapter.InsertCommand.Parameters[8].Value = System.DBNull.Value;
- }
- this.Adapter.InsertCommand.Parameters[9].Value = ((int)(Storage));
- System.Data.ConnectionState previousConnectionState = this.Adapter.InsertCommand.Connection.State;
- if (((this.Adapter.InsertCommand.Connection.State & System.Data.ConnectionState.Open)
- != System.Data.ConnectionState.Open)) {
- this.Adapter.InsertCommand.Connection.Open();
- }
- try {
- int returnValue = this.Adapter.InsertCommand.ExecuteNonQuery();
- return returnValue;
- }
- finally {
- if ((previousConnectionState == System.Data.ConnectionState.Closed)) {
- this.Adapter.InsertCommand.Connection.Close();
- }
- }
- }
- [System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
- [System.ComponentModel.DataObjectMethodAttribute(System.ComponentModel.DataObjectMethodType.Update, true)]
- public virtual int Update(
- string ISBN,
- string Name,
- string Author,
- string Press,
- System.Nullable<System.DateTime> PublishDate,
- decimal Price,
- System.Nullable<short> Pages,
- string Barcode,
- System.Nullable<bool> CD,
- int Storage,
- int Original_ID,
- string Original_ISBN,
- string Original_Name,
- string Original_Author,
- string Original_Press,
- System.Nullable<System.DateTime> Original_PublishDate,
- decimal Original_Price,
- System.Nullable<short> Original_Pages,
- string Original_Barcode,
- System.Nullable<bool> Original_CD,
- int Original_Storage,
- int ID) {
- if ((ISBN == null)) {
- throw new System.ArgumentNullException("ISBN");
- }
- else {
- this.Adapter.UpdateCommand.Parameters[0].Value = ((string)(ISBN));
- }
- if ((Name == null)) {
- throw new System.ArgumentNullException("Name");
- }
- else {
- this.Adapter.UpdateCommand.Parameters[1].Value = ((string)(Name));
- }
- if ((Author == null)) {
- this.Adapter.UpdateCommand.Parameters[2].Value = System.DBNull.Value;
- }
- else {
- this.Adapter.UpdateCommand.Parameters[2].Value = ((string)(Author));
- }
- if ((Press == null)) {
- this.Adapter.UpdateCommand.Parameters[3].Value = System.DBNull.Value;
- }
- else {
- this.Adapter.UpdateCommand.Parameters[3].Value = ((string)(Press));
- }
- if ((PublishDate.HasValue == true)) {
- this.Adapter.UpdateCommand.Parameters[4].Value = ((System.DateTime)(PublishDate.Value));
- }
- else {
- this.Adapter.UpdateCommand.Parameters[4].Value = System.DBNull.Value;
- }
- this.Adapter.UpdateCommand.Parameters[5].Value = ((decimal)(Price));
- if ((Pages.HasValue == true)) {
- this.Adapter.UpdateCommand.Parameters[6].Value = ((short)(Pages.Value));
- }
- else {
- this.Adapter.UpdateCommand.Parameters[6].Value = System.DBNull.Value;
- }
- if ((Barcode == null)) {
- throw new System.ArgumentNullException("Barcode");
- }
- else {
- this.Adapter.UpdateCommand.Parameters[7].Value = ((string)(Barcode));
- }
- if ((CD.HasValue == true)) {
- this.Adapter.UpdateCommand.Parameters[8].Value = ((bool)(CD.Value));
- }
- else {
- this.Adapter.UpdateCommand.Parameters[8].Value = System.DBNull.Value;
- }
- this.Adapter.UpdateCommand.Parameters[9].Value = ((int)(Storage));
- this.Adapter.UpdateCommand.Parameters[10].Value = ((int)(Original_ID));
- if ((Original_ISBN == null)) {
- throw new System.ArgumentNullException("Original_ISBN");
- }
- else {
- this.Adapter.UpdateCommand.Parameters[11].Value = ((string)(Original_ISBN));
- }
- if ((Original_Name == null)) {
- throw new System.ArgumentNullException("Original_Name");
- }
- else {
- this.Adapter.UpdateCommand.Parameters[12].Value = ((string)(Original_Name));
- }
- if ((Original_Author == null)) {
- this.Adapter.UpdateCommand.Parameters[13].Value = ((object)(1));
- this.Adapter.UpdateCommand.Parameters[14].Value = System.DBNull.Value;
- }
- else {
- this.Adapter.UpdateCommand.Parameters[13].Value = ((object)(0));
- this.Adapter.UpdateCommand.Parameters[14].Value = ((string)(Original_Author));
- }
- if ((Original_Press == null)) {
- this.Adapter.UpdateCommand.Parameters[15].Value = ((object)(1));
- this.Adapter.UpdateCommand.Parameters[16].Value = System.DBNull.Value;
- }
- else {
- this.Adapter.UpdateCommand.Parameters[15].Value = ((object)(0));
- this.Adapter.UpdateCommand.Parameters[16].Value = ((string)(Original_Press));
- }
- if ((Original_PublishDate.HasValue == true)) {
- this.Adapter.UpdateCommand.Parameters[17].Value = ((object)(0));
- this.Adapter.UpdateCommand.Parameters[18].Value = ((System.DateTime)(Original_PublishDate.Value));
- }
- else {
- this.Adapter.UpdateCommand.Parameters[17].Value = ((object)(1));
- this.Adapter.UpdateCommand.Parameters[18].Value = System.DBNull.Value;
- }
- this.Adapter.UpdateCommand.Parameters[19].Value = ((decimal)(Original_Price));
- if ((Original_Pages.HasValue == true)) {
- this.Adapter.UpdateCommand.Parameters[20].Value = ((object)(0));
- this.Adapter.UpdateCommand.Parameters[21].Value = ((short)(Original_Pages.Value));
- }
- else {
- this.Adapter.UpdateCommand.Parameters[20].Value = ((object)(1));
- this.Adapter.UpdateCommand.Parameters[21].Value = System.DBNull.Value;
- }
- if ((Original_Barcode == null)) {
- throw new System.ArgumentNullException("Original_Barcode");
- }
- else {
- this.Adapter.UpdateCommand.Parameters[22].Value = ((string)(Original_Barcode));
- }
- if ((Original_CD.HasValue == true)) {
- this.Adapter.UpdateCommand.Parameters[23].Value = ((object)(0));
- this.Adapter.UpdateCommand.Parameters[24].Value = ((bool)(Original_CD.Value));
- }
- else {
- this.Adapter.UpdateCommand.Parameters[23].Value = ((object)(1));
- this.Adapter.UpdateCommand.Parameters[24].Value = System.DBNull.Value;
- }
- this.Adapter.UpdateCommand.Parameters[25].Value = ((int)(Original_Storage));
- this.Adapter.UpdateCommand.Parameters[26].Value = ((int)(ID));
- System.Data.ConnectionState previousConnectionState = this.Adapter.UpdateCommand.Connection.State;
- if (((this.Adapter.UpdateCommand.Connection.State & System.Data.ConnectionState.Open)
- != System.Data.ConnectionState.Open)) {
- this.Adapter.UpdateCommand.Connection.Open();
- }
- try {
- int returnValue = this.Adapter.UpdateCommand.ExecuteNonQuery();
- return returnValue;
- }
- finally {
- if ((previousConnectionState == System.Data.ConnectionState.Closed)) {
- this.Adapter.UpdateCommand.Connection.Close();
- }
- }
- }
- }
- [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "2.0.0.0")]
- [System.ComponentModel.DesignerCategoryAttribute("code")]
- [System.ComponentModel.ToolboxItem(true)]
- [System.ComponentModel.DataObjectAttribute(true)]
- [System.ComponentModel.DesignerAttribute("Microsoft.VSDesigner.DataSource.Design.TableAdapterDesigner, Microsoft.VSDesigner" +
- ", Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
- [System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
- public partial class CustomerTableAdapter : System.ComponentModel.Component {
- private System.Data.SqlClient.SqlDataAdapter _adapter;
- private System.Data.SqlClient.SqlConnection _connection;
- private System.Data.SqlClient.SqlCommand[] _commandCollection;
- private bool _clearBeforeFill;
- [System.Diagnostics.DebuggerNonUserCodeAttribute()]
- public CustomerTableAdapter() {
- this.ClearBeforeFill = true;
- }
- [System.Diagnostics.DebuggerNonUserCodeAttribute()]
- private System.Data.SqlClient.SqlDataAdapter Adapter {
- get {
- if ((this._adapter == null)) {
- this.InitAdapter();
- }
- return this._adapter;
- }
- }
- [System.Diagnostics.DebuggerNonUserCodeAttribute()]
- internal System.Data.SqlClient.SqlConnection Connection {
- get {
- if ((this._connection == null)) {
- this.InitConnection();
- }
- return this._connection;
- }
- set {
- this._connection = value;
- if ((this.Adapter.InsertCommand != null)) {
- this.Adapter.InsertCommand.Connection = value;
- }
- if ((this.Adapter.DeleteCommand != null)) {
- this.Adapter.DeleteCommand.Connection = value;
- }
- if ((this.Adapter.UpdateCommand != null)) {
- this.Adapter.UpdateCommand.Connection = value;
- }
- for (int i = 0; (i < this.CommandCollection.Length); i = (i + 1)) {
- if ((this.CommandCollection[i] != null)) {
- ((System.Data.SqlClient.SqlCommand)(this.CommandCollection[i])).Connection = value;
- }
- }
- }
- }
- [System.Diagnostics.DebuggerNonUserCodeAttribute()]
- protected System.Data.SqlClient.SqlCommand[] CommandCollection {
- get {
- if ((this._commandCollection == null)) {
- this.InitCommandCollection();
- }
- return this._commandCollection;
- }
- }
- [System.Diagnostics.DebuggerNonUserCodeAttribute()]
- public bool ClearBeforeFill {
- get {
- return this._clearBeforeFill;
- }
- set {
- this._clearBeforeFill = value;
- }
- }
- [System.Diagnostics.DebuggerNonUserCodeAttribute()]
- private void InitAdapter() {
- this._adapter = new System.Data.SqlClient.SqlDataAdapter();
- System.Data.Common.DataTableMapping tableMapping = new System.Data.Common.DataTableMapping();
- tableMapping.SourceTable = "Table";
- tableMapping.DataSetTable = "Customer";
- tableMapping.ColumnMappings.Add("ID", "ID");
- tableMapping.ColumnMappings.Add("Name", "Name");
- tableMapping.ColumnMappings.Add("Levels", "Levels");
- tableMapping.ColumnMappings.Add("Gender", "Gender");
- tableMapping.ColumnMappings.Add("Birthday", "Birthday");
- tableMapping.ColumnMappings.Add("Degree", "Degree");
- tableMapping.ColumnMappings.Add("Address", "Address");
- tableMapping.ColumnMappings.Add("Telephone", "Telephone");
- tableMapping.ColumnMappings.Add("Email", "Email");
- tableMapping.ColumnMappings.Add("Score", "Score");
- this._adapter.TableMappings.Add(tableMapping);
- this._adapter.DeleteCommand = new System.Data.SqlClient.SqlCommand();
- this._adapter.DeleteCommand.Connection = this.Connection;
- this._adapter.DeleteCommand.CommandText = @"DELETE FROM [dbo].[Customer] WHERE (([ID] = @Original_ID) AND ([Name] = @Original_Name) AND ([Levels] = @Original_Levels) AND ((@IsNull_Gender = 1 AND [Gender] IS NULL) OR ([Gender] = @Original_Gender)) AND ((@IsNull_Birthday = 1 AND [Birthday] IS NULL) OR ([Birthday] = @Original_Birthday)) AND ((@IsNull_Degree = 1 AND [Degree] IS NULL) OR ([Degree] = @Original_Degree)) AND ((@IsNull_Address = 1 AND [Address] IS NULL) OR ([Address] = @Original_Address)) AND ((@IsNull_Telephone = 1 AND [Telephone] IS NULL) OR ([Telephone] = @Original_Telephone)) AND ((@IsNull_Email = 1 AND [Email] IS NULL) OR ([Email] = @Original_Email)) AND ((@IsNull_Score = 1 AND [Score] IS NULL) OR ([Score] = @Original_Score)))";
- this._adapter.DeleteCommand.CommandType = System.Data.CommandType.Text;
- this._adapter.DeleteCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_ID", System.Data.SqlDbType.Int, 0, System.Data.ParameterDirection.Input, 0, 0, "ID", System.Data.DataRowVersion.Original, false, null, "", "", ""));
- this._adapter.DeleteCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_Name", System.Data.SqlDbType.NVarChar, 0, System.Data.ParameterDirection.Input, 0, 0, "Name", System.Data.DataRowVersion.Original, false, null, "", "", ""));
- this._adapter.DeleteCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_Levels", System.Data.SqlDbType.SmallInt, 0, System.Data.ParameterDirection.Input, 0, 0, "Levels", System.Data.DataRowVersion.Original, false, null, "", "", ""));
- this._adapter.DeleteCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@IsNull_Gender", System.Data.SqlDbType.Int, 0, System.Data.ParameterDirection.Input, 0, 0, "Gender", System.Data.DataRowVersion.Original, true, null, "", "", ""));
- this._adapter.DeleteCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_Gender", System.Data.SqlDbType.Bit, 0, System.Data.ParameterDirection.Input, 0, 0, "Gender", System.Data.DataRowVersion.Original, false, null, "", "", ""));
- this._adapter.DeleteCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@IsNull_Birthday", System.Data.SqlDbType.Int, 0, System.Data.ParameterDirection.Input, 0, 0, "Birthday", System.Data.DataRowVersion.Original, true, null, "", "", ""));
- this._adapter.DeleteCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_Birthday", System.Data.SqlDbType.SmallDateTime, 0, System.Data.ParameterDirection.Input, 0, 0, "Birthday", System.Data.DataRowVersion.Original, false, null, "", "", ""));
- this._adapter.DeleteCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@IsNull_Degree", System.Data.SqlDbType.Int, 0, System.Data.ParameterDirection.Input, 0, 0, "Degree", System.Data.DataRowVersion.Original, true, null, "", "", ""));
- this._adapter.DeleteCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_Degree", System.Data.SqlDbType.NVarChar, 0, System.Data.ParameterDirection.Input, 0, 0, "Degree", System.Data.DataRowVersion.Original, false, null, "", "", ""));
- this._adapter.DeleteCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@IsNull_Address", System.Data.SqlDbType.Int, 0, System.Data.ParameterDirection.Input, 0, 0, "Address", System.Data.DataRowVersion.Original, true, null, "", "", ""));
- this._adapter.DeleteCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_Address", System.Data.SqlDbType.NVarChar, 0, System.Data.ParameterDirection.Input, 0, 0, "Address", System.Data.DataRowVersion.Original, false, null, "", "", ""));
- this._adapter.DeleteCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@IsNull_Telephone", System.Data.SqlDbType.Int, 0, System.Data.ParameterDirection.Input, 0, 0, "Telephone", System.Data.DataRowVersion.Original, true, null, "", "", ""));
- this._adapter.DeleteCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_Telephone", System.Data.SqlDbType.NVarChar, 0, System.Data.ParameterDirection.Input, 0, 0, "Telephone", System.Data.DataRowVersion.Original, false, null, "", "", ""));
- this._adapter.DeleteCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@IsNull_Email", System.Data.SqlDbType.Int, 0, System.Data.ParameterDirection.Input, 0, 0, "Email", System.Data.DataRowVersion.Original, true, null, "", "", ""));
- this._adapter.DeleteCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_Email", System.Data.SqlDbType.NVarChar, 0, System.Data.ParameterDirection.Input, 0, 0, "Email", System.Data.DataRowVersion.Original, false, null, "", "", ""));
- this._adapter.DeleteCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@IsNull_Score", System.Data.SqlDbType.Int, 0, System.Data.ParameterDirection.Input, 0, 0, "Score", System.Data.DataRowVersion.Original, true, null, "", "", ""));
- this._adapter.DeleteCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_Score", System.Data.SqlDbType.Int, 0, System.Data.ParameterDirection.Input, 0, 0, "Score", System.Data.DataRowVersion.Original, false, null, "", "", ""));
- this._adapter.InsertCommand = new System.Data.SqlClient.SqlCommand();
- this._adapter.InsertCommand.Connection = this.Connection;
- this._adapter.InsertCommand.CommandText = @"INSERT INTO [dbo].[Customer] ([Name], [Levels], [Gender], [Birthday], [Degree], [Address], [Telephone], [Email], [Score]) VALUES (@Name, @Levels, @Gender, @Birthday, @Degree, @Address, @Telephone, @Email, @Score);
- SELECT ID, Name, Levels, Gender, Birthday, Degree, Address, Telephone, Email, Score FROM Customer WHERE (ID = SCOPE_IDENTITY())";
- this._adapter.InsertCommand.CommandType = System.Data.CommandType.Text;
- this._adapter.InsertCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Name", System.Data.SqlDbType.NVarChar, 0, System.Data.ParameterDirection.Input, 0, 0, "Name", System.Data.DataRowVersion.Current, false, null, "", "", ""));
- this._adapter.InsertCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Levels", System.Data.SqlDbType.SmallInt, 0, System.Data.ParameterDirection.Input, 0, 0, "Levels", System.Data.DataRowVersion.Current, false, null, "", "", ""));
- this._adapter.InsertCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Gender", System.Data.SqlDbType.Bit, 0, System.Data.ParameterDirection.Input, 0, 0, "Gender", System.Data.DataRowVersion.Current, false, null, "", "", ""));
- this._adapter.InsertCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Birthday", System.Data.SqlDbType.SmallDateTime, 0, System.Data.ParameterDirection.Input, 0, 0, "Birthday", System.Data.DataRowVersion.Current, false, null, "", "", ""));
- this._adapter.InsertCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Degree", System.Data.SqlDbType.NVarChar, 0, System.Data.ParameterDirection.Input, 0, 0, "Degree", System.Data.DataRowVersion.Current, false, null, "", "", ""));
- this._adapter.InsertCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Address", System.Data.SqlDbType.NVarChar, 0, System.Data.ParameterDirection.Input, 0, 0, "Address", System.Data.DataRowVersion.Current, false, null, "", "", ""));
- this._adapter.InsertCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Telephone", System.Data.SqlDbType.NVarChar, 0, System.Data.ParameterDirection.Input, 0, 0, "Telephone", System.Data.DataRowVersion.Current, false, null, "", "", ""));
- this._adapter.InsertCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Email", System.Data.SqlDbType.NVarChar, 0, System.Data.ParameterDirection.Input, 0, 0, "Email", System.Data.DataRowVersion.Current, false, null, "", "", ""));
- this._adapter.InsertCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Score", System.Data.SqlDbType.Int, 0, System.Data.ParameterDirection.Input, 0, 0, "Score", System.Data.DataRowVersion.Current, false, null, "", "", ""));
- this._adapter.UpdateCommand = new System.Data.SqlClient.SqlCommand();
- this._adapter.UpdateCommand.Connection = this.Connection;
- this._adapter.UpdateCommand.CommandText = @"UPDATE [dbo].[Customer] SET [Name] = @Name, [Levels] = @Levels, [Gender] = @Gender, [Birthday] = @Birthday, [Degree] = @Degree, [Address] = @Address, [Telephone] = @Telephone, [Email] = @Email, [Score] = @Score WHERE (([ID] = @Original_ID) AND ([Name] = @Original_Name) AND ([Levels] = @Original_Levels) AND ((@IsNull_Gender = 1 AND [Gender] IS NULL) OR ([Gender] = @Original_Gender)) AND ((@IsNull_Birthday = 1 AND [Birthday] IS NULL) OR ([Birthday] = @Original_Birthday)) AND ((@IsNull_Degree = 1 AND [Degree] IS NULL) OR ([Degree] = @Original_Degree)) AND ((@IsNull_Address = 1 AND [Address] IS NULL) OR ([Address] = @Original_Address)) AND ((@IsNull_Telephone = 1 AND [Telephone] IS NULL) OR ([Telephone] = @Original_Telephone)) AND ((@IsNull_Email = 1 AND [Email] IS NULL) OR ([Email] = @Original_Email)) AND ((@IsNull_Score = 1 AND [Score] IS NULL) OR ([Score] = @Original_Score)));
- SELECT ID, Name, Levels, Gender, Birthday, Degree, Address, Telephone, Email, Score FROM Customer WHERE (ID = @ID)";
- this._adapter.UpdateCommand.CommandType = System.Data.CommandType.Text;
- this._adapter.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Name", System.Data.SqlDbType.NVarChar, 0, System.Data.ParameterDirection.Input, 0, 0, "Name", System.Data.DataRowVersion.Current, false, null, "", "", ""));
- this._adapter.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Levels", System.Data.SqlDbType.SmallInt, 0, System.Data.ParameterDirection.Input, 0, 0, "Levels", System.Data.DataRowVersion.Current, false, null, "", "", ""));
- this._adapter.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Gender", System.Data.SqlDbType.Bit, 0, System.Data.ParameterDirection.Input, 0, 0, "Gender", System.Data.DataRowVersion.Current, false, null, "", "", ""));
- this._adapter.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Birthday", System.Data.SqlDbType.SmallDateTime, 0, System.Data.ParameterDirection.Input, 0, 0, "Birthday", System.Data.DataRowVersion.Current, false, null, "", "", ""));
- this._adapter.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Degree", System.Data.SqlDbType.NVarChar, 0, System.Data.ParameterDirection.Input, 0, 0, "Degree", System.Data.DataRowVersion.Current, false, null, "", "", ""));
- this._adapter.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Address", System.Data.SqlDbType.NVarChar, 0, System.Data.ParameterDirection.Input, 0, 0, "Address", System.Data.DataRowVersion.Current, false, null, "", "", ""));
- this._adapter.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Telephone", System.Data.SqlDbType.NVarChar, 0, System.Data.ParameterDirection.Input, 0, 0, "Telephone", System.Data.DataRowVersion.Current, false, null, "", "", ""));
- this._adapter.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Email", System.Data.SqlDbType.NVarChar, 0, System.Data.ParameterDirection.Input, 0, 0, "Email", System.Data.DataRowVersion.Current, false, null, "", "", ""));
- this._adapter.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Score", System.Data.SqlDbType.Int, 0, System.Data.ParameterDirection.Input, 0, 0, "Score", System.Data.DataRowVersion.Current, false, null, "", "", ""));
- this._adapter.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_ID", System.Data.SqlDbType.Int, 0, System.Data.ParameterDirection.Input, 0, 0, "ID", System.Data.DataRowVersion.Original, false, null, "", "", ""));
- this._adapter.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_Name", System.Data.SqlDbType.NVarChar, 0, System.Data.ParameterDirection.Input, 0, 0, "Name", System.Data.DataRowVersion.Original, false, null, "", "", ""));
- this._adapter.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_Levels", System.Data.SqlDbType.SmallInt, 0, System.Data.ParameterDirection.Input, 0, 0, "Levels", System.Data.DataRowVersion.Original, false, null, "", "", ""));
- this._adapter.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@IsNull_Gender", System.Data.SqlDbType.Int, 0, System.Data.ParameterDirection.Input, 0, 0, "Gender", System.Data.DataRowVersion.Original, true, null, "", "", ""));
- this._adapter.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_Gender", System.Data.SqlDbType.Bit, 0, System.Data.ParameterDirection.Input, 0, 0, "Gender", System.Data.DataRowVersion.Original, false, null, "", "", ""));
- this._adapter.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@IsNull_Birthday", System.Data.SqlDbType.Int, 0, System.Data.ParameterDirection.Input, 0, 0, "Birthday", System.Data.DataRowVersion.Original, true, null, "", "", ""));
- this._adapter.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_Birthday", System.Data.SqlDbType.SmallDateTime, 0, System.Data.ParameterDirection.Input, 0, 0, "Birthday", System.Data.DataRowVersion.Original, false, null, "", "", ""));
- this._adapter.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@IsNull_Degree", System.Data.SqlDbType.Int, 0, System.Data.ParameterDirection.Input, 0, 0, "Degree", System.Data.DataRowVersion.Original, true, null, "", "", ""));
- this._adapter.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_Degree", System.Data.SqlDbType.NVarChar, 0, System.Data.ParameterDirection.Input, 0, 0, "Degree", System.Data.DataRowVersion.Original, false, null, "", "", ""));
- this._adapter.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@IsNull_Address", System.Data.SqlDbType.Int, 0, System.Data.ParameterDirection.Input, 0, 0, "Address", System.Data.DataRowVersion.Original, true, null, "", "", ""));
- this._adapter.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_Address", System.Data.SqlDbType.NVarChar, 0, System.Data.ParameterDirection.Input, 0, 0, "Address", System.Data.DataRowVersion.Original, false, null, "", "", ""));
- this._adapter.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@IsNull_Telephone", System.Data.SqlDbType.Int, 0, System.Data.ParameterDirection.Input, 0, 0, "Telephone", System.Data.DataRowVersion.Original, true, null, "", "", ""));
- this._adapter.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_Telephone", System.Data.SqlDbType.NVarChar, 0, System.Data.ParameterDirection.Input, 0, 0, "Telephone", System.Data.DataRowVersion.Original, false, null, "", "", ""));
- this._adapter.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@IsNull_Email", System.Data.SqlDbType.Int, 0, System.Data.ParameterDirection.Input, 0, 0, "Email", System.Data.DataRowVersion.Original, true, null, "", "", ""));
- this._adapter.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_Email", System.Data.SqlDbType.NVarChar, 0, System.Data.ParameterDirection.Input, 0, 0, "Email", System.Data.DataRowVersion.Original, false, null, "", "", ""));
- this._adapter.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@IsNull_Score", System.Data.SqlDbType.Int, 0, System.Data.ParameterDirection.Input, 0, 0, "Score", System.Data.DataRowVersion.Original, true, null, "", "", ""));
- this._adapter.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_Score", System.Data.SqlDbType.Int, 0, System.Data.ParameterDirection.Input, 0, 0, "Score", System.Data.DataRowVersion.Original, false, null, "", "", ""));
- this._adapter.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@ID", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, 0, 0, "ID", System.Data.DataRowVersion.Current, false, null, "", "", ""));
- }
- [System.Diagnostics.DebuggerNonUserCodeAttribute()]
- private void InitConnection() {
- this._connection = new System.Data.SqlClient.SqlConnection();
- this._connection.ConnectionString = global::BookStoreMan.Properties.Settings.Default.BookStoreConnectionString;
- }
- [System.Diagnostics.DebuggerNonUserCodeAttribute()]
- private void InitCommandCollection() {
- this._commandCollection = new System.Data.SqlClient.SqlCommand[1];
- this._commandCollection[0] = new System.Data.SqlClient.SqlCommand();
- this._commandCollection[0].Connection = this.Connection;
- this._commandCollection[0].CommandText = "SELECT ID, Name, Levels, Gender, Birthday, Degree, Address, Telephone, Email, Sco" +
- "re FROM dbo.Customer";
- this._commandCollection[0].CommandType = System.Data.CommandType.Text;
- }
- [System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
- [System.ComponentModel.DataObjectMethodAttribute(System.ComponentModel.DataObjectMethodType.Fill, true)]
- public virtual int Fill(BookStoreDataSet.CustomerDataTable dataTable) {
- this.Adapter.SelectCommand = this.CommandCollection[0];
- if ((this.ClearBeforeFill == true)) {
- dataTable.Clear();
- }
- int returnValue = this.Adapter.Fill(dataTable);
- return returnValue;
- }
- [System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
- [System.ComponentModel.DataObjectMethodAttribute(System.ComponentModel.DataObjectMethodType.Select, true)]
- public virtual BookStoreDataSet.CustomerDataTable GetData() {
- this.Adapter.SelectCommand = this.CommandCollection[0];
- BookStoreDataSet.CustomerDataTable dataTable = new BookStoreDataSet.CustomerDataTable();
- this.Adapter.Fill(dataTable);
- return dataTable;
- }
- [System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
- public virtual int Update(BookStoreDataSet.CustomerDataTable dataTable) {
- return this.Adapter.Update(dataTable);
- }
- [System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
- public virtual int Update(BookStoreDataSet dataSet) {
- return this.Adapter.Update(dataSet, "Customer");
- }
- [System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
- public virtual int Update(System.Data.DataRow dataRow) {
- return this.Adapter.Update(new System.Data.DataRow[] {
- dataRow});
- }
- [System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
- public virtual int Update(System.Data.DataRow[] dataRows) {
- return this.Adapter.Update(dataRows);
- }
- [System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
- [System.ComponentModel.DataObjectMethodAttribute(System.ComponentModel.DataObjectMethodType.Delete, true)]
- public virtual int Delete(int Original_ID, string Original_Name, short Original_Levels, System.Nullable<bool> Original_Gender, System.Nullable<System.DateTime> Original_Birthday, string Original_Degree, string Original_Address, string Original_Telephone, string Original_Email, System.Nullable<int> Original_Score) {
- this.Adapter.DeleteCommand.Parameters[0].Value = ((int)(Original_ID));
- if ((Original_Name == null)) {
- throw new System.ArgumentNullException("Original_Name");
- }
- else {
- this.Adapter.DeleteCommand.Parameters[1].Value = ((string)(Original_Name));
- }
- this.Adapter.DeleteCommand.Parameters[2].Value = ((short)(Original_Levels));
- if ((Original_Gender.HasValue == true)) {
- this.Adapter.DeleteCommand.Parameters[3].Value = ((object)(0));
- this.Adapter.DeleteCommand.Parameters[4].Value = ((bool)(Original_Gender.Value));
- }
- else {
- this.Adapter.DeleteCommand.Parameters[3].Value = ((object)(1));
- this.Adapter.DeleteCommand.Parameters[4].Value = System.DBNull.Value;
- }
- if ((Original_Birthday.HasValue == true)) {
- this.Adapter.DeleteCommand.Parameters[5].Value = ((object)(0));
- this.Adapter.DeleteCommand.Parameters[6].Value = ((System.DateTime)(Original_Birthday.Value));
- }
- else {
- this.Adapter.DeleteCommand.Parameters[5].Value = ((object)(1));
- this.Adapter.DeleteCommand.Parameters[6].Value = System.DBNull.Value;
- }
- if ((Original_Degree == null)) {
- this.Adapter.DeleteCommand.Parameters[7].Value = ((object)(1));
- this.Adapter.DeleteCommand.Parameters[8].Value = System.DBNull.Value;
- }
- else {
- this.Adapter.DeleteCommand.Parameters[7].Value = ((object)(0));
- this.Adapter.DeleteCommand.Parameters[8].Value = ((string)(Original_Degree));
- }
- if ((Original_Address == null)) {
- this.Adapter.DeleteCommand.Parameters[9].Value = ((object)(1));
- this.Adapter.DeleteCommand.Parameters[10].Value = System.DBNull.Value;
- }
- else {
- this.Adapter.DeleteCommand.Parameters[9].Value = ((object)(0));
- this.Adapter.DeleteCommand.Parameters[10].Value = ((string)(Original_Address));
- }
- if ((Original_Telephone == null)) {
- this.Adapter.DeleteCommand.Parameters[11].Value = ((object)(1));
- this.Adapter.DeleteCommand.Parameters[12].Value = System.DBNull.Value;
- }
- else {
- this.Adapter.DeleteCommand.Parameters[11].Value = ((object)(0));
- this.Adapter.DeleteCommand.Parameters[12].Value = ((string)(Original_Telephone));
- }
- if ((Original_Email == null)) {
- this.Adapter.DeleteCommand.Parameters[13].Value = ((object)(1));
- this.Adapter.DeleteCommand.Parameters[14].Value = System.DBNull.Value;
- }
- else {
- this.Adapter.DeleteCommand.Parameters[13].Value = ((object)(0));
- this.Adapter.DeleteCommand.Parameters[14].Value = ((string)(Original_Email));
- }
- if ((Original_Score.HasValue == true)) {
- this.Adapter.DeleteCommand.Parameters[15].Value = ((object)(0));
- this.Adapter.DeleteCommand.Parameters[16].Value = ((int)(Original_Score.Value));
- }
- else {
- this.Adapter.DeleteCommand.Parameters[15].Value = ((object)(1));
- this.Adapter.DeleteCommand.Parameters[16].Value = System.DBNull.Value;
- }
- System.Data.ConnectionState previousConnectionState = this.Adapter.DeleteCommand.Connection.State;
- if (((this.Adapter.DeleteCommand.Connection.State & System.Data.ConnectionState.Open)
- != System.Data.ConnectionState.Open)) {
- this.Adapter.DeleteCommand.Connection.Open();
- }
- try {
- int returnValue = this.Adapter.DeleteCommand.ExecuteNonQuery();
- return returnValue;
- }
- finally {
- if ((previousConnectionState == System.Data.ConnectionState.Closed)) {
- this.Adapter.DeleteCommand.Connection.Close();
- }
- }
- }
- [System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
- [System.ComponentModel.DataObjectMethodAttribute(System.ComponentModel.DataObjectMethodType.Insert, true)]
- public virtual int Insert(string Name, short Levels, System.Nullable<bool> Gender, System.Nullable<System.DateTime> Birthday, string Degree, string Address, string Telephone, string Email, System.Nullable<int> Score) {
- if ((Name == null)) {
- throw new System.ArgumentNullException("Name");
- }
- else {
- this.Adapter.InsertCommand.Parameters[0].Value = ((string)(Name));
- }
- this.Adapter.InsertCommand.Parameters[1].Value = ((short)(Levels));
- if ((Gender.HasValue == true)) {
- this.Adapter.InsertCommand.Parameters[2].Value = ((bool)(Gender.Value));
- }
- else {
- this.Adapter.InsertCommand.Parameters[2].Value = System.DBNull.Value;
- }
- if ((Birthday.HasValue == true)) {
- this.Adapter.InsertCommand.Parameters[3].Value = ((System.DateTime)(Birthday.Value));
- }
- else {
- this.Adapter.InsertCommand.Parameters[3].Value = System.DBNull.Value;
- }
- if ((Degree == null)) {
- this.Adapter.InsertCommand.Parameters[4].Value = System.DBNull.Value;
- }
- else {
- this.Adapter.InsertCommand.Parameters[4].Value = ((string)(Degree));
- }
- if ((Address == null)) {
- this.Adapter.InsertCommand.Parameters[5].Value = System.DBNull.Value;
- }
- else {
- this.Adapter.InsertCommand.Parameters[5].Value = ((string)(Address));
- }
- if ((Telephone == null)) {
- this.Adapter.InsertCommand.Parameters[6].Value = System.DBNull.Value;
- }
- else {
- this.Adapter.InsertCommand.Parameters[6].Value = ((string)(Telephone));
- }
- if ((Email == null)) {
- this.Adapter.InsertCommand.Parameters[7].Value = System.DBNull.Value;
- }
- else {
- this.Adapter.InsertCommand.Parameters[7].Value = ((string)(Email));
- }
- if ((Score.HasValue == true)) {
- this.Adapter.InsertCommand.Parameters[8].Value = ((int)(Score.Value));
- }
- else {
- this.Adapter.InsertCommand.Parameters[8].Value = System.DBNull.Value;
- }
- System.Data.ConnectionState previousConnectionState = this.Adapter.InsertCommand.Connection.State;
- if (((this.Adapter.InsertCommand.Connection.State & System.Data.ConnectionState.Open)
- != System.Data.ConnectionState.Open)) {
- this.Adapter.InsertCommand.Connection.Open();
- }
- try {
- int returnValue = this.Adapter.InsertCommand.ExecuteNonQuery();
- return returnValue;
- }
- finally {
- if ((previousConnectionState == System.Data.ConnectionState.Closed)) {
- this.Adapter.InsertCommand.Connection.Close();
- }
- }
- }
- [System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
- [System.ComponentModel.DataObjectMethodAttribute(System.ComponentModel.DataObjectMethodType.Update, true)]
- public virtual int Update(
- string Name,
- short Levels,
- System.Nullable<bool> Gender,
- System.Nullable<System.DateTime> Birthday,
- string Degree,
- string Address,
- string Telephone,
- string Email,
- System.Nullable<int> Score,
- int Original_ID,
- string Original_Name,
- short Original_Levels,
- System.Nullable<bool> Original_Gender,
- System.Nullable<System.DateTime> Original_Birthday,
- string Original_Degree,
- string Original_Address,
- string Original_Telephone,
- string Original_Email,
- System.Nullable<int> Original_Score,
- int ID) {
- if ((Name == null)) {
- throw new System.ArgumentNullException("Name");
- }
- else {
- this.Adapter.UpdateCommand.Parameters[0].Value = ((string)(Name));
- }
- this.Adapter.UpdateCommand.Parameters[1].Value = ((short)(Levels));
- if ((Gender.HasValue == true)) {
- this.Adapter.UpdateCommand.Parameters[2].Value = ((bool)(Gender.Value));
- }
- else {
- this.Adapter.UpdateCommand.Parameters[2].Value = System.DBNull.Value;
- }
- if ((Birthday.HasValue == true)) {
- this.Adapter.UpdateCommand.Parameters[3].Value = ((System.DateTime)(Birthday.Value));
- }
- else {
- this.Adapter.UpdateCommand.Parameters[3].Value = System.DBNull.Value;
- }
- if ((Degree == null)) {
- this.Adapter.UpdateCommand.Parameters[4].Value = System.DBNull.Value;
- }
- else {
- this.Adapter.UpdateCommand.Parameters[4].Value = ((string)(Degree));
- }
- if ((Address == null)) {
- this.Adapter.UpdateCommand.Parameters[5].Value = System.DBNull.Value;
- }
- else {
- this.Adapter.UpdateCommand.Parameters[5].Value = ((string)(Address));
- }
- if ((Telephone == null)) {
- this.Adapter.UpdateCommand.Parameters[6].Value = System.DBNull.Value;
- }
- else {
- this.Adapter.UpdateCommand.Parameters[6].Value = ((string)(Telephone));
- }
- if ((Email == null)) {
- this.Adapter.UpdateCommand.Parameters[7].Value = System.DBNull.Value;
- }
- else {
- this.Adapter.UpdateCommand.Parameters[7].Value = ((string)(Email));
- }
- if ((Score.HasValue == true)) {
- this.Adapter.UpdateCommand.Parameters[8].Value = ((int)(Score.Value));
- }
- else {
- this.Adapter.UpdateCommand.Parameters[8].Value = System.DBNull.Value;
- }
- this.Adapter.UpdateCommand.Parameters[9].Value = ((int)(Original_ID));
- if ((Original_Name == null)) {
- throw new System.ArgumentNullException("Original_Name");
- }
- else {
- this.Adapter.UpdateCommand.Parameters[10].Value = ((string)(Original_Name));
- }
- this.Adapter.UpdateCommand.Parameters[11].Value = ((short)(Original_Levels));
- if ((Original_Gender.HasValue == true)) {
- this.Adapter.UpdateCommand.Parameters[12].Value = ((object)(0));
- this.Adapter.UpdateCommand.Parameters[13].Value = ((bool)(Original_Gender.Value));
- }
- else {
- this.Adapter.UpdateCommand.Parameters[12].Value = ((object)(1));
- this.Adapter.UpdateCommand.Parameters[13].Value = System.DBNull.Value;
- }
- if ((Original_Birthday.HasValue == true)) {
- this.Adapter.UpdateCommand.Parameters[14].Value = ((object)(0));
- this.Adapter.UpdateCommand.Parameters[15].Value = ((System.DateTime)(Original_Birthday.Value));
- }
- else {
- this.Adapter.UpdateCommand.Parameters[14].Value = ((object)(1));
- this.Adapter.UpdateCommand.Parameters[15].Value = System.DBNull.Value;
- }
- if ((Original_Degree == null)) {
- this.Adapter.UpdateCommand.Parameters[16].Value = ((object)(1));
- this.Adapter.UpdateCommand.Parameters[17].Value = System.DBNull.Value;
- }
- else {
- this.Adapter.UpdateCommand.Parameters[16].Value = ((object)(0));
- this.Adapter.UpdateCommand.Parameters[17].Value = ((string)(Original_Degree));
- }
- if ((Original_Address == null)) {
- this.Adapter.UpdateCommand.Parameters[18].Value = ((object)(1));
- this.Adapter.UpdateCommand.Parameters[19].Value = System.DBNull.Value;
- }
- else {
- this.Adapter.UpdateCommand.Parameters[18].Value = ((object)(0));
- this.Adapter.UpdateCommand.Parameters[19].Value = ((string)(Original_Address));
- }
- if ((Original_Telephone == null)) {
- this.Adapter.UpdateCommand.Parameters[20].Value = ((object)(1));
- this.Adapter.UpdateCommand.Parameters[21].Value = System.DBNull.Value;
- }
- else {
- this.Adapter.UpdateCommand.Parameters[20].Value = ((object)(0));
- this.Adapter.UpdateCommand.Parameters[21].Value = ((string)(Original_Telephone));
- }
- if ((Original_Email == null)) {
- this.Adapter.UpdateCommand.Parameters[22].Value = ((object)(1));
- this.Adapter.UpdateCommand.Parameters[23].Value = System.DBNull.Value;
- }
- else {
- this.Adapter.UpdateCommand.Parameters[22].Value = ((object)(0));
- this.Adapter.UpdateCommand.Parameters[23].Value = ((string)(Original_Email));
- }
- if ((Original_Score.HasValue == true)) {
- this.Adapter.UpdateCommand.Parameters[24].Value = ((object)(0));
- this.Adapter.UpdateCommand.Parameters[25].Value = ((int)(Original_Score.Value));
- }
- else {
- this.Adapter.UpdateCommand.Parameters[24].Value = ((object)(1));
- this.Adapter.UpdateCommand.Parameters[25].Value = System.DBNull.Value;
- }
- this.Adapter.UpdateCommand.Parameters[26].Value = ((int)(ID));
- System.Data.ConnectionState previousConnectionState = this.Adapter.UpdateCommand.Connection.State;
- if (((this.Adapter.UpdateCommand.Connection.State & System.Data.ConnectionState.Open)
- != System.Data.ConnectionState.Open)) {
- this.Adapter.UpdateCommand.Connection.Open();
- }
- try {
- int returnValue = this.Adapter.UpdateCommand.ExecuteNonQuery();
- return returnValue;
- }
- finally {
- if ((previousConnectionState == System.Data.ConnectionState.Closed)) {
- this.Adapter.UpdateCommand.Connection.Close();
- }
- }
- }
- }
- [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "2.0.0.0")]
- [System.ComponentModel.DesignerCategoryAttribute("code")]
- [System.ComponentModel.ToolboxItem(true)]
- [System.ComponentModel.DataObjectAttribute(true)]
- [System.ComponentModel.DesignerAttribute("Microsoft.VSDesigner.DataSource.Design.TableAdapterDesigner, Microsoft.VSDesigner" +
- ", Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
- [System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
- public partial class SellTableAdapter : System.ComponentModel.Component {
- private System.Data.SqlClient.SqlDataAdapter _adapter;
- private System.Data.SqlClient.SqlConnection _connection;
- private System.Data.SqlClient.SqlCommand[] _commandCollection;
- private bool _clearBeforeFill;
- [System.Diagnostics.DebuggerNonUserCodeAttribute()]
- public SellTableAdapter() {
- this.ClearBeforeFill = true;
- }
- [System.Diagnostics.DebuggerNonUserCodeAttribute()]
- private System.Data.SqlClient.SqlDataAdapter Adapter {
- get {
- if ((this._adapter == null)) {
- this.InitAdapter();
- }
- return this._adapter;
- }
- }
- [System.Diagnostics.DebuggerNonUserCodeAttribute()]
- internal System.Data.SqlClient.SqlConnection Connection {
- get {
- if ((this._connection == null)) {
- this.InitConnection();
- }
- return this._connection;
- }
- set {
- this._connection = value;
- if ((this.Adapter.InsertCommand != null)) {
- this.Adapter.InsertCommand.Connection = value;
- }
- if ((this.Adapter.DeleteCommand != null)) {
- this.Adapter.DeleteCommand.Connection = value;
- }
- if ((this.Adapter.UpdateCommand != null)) {
- this.Adapter.UpdateCommand.Connection = value;
- }
- for (int i = 0; (i < this.CommandCollection.Length); i = (i + 1)) {
- if ((this.CommandCollection[i] != null)) {
- ((System.Data.SqlClient.SqlCommand)(this.CommandCollection[i])).Connection = value;
- }
- }
- }
- }
- [System.Diagnostics.DebuggerNonUserCodeAttribute()]
- protected System.Data.SqlClient.SqlCommand[] CommandCollection {
- get {
- if ((this._commandCollection == null)) {
- this.InitCommandCollection();
- }
- return this._commandCollection;
- }
- }
- [System.Diagnostics.DebuggerNonUserCodeAttribute()]
- public bool ClearBeforeFill {
- get {
- return this._clearBeforeFill;
- }
- set {
- this._clearBeforeFill = value;
- }
- }
- [System.Diagnostics.DebuggerNonUserCodeAttribute()]
- private void InitAdapter() {
- this._adapter = new System.Data.SqlClient.SqlDataAdapter();
- System.Data.Common.DataTableMapping tableMapping = new System.Data.Common.DataTableMapping();
- tableMapping.SourceTable = "Table";
- tableMapping.DataSetTable = "Sell";
- tableMapping.ColumnMappings.Add("ID", "ID");
- tableMapping.ColumnMappings.Add("CustomerID", "CustomerID");
- tableMapping.ColumnMappings.Add("Sum", "Sum");
- tableMapping.ColumnMappings.Add("Time", "Time");
- this._adapter.TableMappings.Add(tableMapping);
- this._adapter.DeleteCommand = new System.Data.SqlClient.SqlCommand();
- this._adapter.DeleteCommand.Connection = this.Connection;
- this._adapter.DeleteCommand.CommandText = "DELETE FROM [dbo].[Sell] WHERE (([ID] = @Original_ID) AND ((@IsNull_CustomerID = " +
- "1 AND [CustomerID] IS NULL) OR ([CustomerID] = @Original_CustomerID)) AND ([Sum]" +
- " = @Original_Sum) AND ([Time] = @Original_Time))";
- this._adapter.DeleteCommand.CommandType = System.Data.CommandType.Text;
- this._adapter.DeleteCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_ID", System.Data.SqlDbType.Int, 0, System.Data.ParameterDirection.Input, 0, 0, "ID", System.Data.DataRowVersion.Original, false, null, "", "", ""));
- this._adapter.DeleteCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@IsNull_CustomerID", System.Data.SqlDbType.Int, 0, System.Data.ParameterDirection.Input, 0, 0, "CustomerID", System.Data.DataRowVersion.Original, true, null, "", "", ""));
- this._adapter.DeleteCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_CustomerID", System.Data.SqlDbType.Int, 0, System.Data.ParameterDirection.Input, 0, 0, "CustomerID", System.Data.DataRowVersion.Original, false, null, "", "", ""));
- this._adapter.DeleteCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_Sum", System.Data.SqlDbType.SmallMoney, 0, System.Data.ParameterDirection.Input, 0, 0, "Sum", System.Data.DataRowVersion.Original, false, null, "", "", ""));
- this._adapter.DeleteCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_Time", System.Data.SqlDbType.SmallDateTime, 0, System.Data.ParameterDirection.Input, 0, 0, "Time", System.Data.DataRowVersion.Original, false, null, "", "", ""));
- this._adapter.InsertCommand = new System.Data.SqlClient.SqlCommand();
- this._adapter.InsertCommand.Connection = this.Connection;
- this._adapter.InsertCommand.CommandText = "INSERT INTO [dbo].[Sell] ([CustomerID], [Sum], [Time]) VALUES (@CustomerID, @Sum," +
- " @Time);rnSELECT ID, CustomerID, Sum, Time FROM Sell WHERE (ID = SCOPE_IDENTITY(" +
- "))";
- this._adapter.InsertCommand.CommandType = System.Data.CommandType.Text;
- this._adapter.InsertCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@CustomerID", System.Data.SqlDbType.Int, 0, System.Data.ParameterDirection.Input, 0, 0, "CustomerID", System.Data.DataRowVersion.Current, false, null, "", "", ""));
- this._adapter.InsertCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Sum", System.Data.SqlDbType.SmallMoney, 0, System.Data.ParameterDirection.Input, 0, 0, "Sum", System.Data.DataRowVersion.Current, false, null, "", "", ""));
- this._adapter.InsertCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Time", System.Data.SqlDbType.SmallDateTime, 0, System.Data.ParameterDirection.Input, 0, 0, "Time", System.Data.DataRowVersion.Current, false, null, "", "", ""));
- this._adapter.UpdateCommand = new System.Data.SqlClient.SqlCommand();
- this._adapter.UpdateCommand.Connection = this.Connection;
- this._adapter.UpdateCommand.CommandText = @"UPDATE [dbo].[Sell] SET [CustomerID] = @CustomerID, [Sum] = @Sum, [Time] = @Time WHERE (([ID] = @Original_ID) AND ((@IsNull_CustomerID = 1 AND [CustomerID] IS NULL) OR ([CustomerID] = @Original_CustomerID)) AND ([Sum] = @Original_Sum) AND ([Time] = @Original_Time));
- SELECT ID, CustomerID, Sum, Time FROM Sell WHERE (ID = @ID)";
- this._adapter.UpdateCommand.CommandType = System.Data.CommandType.Text;
- this._adapter.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@CustomerID", System.Data.SqlDbType.Int, 0, System.Data.ParameterDirection.Input, 0, 0, "CustomerID", System.Data.DataRowVersion.Current, false, null, "", "", ""));
- this._adapter.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Sum", System.Data.SqlDbType.SmallMoney, 0, System.Data.ParameterDirection.Input, 0, 0, "Sum", System.Data.DataRowVersion.Current, false, null, "", "", ""));
- this._adapter.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Time", System.Data.SqlDbType.SmallDateTime, 0, System.Data.ParameterDirection.Input, 0, 0, "Time", System.Data.DataRowVersion.Current, false, null, "", "", ""));
- this._adapter.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_ID", System.Data.SqlDbType.Int, 0, System.Data.ParameterDirection.Input, 0, 0, "ID", System.Data.DataRowVersion.Original, false, null, "", "", ""));
- this._adapter.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@IsNull_CustomerID", System.Data.SqlDbType.Int, 0, System.Data.ParameterDirection.Input, 0, 0, "CustomerID", System.Data.DataRowVersion.Original, true, null, "", "", ""));
- this._adapter.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_CustomerID", System.Data.SqlDbType.Int, 0, System.Data.ParameterDirection.Input, 0, 0, "CustomerID", System.Data.DataRowVersion.Original, false, null, "", "", ""));
- this._adapter.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_Sum", System.Data.SqlDbType.SmallMoney, 0, System.Data.ParameterDirection.Input, 0, 0, "Sum", System.Data.DataRowVersion.Original, false, null, "", "", ""));
- this._adapter.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_Time", System.Data.SqlDbType.SmallDateTime, 0, System.Data.ParameterDirection.Input, 0, 0, "Time", System.Data.DataRowVersion.Original, false, null, "", "", ""));
- this._adapter.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@ID", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, 0, 0, "ID", System.Data.DataRowVersion.Current, false, null, "", "", ""));
- }
- [System.Diagnostics.DebuggerNonUserCodeAttribute()]
- private void InitConnection() {
- this._connection = new System.Data.SqlClient.SqlConnection();
- this._connection.ConnectionString = global::BookStoreMan.Properties.Settings.Default.BookStoreConnectionString;
- }
- [System.Diagnostics.DebuggerNonUserCodeAttribute()]
- private void InitCommandCollection() {
- this._commandCollection = new System.Data.SqlClient.SqlCommand[1];
- this._commandCollection[0] = new System.Data.SqlClient.SqlCommand();
- this._commandCollection[0].Connection = this.Connection;
- this._commandCollection[0].CommandText = "SELECT ID, CustomerID, Sum, Time FROM dbo.Sell";
- this._commandCollection[0].CommandType = System.Data.CommandType.Text;
- }
- [System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
- [System.ComponentModel.DataObjectMethodAttribute(System.ComponentModel.DataObjectMethodType.Fill, true)]
- public virtual int Fill(BookStoreDataSet.SellDataTable dataTable) {
- this.Adapter.SelectCommand = this.CommandCollection[0];
- if ((this.ClearBeforeFill == true)) {
- dataTable.Clear();
- }
- int returnValue = this.Adapter.Fill(dataTable);
- return returnValue;
- }
- [System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
- [System.ComponentModel.DataObjectMethodAttribute(System.ComponentModel.DataObjectMethodType.Select, true)]
- public virtual BookStoreDataSet.SellDataTable GetData() {
- this.Adapter.SelectCommand = this.CommandCollection[0];
- BookStoreDataSet.SellDataTable dataTable = new BookStoreDataSet.SellDataTable();
- this.Adapter.Fill(dataTable);
- return dataTable;
- }
- [System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
- public virtual int Update(BookStoreDataSet.SellDataTable dataTable) {
- return this.Adapter.Update(dataTable);
- }
- [System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
- public virtual int Update(BookStoreDataSet dataSet) {
- return this.Adapter.Update(dataSet, "Sell");
- }
- [System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
- public virtual int Update(System.Data.DataRow dataRow) {
- return this.Adapter.Update(new System.Data.DataRow[] {
- dataRow});
- }
- [System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
- public virtual int Update(System.Data.DataRow[] dataRows) {
- return this.Adapter.Update(dataRows);
- }
- [System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
- [System.ComponentModel.DataObjectMethodAttribute(System.ComponentModel.DataObjectMethodType.Delete, true)]
- public virtual int Delete(int Original_ID, System.Nullable<int> Original_CustomerID, decimal Original_Sum, System.DateTime Original_Time) {
- this.Adapter.DeleteCommand.Parameters[0].Value = ((int)(Original_ID));
- if ((Original_CustomerID.HasValue == true)) {
- this.Adapter.DeleteCommand.Parameters[1].Value = ((object)(0));
- this.Adapter.DeleteCommand.Parameters[2].Value = ((int)(Original_CustomerID.Value));
- }
- else {
- this.Adapter.DeleteCommand.Parameters[1].Value = ((object)(1));
- this.Adapter.DeleteCommand.Parameters[2].Value = System.DBNull.Value;
- }
- this.Adapter.DeleteCommand.Parameters[3].Value = ((decimal)(Original_Sum));
- this.Adapter.DeleteCommand.Parameters[4].Value = ((System.DateTime)(Original_Time));
- System.Data.ConnectionState previousConnectionState = this.Adapter.DeleteCommand.Connection.State;
- if (((this.Adapter.DeleteCommand.Connection.State & System.Data.ConnectionState.Open)
- != System.Data.ConnectionState.Open)) {
- this.Adapter.DeleteCommand.Connection.Open();
- }
- try {
- int returnValue = this.Adapter.DeleteCommand.ExecuteNonQuery();
- return returnValue;
- }
- finally {
- if ((previousConnectionState == System.Data.ConnectionState.Closed)) {
- this.Adapter.DeleteCommand.Connection.Close();
- }
- }
- }
- [System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
- [System.ComponentModel.DataObjectMethodAttribute(System.ComponentModel.DataObjectMethodType.Insert, true)]
- public virtual int Insert(System.Nullable<int> CustomerID, decimal Sum, System.DateTime Time) {
- if ((CustomerID.HasValue == true)) {
- this.Adapter.InsertCommand.Parameters[0].Value = ((int)(CustomerID.Value));
- }
- else {
- this.Adapter.InsertCommand.Parameters[0].Value = System.DBNull.Value;
- }
- this.Adapter.InsertCommand.Parameters[1].Value = ((decimal)(Sum));
- this.Adapter.InsertCommand.Parameters[2].Value = ((System.DateTime)(Time));
- System.Data.ConnectionState previousConnectionState = this.Adapter.InsertCommand.Connection.State;
- if (((this.Adapter.InsertCommand.Connection.State & System.Data.ConnectionState.Open)
- != System.Data.ConnectionState.Open)) {
- this.Adapter.InsertCommand.Connection.Open();
- }
- try {
- int returnValue = this.Adapter.InsertCommand.ExecuteNonQuery();
- return returnValue;
- }
- finally {
- if ((previousConnectionState == System.Data.ConnectionState.Closed)) {
- this.Adapter.InsertCommand.Connection.Close();
- }
- }
- }
- [System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
- [System.ComponentModel.DataObjectMethodAttribute(System.ComponentModel.DataObjectMethodType.Update, true)]
- public virtual int Update(System.Nullable<int> CustomerID, decimal Sum, System.DateTime Time, int Original_ID, System.Nullable<int> Original_CustomerID, decimal Original_Sum, System.DateTime Original_Time, int ID) {
- if ((CustomerID.HasValue == true)) {
- this.Adapter.UpdateCommand.Parameters[0].Value = ((int)(CustomerID.Value));
- }
- else {
- this.Adapter.UpdateCommand.Parameters[0].Value = System.DBNull.Value;
- }
- this.Adapter.UpdateCommand.Parameters[1].Value = ((decimal)(Sum));
- this.Adapter.UpdateCommand.Parameters[2].Value = ((System.DateTime)(Time));
- this.Adapter.UpdateCommand.Parameters[3].Value = ((int)(Original_ID));
- if ((Original_CustomerID.HasValue == true)) {
- this.Adapter.UpdateCommand.Parameters[4].Value = ((object)(0));
- this.Adapter.UpdateCommand.Parameters[5].Value = ((int)(Original_CustomerID.Value));
- }
- else {
- this.Adapter.UpdateCommand.Parameters[4].Value = ((object)(1));
- this.Adapter.UpdateCommand.Parameters[5].Value = System.DBNull.Value;
- }
- this.Adapter.UpdateCommand.Parameters[6].Value = ((decimal)(Original_Sum));
- this.Adapter.UpdateCommand.Parameters[7].Value = ((System.DateTime)(Original_Time));
- this.Adapter.UpdateCommand.Parameters[8].Value = ((int)(ID));
- System.Data.ConnectionState previousConnectionState = this.Adapter.UpdateCommand.Connection.State;
- if (((this.Adapter.UpdateCommand.Connection.State & System.Data.ConnectionState.Open)
- != System.Data.ConnectionState.Open)) {
- this.Adapter.UpdateCommand.Connection.Open();
- }
- try {
- int returnValue = this.Adapter.UpdateCommand.ExecuteNonQuery();
- return returnValue;
- }
- finally {
- if ((previousConnectionState == System.Data.ConnectionState.Closed)) {
- this.Adapter.UpdateCommand.Connection.Close();
- }
- }
- }
- }
- [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "2.0.0.0")]
- [System.ComponentModel.DesignerCategoryAttribute("code")]
- [System.ComponentModel.ToolboxItem(true)]
- [System.ComponentModel.DataObjectAttribute(true)]
- [System.ComponentModel.DesignerAttribute("Microsoft.VSDesigner.DataSource.Design.TableAdapterDesigner, Microsoft.VSDesigner" +
- ", Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
- [System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
- public partial class SellItemTableAdapter : System.ComponentModel.Component {
- private System.Data.SqlClient.SqlDataAdapter _adapter;
- private System.Data.SqlClient.SqlConnection _connection;
- private System.Data.SqlClient.SqlCommand[] _commandCollection;
- private bool _clearBeforeFill;
- [System.Diagnostics.DebuggerNonUserCodeAttribute()]
- public SellItemTableAdapter() {
- this.ClearBeforeFill = true;
- }
- [System.Diagnostics.DebuggerNonUserCodeAttribute()]
- private System.Data.SqlClient.SqlDataAdapter Adapter {
- get {
- if ((this._adapter == null)) {
- this.InitAdapter();
- }
- return this._adapter;
- }
- }
- [System.Diagnostics.DebuggerNonUserCodeAttribute()]
- internal System.Data.SqlClient.SqlConnection Connection {
- get {
- if ((this._connection == null)) {
- this.InitConnection();
- }
- return this._connection;
- }
- set {
- this._connection = value;
- if ((this.Adapter.InsertCommand != null)) {
- this.Adapter.InsertCommand.Connection = value;
- }
- if ((this.Adapter.DeleteCommand != null)) {
- this.Adapter.DeleteCommand.Connection = value;
- }
- if ((this.Adapter.UpdateCommand != null)) {
- this.Adapter.UpdateCommand.Connection = value;
- }
- for (int i = 0; (i < this.CommandCollection.Length); i = (i + 1)) {
- if ((this.CommandCollection[i] != null)) {
- ((System.Data.SqlClient.SqlCommand)(this.CommandCollection[i])).Connection = value;
- }
- }
- }
- }
- [System.Diagnostics.DebuggerNonUserCodeAttribute()]
- protected System.Data.SqlClient.SqlCommand[] CommandCollection {
- get {
- if ((this._commandCollection == null)) {
- this.InitCommandCollection();
- }
- return this._commandCollection;
- }
- }
- [System.Diagnostics.DebuggerNonUserCodeAttribute()]
- public bool ClearBeforeFill {
- get {
- return this._clearBeforeFill;
- }
- set {
- this._clearBeforeFill = value;
- }
- }
- [System.Diagnostics.DebuggerNonUserCodeAttribute()]
- private void InitAdapter() {
- this._adapter = new System.Data.SqlClient.SqlDataAdapter();
- System.Data.Common.DataTableMapping tableMapping = new System.Data.Common.DataTableMapping();
- tableMapping.SourceTable = "Table";
- tableMapping.DataSetTable = "SellItem";
- tableMapping.ColumnMappings.Add("ID", "ID");
- tableMapping.ColumnMappings.Add("SellID", "SellID");
- tableMapping.ColumnMappings.Add("BookID", "BookID");
- tableMapping.ColumnMappings.Add("Number", "Number");
- tableMapping.ColumnMappings.Add("Discount", "Discount");
- tableMapping.ColumnMappings.Add("Sum", "Sum");
- this._adapter.TableMappings.Add(tableMapping);
- this._adapter.DeleteCommand = new System.Data.SqlClient.SqlCommand();
- this._adapter.DeleteCommand.Connection = this.Connection;
- this._adapter.DeleteCommand.CommandText = @"DELETE FROM [dbo].[SellItem] WHERE (([ID] = @Original_ID) AND ([SellID] = @Original_SellID) AND ([BookID] = @Original_BookID) AND ([Number] = @Original_Number) AND ([Discount] = @Original_Discount) AND ((@IsNull_Sum = 1 AND [Sum] IS NULL) OR ([Sum] = @Original_Sum)))";
- this._adapter.DeleteCommand.CommandType = System.Data.CommandType.Text;
- this._adapter.DeleteCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_ID", System.Data.SqlDbType.Int, 0, System.Data.ParameterDirection.Input, 0, 0, "ID", System.Data.DataRowVersion.Original, false, null, "", "", ""));
- this._adapter.DeleteCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_SellID", System.Data.SqlDbType.Int, 0, System.Data.ParameterDirection.Input, 0, 0, "SellID", System.Data.DataRowVersion.Original, false, null, "", "", ""));
- this._adapter.DeleteCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_BookID", System.Data.SqlDbType.Int, 0, System.Data.ParameterDirection.Input, 0, 0, "BookID", System.Data.DataRowVersion.Original, false, null, "", "", ""));
- this._adapter.DeleteCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_Number", System.Data.SqlDbType.Int, 0, System.Data.ParameterDirection.Input, 0, 0, "Number", System.Data.DataRowVersion.Original, false, null, "", "", ""));
- this._adapter.DeleteCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_Discount", System.Data.SqlDbType.Float, 0, System.Data.ParameterDirection.Input, 0, 0, "Discount", System.Data.DataRowVersion.Original, false, null, "", "", ""));
- this._adapter.DeleteCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@IsNull_Sum", System.Data.SqlDbType.Int, 0, System.Data.ParameterDirection.Input, 0, 0, "Sum", System.Data.DataRowVersion.Original, true, null, "", "", ""));
- this._adapter.DeleteCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_Sum", System.Data.SqlDbType.SmallMoney, 0, System.Data.ParameterDirection.Input, 0, 0, "Sum", System.Data.DataRowVersion.Original, false, null, "", "", ""));
- this._adapter.InsertCommand = new System.Data.SqlClient.SqlCommand();
- this._adapter.InsertCommand.Connection = this.Connection;
- this._adapter.InsertCommand.CommandText = "INSERT INTO [dbo].[SellItem] ([SellID], [BookID], [Number], [Discount], [Sum]) VA" +
- "LUES (@SellID, @BookID, @Number, @Discount, @Sum);rnSELECT ID, SellID, BookID, N" +
- "umber, Discount, Sum FROM SellItem WHERE (ID = SCOPE_IDENTITY())";
- this._adapter.InsertCommand.CommandType = System.Data.CommandType.Text;
- this._adapter.InsertCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@SellID", System.Data.SqlDbType.Int, 0, System.Data.ParameterDirection.Input, 0, 0, "SellID", System.Data.DataRowVersion.Current, false, null, "", "", ""));
- this._adapter.InsertCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@BookID", System.Data.SqlDbType.Int, 0, System.Data.ParameterDirection.Input, 0, 0, "BookID", System.Data.DataRowVersion.Current, false, null, "", "", ""));
- this._adapter.InsertCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Number", System.Data.SqlDbType.Int, 0, System.Data.ParameterDirection.Input, 0, 0, "Number", System.Data.DataRowVersion.Current, false, null, "", "", ""));
- this._adapter.InsertCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Discount", System.Data.SqlDbType.Float, 0, System.Data.ParameterDirection.Input, 0, 0, "Discount", System.Data.DataRowVersion.Current, false, null, "", "", ""));
- this._adapter.InsertCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Sum", System.Data.SqlDbType.SmallMoney, 0, System.Data.ParameterDirection.Input, 0, 0, "Sum", System.Data.DataRowVersion.Current, false, null, "", "", ""));
- this._adapter.UpdateCommand = new System.Data.SqlClient.SqlCommand();
- this._adapter.UpdateCommand.Connection = this.Connection;
- this._adapter.UpdateCommand.CommandText = @"UPDATE [dbo].[SellItem] SET [SellID] = @SellID, [BookID] = @BookID, [Number] = @Number, [Discount] = @Discount, [Sum] = @Sum WHERE (([ID] = @Original_ID) AND ([SellID] = @Original_SellID) AND ([BookID] = @Original_BookID) AND ([Number] = @Original_Number) AND ([Discount] = @Original_Discount) AND ((@IsNull_Sum = 1 AND [Sum] IS NULL) OR ([Sum] = @Original_Sum)));
- SELECT ID, SellID, BookID, Number, Discount, Sum FROM SellItem WHERE (ID = @ID)";
- this._adapter.UpdateCommand.CommandType = System.Data.CommandType.Text;
- this._adapter.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@SellID", System.Data.SqlDbType.Int, 0, System.Data.ParameterDirection.Input, 0, 0, "SellID", System.Data.DataRowVersion.Current, false, null, "", "", ""));
- this._adapter.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@BookID", System.Data.SqlDbType.Int, 0, System.Data.ParameterDirection.Input, 0, 0, "BookID", System.Data.DataRowVersion.Current, false, null, "", "", ""));
- this._adapter.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Number", System.Data.SqlDbType.Int, 0, System.Data.ParameterDirection.Input, 0, 0, "Number", System.Data.DataRowVersion.Current, false, null, "", "", ""));
- this._adapter.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Discount", System.Data.SqlDbType.Float, 0, System.Data.ParameterDirection.Input, 0, 0, "Discount", System.Data.DataRowVersion.Current, false, null, "", "", ""));
- this._adapter.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Sum", System.Data.SqlDbType.SmallMoney, 0, System.Data.ParameterDirection.Input, 0, 0, "Sum", System.Data.DataRowVersion.Current, false, null, "", "", ""));
- this._adapter.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_ID", System.Data.SqlDbType.Int, 0, System.Data.ParameterDirection.Input, 0, 0, "ID", System.Data.DataRowVersion.Original, false, null, "", "", ""));
- this._adapter.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_SellID", System.Data.SqlDbType.Int, 0, System.Data.ParameterDirection.Input, 0, 0, "SellID", System.Data.DataRowVersion.Original, false, null, "", "", ""));
- this._adapter.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_BookID", System.Data.SqlDbType.Int, 0, System.Data.ParameterDirection.Input, 0, 0, "BookID", System.Data.DataRowVersion.Original, false, null, "", "", ""));
- this._adapter.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_Number", System.Data.SqlDbType.Int, 0, System.Data.ParameterDirection.Input, 0, 0, "Number", System.Data.DataRowVersion.Original, false, null, "", "", ""));
- this._adapter.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_Discount", System.Data.SqlDbType.Float, 0, System.Data.ParameterDirection.Input, 0, 0, "Discount", System.Data.DataRowVersion.Original, false, null, "", "", ""));
- this._adapter.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@IsNull_Sum", System.Data.SqlDbType.Int, 0, System.Data.ParameterDirection.Input, 0, 0, "Sum", System.Data.DataRowVersion.Original, true, null, "", "", ""));
- this._adapter.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_Sum", System.Data.SqlDbType.SmallMoney, 0, System.Data.ParameterDirection.Input, 0, 0, "Sum", System.Data.DataRowVersion.Original, false, null, "", "", ""));
- this._adapter.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@ID", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, 0, 0, "ID", System.Data.DataRowVersion.Current, false, null, "", "", ""));
- }
- [System.Diagnostics.DebuggerNonUserCodeAttribute()]
- private void InitConnection() {
- this._connection = new System.Data.SqlClient.SqlConnection();
- this._connection.ConnectionString = global::BookStoreMan.Properties.Settings.Default.BookStoreConnectionString;
- }
- [System.Diagnostics.DebuggerNonUserCodeAttribute()]
- private void InitCommandCollection() {
- this._commandCollection = new System.Data.SqlClient.SqlCommand[1];
- this._commandCollection[0] = new System.Data.SqlClient.SqlCommand();
- this._commandCollection[0].Connection = this.Connection;
- this._commandCollection[0].CommandText = "SELECT ID, SellID, BookID, Number, Discount, Sum FROM dbo.SellItem";
- this._commandCollection[0].CommandType = System.Data.CommandType.Text;
- }
- [System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
- [System.ComponentModel.DataObjectMethodAttribute(System.ComponentModel.DataObjectMethodType.Fill, true)]
- public virtual int Fill(BookStoreDataSet.SellItemDataTable dataTable) {
- this.Adapter.SelectCommand = this.CommandCollection[0];
- if ((this.ClearBeforeFill == true)) {
- dataTable.Clear();
- }
- int returnValue = this.Adapter.Fill(dataTable);
- return returnValue;
- }
- [System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
- [System.ComponentModel.DataObjectMethodAttribute(System.ComponentModel.DataObjectMethodType.Select, true)]
- public virtual BookStoreDataSet.SellItemDataTable GetData() {
- this.Adapter.SelectCommand = this.CommandCollection[0];
- BookStoreDataSet.SellItemDataTable dataTable = new BookStoreDataSet.SellItemDataTable();
- this.Adapter.Fill(dataTable);
- return dataTable;
- }
- [System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
- public virtual int Update(BookStoreDataSet.SellItemDataTable dataTable) {
- return this.Adapter.Update(dataTable);
- }
- [System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
- public virtual int Update(BookStoreDataSet dataSet) {
- return this.Adapter.Update(dataSet, "SellItem");
- }
- [System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
- public virtual int Update(System.Data.DataRow dataRow) {
- return this.Adapter.Update(new System.Data.DataRow[] {
- dataRow});
- }
- [System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
- public virtual int Update(System.Data.DataRow[] dataRows) {
- return this.Adapter.Update(dataRows);
- }
- [System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
- [System.ComponentModel.DataObjectMethodAttribute(System.ComponentModel.DataObjectMethodType.Delete, true)]
- public virtual int Delete(int Original_ID, int Original_SellID, int Original_BookID, int Original_Number, double Original_Discount, System.Nullable<decimal> Original_Sum) {
- this.Adapter.DeleteCommand.Parameters[0].Value = ((int)(Original_ID));
- this.Adapter.DeleteCommand.Parameters[1].Value = ((int)(Original_SellID));
- this.Adapter.DeleteCommand.Parameters[2].Value = ((int)(Original_BookID));
- this.Adapter.DeleteCommand.Parameters[3].Value = ((int)(Original_Number));
- this.Adapter.DeleteCommand.Parameters[4].Value = ((double)(Original_Discount));
- if ((Original_Sum.HasValue == true)) {
- this.Adapter.DeleteCommand.Parameters[5].Value = ((object)(0));
- this.Adapter.DeleteCommand.Parameters[6].Value = ((decimal)(Original_Sum.Value));
- }
- else {
- this.Adapter.DeleteCommand.Parameters[5].Value = ((object)(1));
- this.Adapter.DeleteCommand.Parameters[6].Value = System.DBNull.Value;
- }
- System.Data.ConnectionState previousConnectionState = this.Adapter.DeleteCommand.Connection.State;
- if (((this.Adapter.DeleteCommand.Connection.State & System.Data.ConnectionState.Open)
- != System.Data.ConnectionState.Open)) {
- this.Adapter.DeleteCommand.Connection.Open();
- }
- try {
- int returnValue = this.Adapter.DeleteCommand.ExecuteNonQuery();
- return returnValue;
- }
- finally {
- if ((previousConnectionState == System.Data.ConnectionState.Closed)) {
- this.Adapter.DeleteCommand.Connection.Close();
- }
- }
- }
- [System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
- [System.ComponentModel.DataObjectMethodAttribute(System.ComponentModel.DataObjectMethodType.Insert, true)]
- public virtual int Insert(int SellID, int BookID, int Number, double Discount, System.Nullable<decimal> Sum) {
- this.Adapter.InsertCommand.Parameters[0].Value = ((int)(SellID));
- this.Adapter.InsertCommand.Parameters[1].Value = ((int)(BookID));
- this.Adapter.InsertCommand.Parameters[2].Value = ((int)(Number));
- this.Adapter.InsertCommand.Parameters[3].Value = ((double)(Discount));
- if ((Sum.HasValue == true)) {
- this.Adapter.InsertCommand.Parameters[4].Value = ((decimal)(Sum.Value));
- }
- else {
- this.Adapter.InsertCommand.Parameters[4].Value = System.DBNull.Value;
- }
- System.Data.ConnectionState previousConnectionState = this.Adapter.InsertCommand.Connection.State;
- if (((this.Adapter.InsertCommand.Connection.State & System.Data.ConnectionState.Open)
- != System.Data.ConnectionState.Open)) {
- this.Adapter.InsertCommand.Connection.Open();
- }
- try {
- int returnValue = this.Adapter.InsertCommand.ExecuteNonQuery();
- return returnValue;
- }
- finally {
- if ((previousConnectionState == System.Data.ConnectionState.Closed)) {
- this.Adapter.InsertCommand.Connection.Close();
- }
- }
- }
- [System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
- [System.ComponentModel.DataObjectMethodAttribute(System.ComponentModel.DataObjectMethodType.Update, true)]
- public virtual int Update(int SellID, int BookID, int Number, double Discount, System.Nullable<decimal> Sum, int Original_ID, int Original_SellID, int Original_BookID, int Original_Number, double Original_Discount, System.Nullable<decimal> Original_Sum, int ID) {
- this.Adapter.UpdateCommand.Parameters[0].Value = ((int)(SellID));
- this.Adapter.UpdateCommand.Parameters[1].Value = ((int)(BookID));
- this.Adapter.UpdateCommand.Parameters[2].Value = ((int)(Number));
- this.Adapter.UpdateCommand.Parameters[3].Value = ((double)(Discount));
- if ((Sum.HasValue == true)) {
- this.Adapter.UpdateCommand.Parameters[4].Value = ((decimal)(Sum.Value));
- }
- else {
- this.Adapter.UpdateCommand.Parameters[4].Value = System.DBNull.Value;
- }
- this.Adapter.UpdateCommand.Parameters[5].Value = ((int)(Original_ID));
- this.Adapter.UpdateCommand.Parameters[6].Value = ((int)(Original_SellID));
- this.Adapter.UpdateCommand.Parameters[7].Value = ((int)(Original_BookID));
- this.Adapter.UpdateCommand.Parameters[8].Value = ((int)(Original_Number));
- this.Adapter.UpdateCommand.Parameters[9].Value = ((double)(Original_Discount));
- if ((Original_Sum.HasValue == true)) {
- this.Adapter.UpdateCommand.Parameters[10].Value = ((object)(0));
- this.Adapter.UpdateCommand.Parameters[11].Value = ((decimal)(Original_Sum.Value));
- }
- else {
- this.Adapter.UpdateCommand.Parameters[10].Value = ((object)(1));
- this.Adapter.UpdateCommand.Parameters[11].Value = System.DBNull.Value;
- }
- this.Adapter.UpdateCommand.Parameters[12].Value = ((int)(ID));
- System.Data.ConnectionState previousConnectionState = this.Adapter.UpdateCommand.Connection.State;
- if (((this.Adapter.UpdateCommand.Connection.State & System.Data.ConnectionState.Open)
- != System.Data.ConnectionState.Open)) {
- this.Adapter.UpdateCommand.Connection.Open();
- }
- try {
- int returnValue = this.Adapter.UpdateCommand.ExecuteNonQuery();
- return returnValue;
- }
- finally {
- if ((previousConnectionState == System.Data.ConnectionState.Closed)) {
- this.Adapter.UpdateCommand.Connection.Close();
- }
- }
- }
- }
- [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "2.0.0.0")]
- [System.ComponentModel.DesignerCategoryAttribute("code")]
- [System.ComponentModel.ToolboxItem(true)]
- [System.ComponentModel.DataObjectAttribute(true)]
- [System.ComponentModel.DesignerAttribute("Microsoft.VSDesigner.DataSource.Design.TableAdapterDesigner, Microsoft.VSDesigner" +
- ", Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
- [System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
- public partial class V_BookSellTableAdapter : System.ComponentModel.Component {
- private System.Data.SqlClient.SqlDataAdapter _adapter;
- private System.Data.SqlClient.SqlConnection _connection;
- private System.Data.SqlClient.SqlCommand[] _commandCollection;
- private bool _clearBeforeFill;
- [System.Diagnostics.DebuggerNonUserCodeAttribute()]
- public V_BookSellTableAdapter() {
- this.ClearBeforeFill = true;
- }
- [System.Diagnostics.DebuggerNonUserCodeAttribute()]
- private System.Data.SqlClient.SqlDataAdapter Adapter {
- get {
- if ((this._adapter == null)) {
- this.InitAdapter();
- }
- return this._adapter;
- }
- }
- [System.Diagnostics.DebuggerNonUserCodeAttribute()]
- internal System.Data.SqlClient.SqlConnection Connection {
- get {
- if ((this._connection == null)) {
- this.InitConnection();
- }
- return this._connection;
- }
- set {
- this._connection = value;
- if ((this.Adapter.InsertCommand != null)) {
- this.Adapter.InsertCommand.Connection = value;
- }
- if ((this.Adapter.DeleteCommand != null)) {
- this.Adapter.DeleteCommand.Connection = value;
- }
- if ((this.Adapter.UpdateCommand != null)) {
- this.Adapter.UpdateCommand.Connection = value;
- }
- for (int i = 0; (i < this.CommandCollection.Length); i = (i + 1)) {
- if ((this.CommandCollection[i] != null)) {
- ((System.Data.SqlClient.SqlCommand)(this.CommandCollection[i])).Connection = value;
- }
- }
- }
- }
- [System.Diagnostics.DebuggerNonUserCodeAttribute()]
- protected System.Data.SqlClient.SqlCommand[] CommandCollection {
- get {
- if ((this._commandCollection == null)) {
- this.InitCommandCollection();
- }
- return this._commandCollection;
- }
- }
- [System.Diagnostics.DebuggerNonUserCodeAttribute()]
- public bool ClearBeforeFill {
- get {
- return this._clearBeforeFill;
- }
- set {
- this._clearBeforeFill = value;
- }
- }
- [System.Diagnostics.DebuggerNonUserCodeAttribute()]
- private void InitAdapter() {
- this._adapter = new System.Data.SqlClient.SqlDataAdapter();
- System.Data.Common.DataTableMapping tableMapping = new System.Data.Common.DataTableMapping();
- tableMapping.SourceTable = "Table";
- tableMapping.DataSetTable = "V_BookSell";
- tableMapping.ColumnMappings.Add("ID", "ID");
- tableMapping.ColumnMappings.Add("CustomerID", "CustomerID");
- tableMapping.ColumnMappings.Add("Time", "Time");
- tableMapping.ColumnMappings.Add("ISBN", "ISBN");
- tableMapping.ColumnMappings.Add("Name", "Name");
- tableMapping.ColumnMappings.Add("Press", "Press");
- tableMapping.ColumnMappings.Add("Price", "Price");
- tableMapping.ColumnMappings.Add("Number", "Number");
- tableMapping.ColumnMappings.Add("Discount", "Discount");
- tableMapping.ColumnMappings.Add("Sum", "Sum");
- tableMapping.ColumnMappings.Add("SellID", "SellID");
- this._adapter.TableMappings.Add(tableMapping);
- }
- [System.Diagnostics.DebuggerNonUserCodeAttribute()]
- private void InitConnection() {
- this._connection = new System.Data.SqlClient.SqlConnection();
- this._connection.ConnectionString = global::BookStoreMan.Properties.Settings.Default.BookStoreConnectionString;
- }
- [System.Diagnostics.DebuggerNonUserCodeAttribute()]
- private void InitCommandCollection() {
- this._commandCollection = new System.Data.SqlClient.SqlCommand[1];
- this._commandCollection[0] = new System.Data.SqlClient.SqlCommand();
- this._commandCollection[0].Connection = this.Connection;
- this._commandCollection[0].CommandText = "SELECT ID, SellID, CustomerID, Time, ISBN, Name, Press, Price, Number, Discount, " +
- "Sum FROM dbo.V_BookSell";
- this._commandCollection[0].CommandType = System.Data.CommandType.Text;
- }
- [System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
- [System.ComponentModel.DataObjectMethodAttribute(System.ComponentModel.DataObjectMethodType.Fill, true)]
- public virtual int Fill(BookStoreDataSet.V_BookSellDataTable dataTable) {
- this.Adapter.SelectCommand = this.CommandCollection[0];
- if ((this.ClearBeforeFill == true)) {
- dataTable.Clear();
- }
- int returnValue = this.Adapter.Fill(dataTable);
- return returnValue;
- }
- [System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
- [System.ComponentModel.DataObjectMethodAttribute(System.ComponentModel.DataObjectMethodType.Select, true)]
- public virtual BookStoreDataSet.V_BookSellDataTable GetData() {
- this.Adapter.SelectCommand = this.CommandCollection[0];
- BookStoreDataSet.V_BookSellDataTable dataTable = new BookStoreDataSet.V_BookSellDataTable();
- this.Adapter.Fill(dataTable);
- return dataTable;
- }
- }
- [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "2.0.0.0")]
- [System.ComponentModel.DesignerCategoryAttribute("code")]
- [System.ComponentModel.ToolboxItem(true)]
- [System.ComponentModel.DataObjectAttribute(true)]
- [System.ComponentModel.DesignerAttribute("Microsoft.VSDesigner.DataSource.Design.TableAdapterDesigner, Microsoft.VSDesigner" +
- ", Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
- [System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
- public partial class P_GetSellDetailTableAdapter : System.ComponentModel.Component {
- private System.Data.SqlClient.SqlDataAdapter _adapter;
- private System.Data.SqlClient.SqlConnection _connection;
- private System.Data.SqlClient.SqlCommand[] _commandCollection;
- private bool _clearBeforeFill;
- [System.Diagnostics.DebuggerNonUserCodeAttribute()]
- public P_GetSellDetailTableAdapter() {
- this.ClearBeforeFill = true;
- }
- [System.Diagnostics.DebuggerNonUserCodeAttribute()]
- private System.Data.SqlClient.SqlDataAdapter Adapter {
- get {
- if ((this._adapter == null)) {
- this.InitAdapter();
- }
- return this._adapter;
- }
- }
- [System.Diagnostics.DebuggerNonUserCodeAttribute()]
- internal System.Data.SqlClient.SqlConnection Connection {
- get {
- if ((this._connection == null)) {
- this.InitConnection();
- }
- return this._connection;
- }
- set {
- this._connection = value;
- if ((this.Adapter.InsertCommand != null)) {
- this.Adapter.InsertCommand.Connection = value;
- }
- if ((this.Adapter.DeleteCommand != null)) {
- this.Adapter.DeleteCommand.Connection = value;
- }
- if ((this.Adapter.UpdateCommand != null)) {
- this.Adapter.UpdateCommand.Connection = value;
- }
- for (int i = 0; (i < this.CommandCollection.Length); i = (i + 1)) {
- if ((this.CommandCollection[i] != null)) {
- ((System.Data.SqlClient.SqlCommand)(this.CommandCollection[i])).Connection = value;
- }
- }
- }
- }
- [System.Diagnostics.DebuggerNonUserCodeAttribute()]
- protected System.Data.SqlClient.SqlCommand[] CommandCollection {
- get {
- if ((this._commandCollection == null)) {
- this.InitCommandCollection();
- }
- return this._commandCollection;
- }
- }
- [System.Diagnostics.DebuggerNonUserCodeAttribute()]
- public bool ClearBeforeFill {
- get {
- return this._clearBeforeFill;
- }
- set {
- this._clearBeforeFill = value;
- }
- }
- [System.Diagnostics.DebuggerNonUserCodeAttribute()]
- private void InitAdapter() {
- this._adapter = new System.Data.SqlClient.SqlDataAdapter();
- System.Data.Common.DataTableMapping tableMapping = new System.Data.Common.DataTableMapping();
- tableMapping.SourceTable = "Table";
- tableMapping.DataSetTable = "P_GetSellDetail";
- tableMapping.ColumnMappings.Add("BookID", "BookID");
- tableMapping.ColumnMappings.Add("ISBN", "ISBN");
- tableMapping.ColumnMappings.Add("Name", "Name");
- tableMapping.ColumnMappings.Add("Price", "Price");
- tableMapping.ColumnMappings.Add("Number", "Number");
- tableMapping.ColumnMappings.Add("Discount", "Discount");
- tableMapping.ColumnMappings.Add("Sum", "Sum");
- this._adapter.TableMappings.Add(tableMapping);
- }
- [System.Diagnostics.DebuggerNonUserCodeAttribute()]
- private void InitConnection() {
- this._connection = new System.Data.SqlClient.SqlConnection();
- this._connection.ConnectionString = global::BookStoreMan.Properties.Settings.Default.BookStoreConnectionString;
- }
- [System.Diagnostics.DebuggerNonUserCodeAttribute()]
- private void InitCommandCollection() {
- this._commandCollection = new System.Data.SqlClient.SqlCommand[1];
- this._commandCollection[0] = new System.Data.SqlClient.SqlCommand();
- this._commandCollection[0].Connection = this.Connection;
- this._commandCollection[0].CommandText = "dbo.P_GetSellDetail";
- this._commandCollection[0].CommandType = System.Data.CommandType.StoredProcedure;
- this._commandCollection[0].Parameters.Add(new System.Data.SqlClient.SqlParameter("@RETURN_VALUE", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.ReturnValue, 10, 0, null, System.Data.DataRowVersion.Current, false, null, "", "", ""));
- this._commandCollection[0].Parameters.Add(new System.Data.SqlClient.SqlParameter("@SellID", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, 10, 0, null, System.Data.DataRowVersion.Current, false, null, "", "", ""));
- }
- [System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
- [System.ComponentModel.DataObjectMethodAttribute(System.ComponentModel.DataObjectMethodType.Fill, true)]
- public virtual int Fill(BookStoreDataSet.P_GetSellDetailDataTable dataTable, System.Nullable<int> SellID) {
- this.Adapter.SelectCommand = this.CommandCollection[0];
- if ((SellID.HasValue == true)) {
- this.Adapter.SelectCommand.Parameters[1].Value = ((int)(SellID.Value));
- }
- else {
- this.Adapter.SelectCommand.Parameters[1].Value = System.DBNull.Value;
- }
- if ((this.ClearBeforeFill == true)) {
- dataTable.Clear();
- }
- int returnValue = this.Adapter.Fill(dataTable);
- return returnValue;
- }
- [System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
- [System.ComponentModel.DataObjectMethodAttribute(System.ComponentModel.DataObjectMethodType.Select, true)]
- public virtual BookStoreDataSet.P_GetSellDetailDataTable GetData(System.Nullable<int> SellID) {
- this.Adapter.SelectCommand = this.CommandCollection[0];
- if ((SellID.HasValue == true)) {
- this.Adapter.SelectCommand.Parameters[1].Value = ((int)(SellID.Value));
- }
- else {
- this.Adapter.SelectCommand.Parameters[1].Value = System.DBNull.Value;
- }
- BookStoreDataSet.P_GetSellDetailDataTable dataTable = new BookStoreDataSet.P_GetSellDetailDataTable();
- this.Adapter.Fill(dataTable);
- return dataTable;
- }
- }
- }
- #pragma warning restore 1591