public BanksList() { // // Required for Windows Form Designer support // InitializeComponent(); App.SetDataGridTableStyle(this.dataGridTableStyle1); // this.bllBank = new BPS.BLL.Bank.coBanks(); // this.bllCity = new BPS.BLL.City.coCities(); // this.bllBank.Fill(); // this.bllCity.Fill(); this.bllBank = App.bllBank; this.bllCity = App.bllCity; this.dvCities.Table = this.bllCity.DataSet.Cities; this.dsBanks1 = this.bllBank.DataSet; this.dvBanks.Table = this.dsBanks1.Banks; // this.dataGrid1.DataSource = this.dvBanks; }
/// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { System.Configuration.AppSettingsReader configurationAppSettings = new System.Configuration.AppSettingsReader(); this.sqldaBanks = new System.Data.SqlClient.SqlDataAdapter(); this.sqlDeleteCommand1 = new System.Data.SqlClient.SqlCommand(); this.sqlConnection1 = new System.Data.SqlClient.SqlConnection(); this.sqlInsertCommand1 = new System.Data.SqlClient.SqlCommand(); this.sqlSelectCommand1 = new System.Data.SqlClient.SqlCommand(); this.sqlUpdateCommand1 = new System.Data.SqlClient.SqlCommand(); this.dsBanks1 = new BPS.BLL.Bank.DataSets.dsBanks(); ((System.ComponentModel.ISupportInitialize)(this.dsBanks1)).BeginInit(); // // sqldaBanks // this.sqldaBanks.DeleteCommand = this.sqlDeleteCommand1; this.sqldaBanks.InsertCommand = this.sqlInsertCommand1; this.sqldaBanks.SelectCommand = this.sqlSelectCommand1; this.sqldaBanks.TableMappings.AddRange(new System.Data.Common.DataTableMapping[] { new System.Data.Common.DataTableMapping("Table", "Banks", new System.Data.Common.DataColumnMapping[] { new System.Data.Common.DataColumnMapping("BankID", "BankID"), new System.Data.Common.DataColumnMapping("BankName", "BankName"), new System.Data.Common.DataColumnMapping("CityID", "CityID"), new System.Data.Common.DataColumnMapping("CodeBIK", "CodeBIK"), new System.Data.Common.DataColumnMapping("KAccount", "KAccount") }) }); this.sqldaBanks.UpdateCommand = this.sqlUpdateCommand1; this.sqldaBanks.RowUpdated += new System.Data.SqlClient.SqlRowUpdatedEventHandler(this.sqldaBanks_RowUpdated); // // sqlDeleteCommand1 // this.sqlDeleteCommand1.CommandText = "DELETE FROM Banks WHERE (BankID = @Original_BankID)"; this.sqlDeleteCommand1.Connection = this.sqlConnection1; this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_BankID", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "BankID", System.Data.DataRowVersion.Original, null)); // // sqlConnection1 // this.sqlConnection1.ConnectionString = ((string)(configurationAppSettings.GetValue("ConnectionString", typeof(string)))); // // sqlInsertCommand1 // this.sqlInsertCommand1.CommandText = "INSERT INTO Banks(BankName, CityID, CodeBIK, KAccount) VALUES (@BankName, @CityID" + ", @CodeBIK, @KAccount); SELECT BankID, BankName, CityID, CodeBIK, KAccount FROM " + "Banks WHERE (BankID = @@IDENTITY)"; this.sqlInsertCommand1.Connection = this.sqlConnection1; this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@BankName", System.Data.SqlDbType.NVarChar, 128, "BankName")); this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@CityID", System.Data.SqlDbType.Int, 4, "CityID")); this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@CodeBIK", System.Data.SqlDbType.NVarChar, 50, "CodeBIK")); this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@KAccount", System.Data.SqlDbType.NVarChar, 50, "KAccount")); // // sqlSelectCommand1 // this.sqlSelectCommand1.CommandText = "SELECT Banks.BankID, Banks.BankName, Banks.CityID, Banks.CodeBIK, Banks.KAccount," + " Cities.CityName FROM Banks LEFT OUTER JOIN Cities ON Banks.CityID = Cities.City" + "ID ORDER BY Banks.BankName"; this.sqlSelectCommand1.Connection = this.sqlConnection1; // // sqlUpdateCommand1 // this.sqlUpdateCommand1.CommandText = @"UPDATE Banks SET BankName = @BankName, CityID = @CityID, CodeBIK = @CodeBIK, KAccount = @KAccount WHERE (BankID = @Original_BankID) AND (BankName = @Original_BankName) AND (CityID = @Original_CityID) AND (CodeBIK = @Original_CodeBIK) AND (KAccount = @Original_KAccount); SELECT BankID, BankName, CityID, CodeBIK, KAccount FROM Banks WHERE (BankID = @BankID)"; this.sqlUpdateCommand1.Connection = this.sqlConnection1; this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@BankName", System.Data.SqlDbType.NVarChar, 128, "BankName")); this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@CityID", System.Data.SqlDbType.Int, 4, "CityID")); this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@CodeBIK", System.Data.SqlDbType.NVarChar, 50, "CodeBIK")); this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@KAccount", System.Data.SqlDbType.NVarChar, 50, "KAccount")); this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_BankID", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "BankID", System.Data.DataRowVersion.Original, null)); this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_BankName", System.Data.SqlDbType.NVarChar, 128, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "BankName", System.Data.DataRowVersion.Original, null)); this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_CityID", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "CityID", System.Data.DataRowVersion.Original, null)); this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_CodeBIK", System.Data.SqlDbType.NVarChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "CodeBIK", System.Data.DataRowVersion.Original, null)); this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_KAccount", System.Data.SqlDbType.NVarChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "KAccount", System.Data.DataRowVersion.Original, null)); this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@BankID", System.Data.SqlDbType.Int, 4, "BankID")); // // dsBanks1 // this.dsBanks1.DataSetName = "dsBanks"; this.dsBanks1.Locale = new System.Globalization.CultureInfo("ru-RU"); ((System.ComponentModel.ISupportInitialize)(this.dsBanks1)).EndInit(); }
/// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.components = new System.ComponentModel.Container(); System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(BanksList)); this.toolBar1 = new System.Windows.Forms.ToolBar(); this.toolBarButton1 = new System.Windows.Forms.ToolBarButton(); this.toolBarButton2 = new System.Windows.Forms.ToolBarButton(); this.toolBarButton4 = new System.Windows.Forms.ToolBarButton(); this.toolBarButton3 = new System.Windows.Forms.ToolBarButton(); this.toolBarButton5 = new System.Windows.Forms.ToolBarButton(); this.toolBarButton8 = new System.Windows.Forms.ToolBarButton(); this.toolBarButton6 = new System.Windows.Forms.ToolBarButton(); this.toolBarButton7 = new System.Windows.Forms.ToolBarButton(); this.toolBarButton9 = new System.Windows.Forms.ToolBarButton(); this.imlToolBar = new System.Windows.Forms.ImageList(this.components); this.panel1 = new System.Windows.Forms.Panel(); this.groupBox1 = new System.Windows.Forms.GroupBox(); this.label2 = new System.Windows.Forms.Label(); this.label1 = new System.Windows.Forms.Label(); this.tbCity = new System.Windows.Forms.TextBox(); this.tbName = new System.Windows.Forms.TextBox(); this.dataGrid1 = new AM_Controls.DataGridV(); this.contextMenu1 = new System.Windows.Forms.ContextMenu(); this.dvBanks = new System.Data.DataView(); this.dsBanks1 = new BPS.BLL.Bank.DataSets.dsBanks(); this.dataGridTableStyle1 = new System.Windows.Forms.DataGridTableStyle(); this.dataGridTextBoxColumn1 = new System.Windows.Forms.DataGridTextBoxColumn(); this.dataGridTextBoxColumn2 = new System.Windows.Forms.DataGridTextBoxColumn(); this.dataGridTextBoxColumn3 = new System.Windows.Forms.DataGridTextBoxColumn(); this.dataGridTextBoxColumn4 = new System.Windows.Forms.DataGridTextBoxColumn(); this.dataGridTextBoxColumn5 = new System.Windows.Forms.DataGridTextBoxColumn(); this.mainMenu1 = new System.Windows.Forms.MainMenu(); this.mnuEdit = new System.Windows.Forms.MenuItem(); this.menuItem1 = new System.Windows.Forms.MenuItem(); this.menuItem2 = new System.Windows.Forms.MenuItem(); this.menuItem3 = new System.Windows.Forms.MenuItem(); this.menuItem4 = new System.Windows.Forms.MenuItem(); this.menuItem5 = new System.Windows.Forms.MenuItem(); this.menuItem6 = new System.Windows.Forms.MenuItem(); this.menuItem7 = new System.Windows.Forms.MenuItem(); this.menuItem8 = new System.Windows.Forms.MenuItem(); this.menuItem9 = new System.Windows.Forms.MenuItem(); this.dvCities = new System.Data.DataView(); this.panel1.SuspendLayout(); this.groupBox1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.dvBanks)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.dsBanks1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.dvCities)).BeginInit(); this.SuspendLayout(); // // toolBar1 // this.toolBar1.Appearance = System.Windows.Forms.ToolBarAppearance.Flat; this.toolBar1.Buttons.AddRange(new System.Windows.Forms.ToolBarButton[] { this.toolBarButton1, this.toolBarButton2, this.toolBarButton4, this.toolBarButton3, this.toolBarButton5, this.toolBarButton8, this.toolBarButton6, this.toolBarButton7, this.toolBarButton9 }); this.toolBar1.ButtonSize = new System.Drawing.Size(100, 22); this.toolBar1.DropDownArrows = true; this.toolBar1.ImageList = this.imlToolBar; this.toolBar1.Location = new System.Drawing.Point(0, 0); this.toolBar1.Name = "toolBar1"; this.toolBar1.ShowToolTips = true; this.toolBar1.Size = new System.Drawing.Size(598, 28); this.toolBar1.TabIndex = 0; this.toolBar1.TextAlign = System.Windows.Forms.ToolBarTextAlign.Right; this.toolBar1.ButtonClick += new System.Windows.Forms.ToolBarButtonClickEventHandler(this.toolBar1_ButtonClick); // // toolBarButton1 // this.toolBarButton1.ImageIndex = 0; this.toolBarButton1.Text = "Новый"; // // toolBarButton2 // this.toolBarButton2.ImageIndex = 1; this.toolBarButton2.Text = "Открыть"; // // toolBarButton4 // this.toolBarButton4.ImageIndex = 2; this.toolBarButton4.Text = "Удалить"; // // toolBarButton3 // this.toolBarButton3.Style = System.Windows.Forms.ToolBarButtonStyle.Separator; // // toolBarButton5 // this.toolBarButton5.ImageIndex = 6; this.toolBarButton5.Text = "Обновить"; // // toolBarButton8 // this.toolBarButton8.Style = System.Windows.Forms.ToolBarButtonStyle.Separator; // // toolBarButton6 // this.toolBarButton6.ImageIndex = 4; this.toolBarButton6.Text = "Выбрать"; // // toolBarButton7 // this.toolBarButton7.ImageIndex = 5; this.toolBarButton7.Text = "Сбросить"; // // toolBarButton9 // this.toolBarButton9.ImageIndex = 9; this.toolBarButton9.Text = "Очистить"; // // imlToolBar // this.imlToolBar.ImageSize = new System.Drawing.Size(16, 16); this.imlToolBar.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imlToolBar.ImageStream"))); this.imlToolBar.TransparentColor = System.Drawing.Color.Transparent; // // panel1 // this.panel1.Controls.Add(this.groupBox1); this.panel1.Controls.Add(this.toolBar1); this.panel1.Dock = System.Windows.Forms.DockStyle.Top; this.panel1.Location = new System.Drawing.Point(0, 0); this.panel1.Name = "panel1"; this.panel1.Size = new System.Drawing.Size(598, 70); this.panel1.TabIndex = 2; // // groupBox1 // this.groupBox1.Controls.Add(this.label2); this.groupBox1.Controls.Add(this.label1); this.groupBox1.Controls.Add(this.tbCity); this.groupBox1.Controls.Add(this.tbName); this.groupBox1.Dock = System.Windows.Forms.DockStyle.Fill; this.groupBox1.Location = new System.Drawing.Point(0, 28); this.groupBox1.Name = "groupBox1"; this.groupBox1.Size = new System.Drawing.Size(598, 42); this.groupBox1.TabIndex = 1; this.groupBox1.TabStop = false; this.groupBox1.Text = "Фильтр"; // // label2 // this.label2.Location = new System.Drawing.Point(230, 14); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(46, 23); this.label2.TabIndex = 11; this.label2.Text = "Город:"; this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // label1 // this.label1.Location = new System.Drawing.Point(14, 14); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(62, 23); this.label1.TabIndex = 10; this.label1.Text = "Название:"; this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // tbCity // this.tbCity.Location = new System.Drawing.Point(276, 16); this.tbCity.Name = "tbCity"; this.tbCity.Size = new System.Drawing.Size(136, 21); this.tbCity.TabIndex = 1; this.tbCity.Text = ""; // // tbName // this.tbName.Location = new System.Drawing.Point(80, 16); this.tbName.Name = "tbName"; this.tbName.Size = new System.Drawing.Size(118, 21); this.tbName.TabIndex = 0; this.tbName.Text = ""; // // dataGrid1 // this.dataGrid1._CanEdit = false; this.dataGrid1._InvisibleColumn = 0; this.dataGrid1.CaptionVisible = false; this.dataGrid1.ContextMenu = this.contextMenu1; this.dataGrid1.DataMember = ""; this.dataGrid1.DataSource = this.dvBanks; this.dataGrid1.Dock = System.Windows.Forms.DockStyle.Fill; this.dataGrid1.HeaderForeColor = System.Drawing.SystemColors.ControlText; this.dataGrid1.Location = new System.Drawing.Point(0, 70); this.dataGrid1.Name = "dataGrid1"; this.dataGrid1.ReadOnly = true; this.dataGrid1.Size = new System.Drawing.Size(598, 335); this.dataGrid1.TabIndex = 2; this.dataGrid1.TableStyles.AddRange(new System.Windows.Forms.DataGridTableStyle[] { this.dataGridTableStyle1 }); this.dataGrid1.DoubleClick += new System.EventHandler(this.dataGrid1_DoubleClick); // // dvBanks // this.dvBanks.Table = this.dsBanks1.Banks; // // dsBanks1 // this.dsBanks1.DataSetName = "dsBanks"; this.dsBanks1.Locale = new System.Globalization.CultureInfo("ru-RU"); // // dataGridTableStyle1 // this.dataGridTableStyle1.DataGrid = this.dataGrid1; this.dataGridTableStyle1.GridColumnStyles.AddRange(new System.Windows.Forms.DataGridColumnStyle[] { this.dataGridTextBoxColumn1, this.dataGridTextBoxColumn2, this.dataGridTextBoxColumn3, this.dataGridTextBoxColumn4, this.dataGridTextBoxColumn5 }); this.dataGridTableStyle1.HeaderForeColor = System.Drawing.SystemColors.ControlText; this.dataGridTableStyle1.MappingName = "Banks"; // // dataGridTextBoxColumn1 // this.dataGridTextBoxColumn1.Alignment = System.Windows.Forms.HorizontalAlignment.Right; this.dataGridTextBoxColumn1.Format = ""; this.dataGridTextBoxColumn1.FormatInfo = null; this.dataGridTextBoxColumn1.MappingName = "BankID"; this.dataGridTextBoxColumn1.NullText = ""; this.dataGridTextBoxColumn1.Width = 30; // // dataGridTextBoxColumn2 // this.dataGridTextBoxColumn2.Format = ""; this.dataGridTextBoxColumn2.FormatInfo = null; this.dataGridTextBoxColumn2.HeaderText = "Название"; this.dataGridTextBoxColumn2.MappingName = "BankName"; this.dataGridTextBoxColumn2.NullText = ""; this.dataGridTextBoxColumn2.Width = 150; // // dataGridTextBoxColumn3 // this.dataGridTextBoxColumn3.Format = ""; this.dataGridTextBoxColumn3.FormatInfo = null; this.dataGridTextBoxColumn3.HeaderText = "Город"; this.dataGridTextBoxColumn3.MappingName = "CityName"; this.dataGridTextBoxColumn3.NullText = ""; this.dataGridTextBoxColumn3.Width = 110; // // dataGridTextBoxColumn4 // this.dataGridTextBoxColumn4.Format = ""; this.dataGridTextBoxColumn4.FormatInfo = null; this.dataGridTextBoxColumn4.HeaderText = "БИК"; this.dataGridTextBoxColumn4.MappingName = "CodeBIK"; this.dataGridTextBoxColumn4.NullText = ""; this.dataGridTextBoxColumn4.Width = 101; // // dataGridTextBoxColumn5 // this.dataGridTextBoxColumn5.Format = ""; this.dataGridTextBoxColumn5.FormatInfo = null; this.dataGridTextBoxColumn5.HeaderText = "Кор. счёт"; this.dataGridTextBoxColumn5.MappingName = "KAccount"; this.dataGridTextBoxColumn5.NullText = ""; this.dataGridTextBoxColumn5.Width = 150; // // mainMenu1 // this.mainMenu1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { this.mnuEdit }); // // mnuEdit // this.mnuEdit.Index = 0; this.mnuEdit.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { this.menuItem1, this.menuItem2, this.menuItem3, this.menuItem4, this.menuItem5, this.menuItem6, this.menuItem7, this.menuItem8, this.menuItem9 }); this.mnuEdit.Text = "Редактирование"; // // menuItem1 // this.menuItem1.Index = 0; this.menuItem1.Shortcut = System.Windows.Forms.Shortcut.F3; this.menuItem1.Text = "Новый"; this.menuItem1.Click += new System.EventHandler(this.menuItem1_Click); // // menuItem2 // this.menuItem2.Index = 1; this.menuItem2.Shortcut = System.Windows.Forms.Shortcut.F10; this.menuItem2.Text = "Изменить"; this.menuItem2.Click += new System.EventHandler(this.menuItem2_Click); // // menuItem3 // this.menuItem3.Index = 2; this.menuItem3.Shortcut = System.Windows.Forms.Shortcut.CtrlDel; this.menuItem3.Text = "Удалить"; this.menuItem3.Click += new System.EventHandler(this.menuItem3_Click); // // menuItem4 // this.menuItem4.Index = 3; this.menuItem4.Text = "-"; // // menuItem5 // this.menuItem5.Index = 4; this.menuItem5.Shortcut = System.Windows.Forms.Shortcut.F5; this.menuItem5.Text = "Обновить"; this.menuItem5.Click += new System.EventHandler(this.menuItem5_Click); // // menuItem6 // this.menuItem6.Index = 5; this.menuItem6.Text = "-"; // // menuItem7 // this.menuItem7.Index = 6; this.menuItem7.Text = "Выбрать"; this.menuItem7.Click += new System.EventHandler(this.menuItem7_Click); // // menuItem8 // this.menuItem8.Index = 7; this.menuItem8.Text = "Сбросить"; this.menuItem8.Click += new System.EventHandler(this.menuItem8_Click); // // menuItem9 // this.menuItem9.Index = 8; this.menuItem9.Text = "Очистить"; this.menuItem9.Click += new System.EventHandler(this.menuItem9_Click); // // BanksList // this.AutoScaleBaseSize = new System.Drawing.Size(5, 14); this.ClientSize = new System.Drawing.Size(598, 405); this.Controls.Add(this.dataGrid1); this.Controls.Add(this.panel1); this.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.Menu = this.mainMenu1; this.Name = "BanksList"; this.Text = "Банки"; this.WindowState = System.Windows.Forms.FormWindowState.Maximized; this.Load += new System.EventHandler(this.BanksList_Load); this.panel1.ResumeLayout(false); this.groupBox1.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.dvBanks)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.dsBanks1)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.dvCities)).EndInit(); this.ResumeLayout(false); }