Beispiel #1
0
        private void mudar_gerente_bt_Click(object sender, EventArgs e)
        {
            string num_fiscal = cond_dataGridView.CurrentRow.Cells[0].Value.ToString();

            data.connectToDB();

            CondominioModel cond = new CondominioModel();

            //String sql = String.Format("SELECT * FROM proj_condominio WHERE num_fiscal = '" + num_fiscal + "'");
            //MessageBox.Show(sql);

            SqlCommand com = new SqlCommand("getCondominio", data.connection());

            com.CommandType = CommandType.StoredProcedure;
            com.Parameters.AddWithValue("@condomino", num_fiscal);
            SqlDataReader reader;

            reader = com.ExecuteReader();
            while (reader.Read())
            {
                cond.num_fiscal  = Decimal.Parse(reader["num_fiscal"].ToString());
                cond.gerente_nif = Decimal.Parse(reader["gerente_nif"].ToString());
                cond.nome        = reader["nome"].ToString();
            }
            data.close();

            AddCondominio addCond = new AddCondominio(cond);

            addCond.ShowDialog(this);
        }
Beispiel #2
0
        private void editar_Click(object sender, EventArgs e)
        {
            data.connectToDB();

            CondominioModel cond = new CondominioModel();

            SqlCommand com = new SqlCommand("getCondominio", data.connection());

            com.CommandType = CommandType.StoredProcedure;
            com.Parameters.AddWithValue("@num_fiscal", cond_selected());
            SqlDataReader reader;

            reader = com.ExecuteReader();
            while (reader.Read())
            {
                cond.num_fiscal  = Decimal.Parse(reader["num_fiscal"].ToString());
                cond.gerente_nif = Decimal.Parse(reader["gerente_nif"].ToString());
                cond.nome        = reader["nome"].ToString();
            }
            data.close();

            AddCondominio addCond = new AddCondominio(cond);

            addCond.ShowDialog(this);
        }
Beispiel #3
0
        private void add_bt_Click(object sender, EventArgs e)
        {
            AddCondominio cond = new AddCondominio();

            this.Hide();
            cond.ShowDialog(this);
        }
Beispiel #4
0
        private void add_cond_bt_Click(object sender, EventArgs e)
        {
            AddCondominio add = new AddCondominio();

            add.ShowDialog();
        }