public EditBank(BPS.BLL.Bank.DataSets.dsBanks.BanksRow rw, BPS.BLL.City.coCities bll) { drowBank = rw; // // Required for Windows Form Designer support // InitializeComponent(); bllCity = bll; this.dsCities1 = bllCity.DataSet; this.dvCities.Table = this.dsCities1.Cities; this.dvCities.Sort = "CityName"; }
/// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(EditBank)); this.tbName = new System.Windows.Forms.TextBox(); this.bnOK = new System.Windows.Forms.Button(); this.bnCancel = new System.Windows.Forms.Button(); this.cmbCity = new System.Windows.Forms.ComboBox(); this.dvCities = new System.Data.DataView(); this.dsCities1 = new BPS.BLL.City.DataSets.dsCities(); this.tbBIK = new AM_Controls.TextBoxBIK(); this.tbKAccount = new AM_Controls.TextBoxV(); this.label1 = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Label(); this.label3 = new System.Windows.Forms.Label(); this.label4 = new System.Windows.Forms.Label(); this.button1 = new System.Windows.Forms.Button(); ((System.ComponentModel.ISupportInitialize)(this.dvCities)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.dsCities1)).BeginInit(); this.SuspendLayout(); // // tbName // this.tbName.Location = new System.Drawing.Point(90, 2); this.tbName.MaxLength = 128; this.tbName.Name = "tbName"; this.tbName.Size = new System.Drawing.Size(194, 21); this.tbName.TabIndex = 1; this.tbName.Text = ""; // // bnOK // this.bnOK.Font = new System.Drawing.Font("Tahoma", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); this.bnOK.Location = new System.Drawing.Point(122, 108); this.bnOK.Name = "bnOK"; this.bnOK.Size = new System.Drawing.Size(80, 26); this.bnOK.TabIndex = 9; this.bnOK.Text = "Сохранить"; this.bnOK.Click += new System.EventHandler(this.bnOK_Click); // // bnCancel // this.bnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; this.bnCancel.Font = new System.Drawing.Font("Tahoma", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); this.bnCancel.Location = new System.Drawing.Point(204, 108); this.bnCancel.Name = "bnCancel"; this.bnCancel.Size = new System.Drawing.Size(80, 26); this.bnCancel.TabIndex = 10; this.bnCancel.Text = "Отменить"; this.bnCancel.Click += new System.EventHandler(this.bnCancel_Click); // // cmbCity // this.cmbCity.DataSource = this.dvCities; this.cmbCity.DisplayMember = "CityName"; this.cmbCity.Location = new System.Drawing.Point(90, 24); this.cmbCity.MaxDropDownItems = 20; this.cmbCity.Name = "cmbCity"; this.cmbCity.Size = new System.Drawing.Size(168, 21); this.cmbCity.TabIndex = 3; this.cmbCity.ValueMember = "CityID"; this.cmbCity.Leave += new System.EventHandler(this.cmbCity_Leave); // // dvCities // this.dvCities.Sort = "CityName"; this.dvCities.Table = this.dsCities1.Cities; // // dsCities1 // this.dsCities1.DataSetName = "dsCities"; this.dsCities1.Locale = new System.Globalization.CultureInfo("ru-RU"); // // tbBIK // this.tbBIK.AllowDrop = true; this.tbBIK.dValue = 0; this.tbBIK.IsPcnt = false; this.tbBIK.Location = new System.Drawing.Point(90, 46); this.tbBIK.MaxDecPos = 0; this.tbBIK.MaxLength = 9; this.tbBIK.MaxPos = 9; this.tbBIK.Name = "tbBIK"; this.tbBIK.Negative = System.Drawing.Color.Empty; this.tbBIK.nValue = ((long)(0)); this.tbBIK.Positive = System.Drawing.Color.Empty; this.tbBIK.Size = new System.Drawing.Size(194, 21); this.tbBIK.TabIndex = 6; this.tbBIK.Text = ""; this.tbBIK.TextMode = true; this.tbBIK.Zero = System.Drawing.Color.Empty; // // tbKAccount // this.tbKAccount.AllowDrop = true; this.tbKAccount.dValue = 0; this.tbKAccount.IsPcnt = false; this.tbKAccount.Location = new System.Drawing.Point(90, 68); this.tbKAccount.MaxDecPos = 0; this.tbKAccount.MaxLength = 20; this.tbKAccount.MaxPos = 20; this.tbKAccount.Name = "tbKAccount"; this.tbKAccount.Negative = System.Drawing.Color.Empty; this.tbKAccount.nValue = ((long)(0)); this.tbKAccount.Positive = System.Drawing.Color.Empty; this.tbKAccount.Size = new System.Drawing.Size(194, 21); this.tbKAccount.TabIndex = 8; this.tbKAccount.Text = ""; this.tbKAccount.TextMode = true; this.tbKAccount.Zero = System.Drawing.Color.Empty; // // label1 // this.label1.Location = new System.Drawing.Point(6, 0); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(84, 23); this.label1.TabIndex = 0; this.label1.Text = "Наименование:"; this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // label2 // this.label2.Location = new System.Drawing.Point(6, 22); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(40, 23); this.label2.TabIndex = 2; this.label2.Text = "Город:"; this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // label3 // this.label3.Location = new System.Drawing.Point(6, 44); this.label3.Name = "label3"; this.label3.Size = new System.Drawing.Size(40, 23); this.label3.TabIndex = 5; this.label3.Text = "БИК:"; this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // label4 // this.label4.Location = new System.Drawing.Point(6, 68); this.label4.Name = "label4"; this.label4.Size = new System.Drawing.Size(64, 23); this.label4.TabIndex = 7; this.label4.Text = "Кор. счёт:"; this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // button1 // this.button1.FlatStyle = System.Windows.Forms.FlatStyle.Popup; this.button1.Image = ((System.Drawing.Image)(resources.GetObject("button1.Image"))); this.button1.Location = new System.Drawing.Point(260, 24); this.button1.Name = "button1"; this.button1.Size = new System.Drawing.Size(24, 21); this.button1.TabIndex = 4; this.button1.TabStop = false; this.button1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; this.button1.Click += new System.EventHandler(this.button1_Click); // // EditBank // this.AcceptButton = this.bnOK; this.AutoScaleBaseSize = new System.Drawing.Size(5, 14); this.CancelButton = this.bnCancel; this.ClientSize = new System.Drawing.Size(298, 137); this.Controls.Add(this.button1); this.Controls.Add(this.label4); this.Controls.Add(this.label3); this.Controls.Add(this.label2); this.Controls.Add(this.label1); this.Controls.Add(this.tbKAccount); this.Controls.Add(this.tbBIK); this.Controls.Add(this.tbName); this.Controls.Add(this.cmbCity); this.Controls.Add(this.bnCancel); this.Controls.Add(this.bnOK); this.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.MaximizeBox = false; this.MinimizeBox = false; this.Name = "EditBank"; this.ShowInTaskbar = false; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.Text = "Банк"; this.Load += new System.EventHandler(this.EditBank_Load); ((System.ComponentModel.ISupportInitialize)(this.dvCities)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.dsCities1)).EndInit(); this.ResumeLayout(false); }
/// <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.dsCities1 = new BPS.BLL.City.DataSets.dsCities(); this.sqldaCities = 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(); ((System.ComponentModel.ISupportInitialize)(this.dsCities1)).BeginInit(); // // dsCities1 // this.dsCities1.DataSetName = "dsCities"; this.dsCities1.Locale = new System.Globalization.CultureInfo("ru-RU"); // // sqldaCities // this.sqldaCities.DeleteCommand = this.sqlDeleteCommand1; this.sqldaCities.InsertCommand = this.sqlInsertCommand1; this.sqldaCities.SelectCommand = this.sqlSelectCommand1; this.sqldaCities.TableMappings.AddRange(new System.Data.Common.DataTableMapping[] { new System.Data.Common.DataTableMapping("Table", "Cities", new System.Data.Common.DataColumnMapping[] { new System.Data.Common.DataColumnMapping("CityID", "CityID"), new System.Data.Common.DataColumnMapping("CityName", "CityName") }) }); this.sqldaCities.UpdateCommand = this.sqlUpdateCommand1; this.sqldaCities.RowUpdated += new System.Data.SqlClient.SqlRowUpdatedEventHandler(this.sqldaCities_RowUpdated); // // sqlDeleteCommand1 // this.sqlDeleteCommand1.CommandText = "DELETE FROM Cities WHERE (CityID = @Original_CityID) AND (CityName = @Original_Ci" + "tyName)"; this.sqlDeleteCommand1.Connection = this.sqlConnection1; this.sqlDeleteCommand1.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.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_CityName", System.Data.SqlDbType.NVarChar, 64, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "CityName", System.Data.DataRowVersion.Original, null)); // // sqlConnection1 // this.sqlConnection1.ConnectionString = ((string)(configurationAppSettings.GetValue("ConnectionString", typeof(string)))); // // sqlInsertCommand1 // this.sqlInsertCommand1.CommandText = "INSERT INTO Cities(CityName) VALUES (@CityName); SELECT CityID, CityName FROM Cit" + "ies WHERE (CityID = @@IDENTITY)"; this.sqlInsertCommand1.Connection = this.sqlConnection1; this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@CityName", System.Data.SqlDbType.NVarChar, 64, "CityName")); // // sqlSelectCommand1 // this.sqlSelectCommand1.CommandText = "SELECT CityID, CityName FROM Cities"; this.sqlSelectCommand1.Connection = this.sqlConnection1; // // sqlUpdateCommand1 // this.sqlUpdateCommand1.CommandText = "UPDATE Cities SET CityName = @CityName WHERE (CityID = @Original_CityID) AND (Cit" + "yName = @Original_CityName); SELECT CityID, CityName FROM Cities WHERE (CityID =" + " @CityID)"; this.sqlUpdateCommand1.Connection = this.sqlConnection1; this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@CityName", System.Data.SqlDbType.NVarChar, 64, "CityName")); 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_CityName", System.Data.SqlDbType.NVarChar, 64, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "CityName", System.Data.DataRowVersion.Original, null)); this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@CityID", System.Data.SqlDbType.Int, 4, "CityID")); ((System.ComponentModel.ISupportInitialize)(this.dsCities1)).EndInit(); }