예제 #1
0
        private void btnRemoveMaträtt_Click(object sender, EventArgs e)
        {
            int i = dataGridViewMaträtt.CurrentCell.RowIndex;

            Maträtt.RemoveAt(i);
            UpdateInterface();
        }
예제 #2
0
        //Lägga till maträtt till fordon
        private void btnAddMaträtt_Click(object sender, EventArgs e)
        {
            Maträtt maträtt = new Maträtt();

            maträtt.maträttNamn        = txtMaträtt.Text;
            maträtt.pris               = int.Parse(txtPris.Text);
            maträtt.maträttBeskrivning = txtBeskrivning.Text;

            ((Fordon)dataGridViewBil.CurrentRow.DataBoundItem).Maträtt.Add(maträtt);
            UpdateInterface();
        }