Ejemplo n.º 1
0
        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);
            }
        }
Ejemplo n.º 2
0
        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);
            }
        }
Ejemplo n.º 3
0
 private void bTT_Rent_Click(object sender, EventArgs e)
 {
     SQLclassUpdateR.RefreshOR(this.dataGridView1);
     click = "2";
 }