private void bTT_DeleteSaleOrRent_Click(object sender, EventArgs e) { try { if (click != null) { DialogResult _diResult = MessageBox.Show("Вы действительно хотите удалить запись?", "Удаление", MessageBoxButtons.OKCancel, MessageBoxIcon.Question); if (_diResult == DialogResult.OK) { SQLConnectionDelete.DeleteOther(secondId); } if (b == "Продажа") { SQLclassInsert.RefreshO(this.dataGridView1); } if (b == "Аренда") { SQLclassUpdateR.RefreshOR(this.dataGridView1); } } } catch (Exception ex) { MessageBox.Show(ex.ToString(), "Error! Delete Ohter!", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void bTT_Search_Click(object sender, EventArgs e) { try { if (click != null) { int price = Convert.ToInt32(txtBx_Search.Text); if (b == "Продажа") { int o = 1; SQLConnectionDelete.SearchOther(this.dataGridView1, price, o); } if (b == "Аренда") { int o = 2; SQLConnectionDelete.SearchOther(this.dataGridView1, price, o); } } } catch (Exception ex) { MessageBox.Show("Ошибка!\n" + ex.ToString(), "Error! Update!", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void bTT_Editing_Click(object sender, EventArgs e) { try { if (click != null) { string head = txtBx_Header.Text; int area = Convert.ToInt32(txtBx_Area.Text); int region = cmbBx_Region.SelectedIndex + 1; int town = SQLConnectionDelete.townID(cmbBx_Town.SelectedValue.ToString()); string address = txtBx_Address.Text; string whoBuy = txtBx_Seller.Text; int number = Convert.ToInt32(txtBx_Number.Text); string comment = txtBx_Comment.Text; int price = Convert.ToInt32(txtBx_Price.Text); int active = cmbBx_Condition.SelectedIndex + 1; int choose = comboBox1.SelectedIndex + 1; SQLclassUpdateR.UpdateOther(head, area, region, town, address, whoBuy, number, comment, price, active, choose, secondId); if (b == "Продажа") { SQLclassInsert.RefreshO(this.dataGridView1); } if (b == "Аренда") { SQLclassUpdateR.RefreshOR(this.dataGridView1); } } } catch (Exception ex) { MessageBox.Show("Заполняйте данные правильно!\n" + ex.ToString(), "Error! Update!", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void OtherForm_Load(object sender, EventArgs e) { cmbBx_Region.DataSource = SQLConnectionDelete.ComboRegion(); cmbBx_Condition.DataSource = SQLConnectionDelete.ComboActive(); cmbBx_Region.SelectedValueChanged += new EventHandler(cmbBx_Region_SelectedValueChanged); dataGridView1.CellEnter += new DataGridViewCellEventHandler(dataGridView1_CellEnter); toolStripStatusLabel1.Text = "Форма недвижимости: Готова"; }
private void cmbBx_Region_SelectedValueChanged(object sender, EventArgs e) { cmbBx_Town.DataSource = SQLConnectionDelete.ComboTown(SQLConnectionDelete.RegionID(cmbBx_Region.SelectedValue.ToString())); }