Exemplo n.º 1
0
        private void AddButton_Click(object sender, EventArgs e)
        {
            /*SQLiteConnection connection = Utils.getConnection();
             * String sql = "INSERT INTO Klub (Nazwa, DataZgloszenia, OsobaZglaszajaca) VALUES ('Abc','2015-02-27','Akukuku!')";
             * SQLiteCommand command2 = new SQLiteCommand(sql, connection);
             * command2.ExecuteNonQuery();*/
            /*
             * AddClubForm acf = new AddClubForm(null, "", "", "");
             * acf.ShowDialog();
             * if (acf.NewAdded)
             * {
             *  UpdateDataTable();
             *  UpdateDataTableWithFilter();
             * }*/
            AddParticipantForm apf = new AddParticipantForm("", this.allGroups);

            apf.ShowDialog();
            if (apf.NewAdded)
            {
                UpdateDataTable();
                UpdateDataTableWithFilter();
                String lastId = apf.id;
                apf = new AddParticipantForm(lastId, this.allGroups);
                apf.ShowDialog();
                if (apf.NewAdded)
                {
                    UpdateDataTable();
                    UpdateDataTableWithFilter();
                }
            }
        }
Exemplo n.º 2
0
        private void EditButton_Click(object sender, EventArgs e)
        {
            if (dataGridView1.SelectedRows.Count > 0)
            {
                DataGridViewRow    row = this.dataGridView1.SelectedRows[0];
                AddParticipantForm apf = new AddParticipantForm(row.Cells[0].Value.ToString(), this.allGroups);
                apf.ShowDialog();
                if (apf.NewAdded)
                {
                    UpdateDataTable();
                    UpdateDataTableWithFilter();
                }
            }

            /*
             * if (dataGridView1.SelectedRows.Count > 0)
             * {
             *  DataGridViewRow row = this.dataGridView1.SelectedRows[0];
             *  String id = row.Cells[0].Value.ToString();
             *  String name = row.Cells[1].Value.ToString();
             *  String date = row.Cells[2].Value.ToString();
             *  String person = row.Cells[3].Value.ToString();
             *
             *
             *  AddClubForm acf = new AddClubForm(id, name, date, person);
             *
             *  acf.ShowDialog();
             *  if (acf.NewAdded)
             *  {
             *      UpdateDataTable();
             *      UpdateDataTableWithFilter();
             *  }
             * }*/
        }
        private void treeView1_DoubleClick(object sender, EventArgs e)
        {
            if (treeView1.SelectedNode != null)
                if (treeView1.SelectedNode.Tag != null)
                {
                    if (treeView1.SelectedNode.Tag is Participant)
                    {
                        Participant p = (Participant)treeView1.SelectedNode.Tag;
                        AddParticipantForm apf = new AddParticipantForm(p.id.ToString(), this.allGroups);
                        apf.ShowDialog();
                        if (apf.NewAdded)
                        {
                            UpdateComponents();
                        }
                        /*
                        Participant p = (Participant)treeView1.SelectedNode.Tag;
                        ParticipantDetailsForm pdf = new ParticipantDetailsForm(p, allGroups, 1);
                        pdf.ShowDialog();
                        if (pdf.changesMade)
                            UpdateComponents();*/
                    }
                    else if (treeView1.SelectedNode.Tag is Group)
                    {
                        Group g = (Group)treeView1.SelectedNode.Tag;
                        GroupDetailsForm gdf = new GroupDetailsForm(g);
                        gdf.ShowDialog();
                        if (gdf.changesMade)
                            UpdateComponents();
                    
                    }
                }

        }