Ejemplo n.º 1
0
        private void getButton_Click(object sender, EventArgs e)
        {
            DataGridViewSelectedRowCollection sel = grid.SelectedRows;

            if (sel == null || sel.Count == 0)
            {
                if (MessageBox.Show("Do you want an allocation for every group?", "No selection", MessageBoxButtons.YesNo)
                    == DialogResult.No)
                {
                    MessageBox.Show("Then you must first select the group(s) you want.");
                    return;
                }

                // Go through each group, getting an allocation for each one
                // ... even if it already has one?
                m_IdMan.GetAllocation();
            }
            else
            {
                foreach (DataGridViewRow row in sel)
                {
                    IdGroup g = (IdGroup)row.Cells["dgcGroupName"].Value;
                    g.GetAllocation(false); // no announcement
                }
            }

            RefreshList();
            SetChanged();
        }
Ejemplo n.º 2
0
        private void grid_DoubleClick(object sender, EventArgs e)
        {
            // Return if more than one thing is selected (how we got a
            // double-click message is therefore a bit odd).
            DataGridViewSelectedRowCollection sel = grid.SelectedRows;

            if (sel == null || sel.Count != 1)
            {
                return;
            }

            // Make an allocation for the selected group.
            IdGroup g = (IdGroup)sel[0].Cells["dgcGroupName"].Value;

            g.GetAllocation(false); // no announcement
            RefreshList();
            SetChanged();
        }