コード例 #1
0
ファイル: FormInsertUO.cs プロジェクト: HONKERTRON/UPOReu
        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();
        }
コード例 #2
0
ファイル: FormMain.cs プロジェクト: HONKERTRON/UPOReu
 private void buttonPeople_Click(object sender, EventArgs e)
 {
     if (role > 3)
     {
         FormPeople formPeople = new FormPeople(connection, 0);
         //formPeople.dataGridViewPeople.CellDoubleClick += (senderObj, eargs) =>
         //{
         //    this.selid = formPeople.select;
         //    this.Text = selid.ToString();
         //};
         formPeople.Show();
     }
 }
コード例 #3
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();
        }