Ejemplo n.º 1
0
        private void button1_Click(object sender, EventArgs e)
        {
            FormPeople formPeople = new FormPeople(connection, 1);

            formPeople.dataGridViewPeople.CellDoubleClick += (senderObj, eargs) =>
            {
                this.personid = formPeople.select;
                formPeople.Close();
            };
            formPeople.Show();
        }
Ejemplo n.º 2
0
        private void ChosePersonToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Int32      idObject   = Convert.ToInt32(dataGridViewObjects.Rows[dataGridViewObjects.SelectedCells[0].RowIndex].Cells[0].Value);
            FormPeople formPeople = new FormPeople(connection, 1);

            formPeople.dataGridViewPeople.CellDoubleClick += (senderObj, eargs) =>
            {
                this.selid = formPeople.select;
                if (selid > 0)
                {
                    connection.Open();
                    String     cmd    = "UPDATE [OBJECTS] SET [idUSERS] = " + selid.ToString() + " WHERE [idOBJECT] = " + idObject.ToString() + " ;";
                    SqlCommand query_ = new SqlCommand(cmd, connection);
                    int        res    = Convert.ToInt32(query_.ExecuteScalar());
                    connection.Close();
                }
                formPeople.Close();
            };
            formPeople.Show();
        }