예제 #1
0
        private void mmu_EditCar_Click(object sender, EventArgs e)
        {
            //if (Grid.SelectedRows.Count == 0) return;
            //int selectedIndex = Grid.SelectedRows[0].Index;
            //int rowId = Convert.ToInt32(Grid["id", selectedIndex].Value);

            //FormAddCar form = new FormAddCar();
            //form.RowId = rowId;
            //if(form.ShowDialog() == DialogResult.OK)
            //{
            //    Refresh();
            //}


            if (Grid.SelectedRows.Count == 0)
            {
                return;
            }
            int selectedIndex = Grid.SelectedRows[0].Index;
            int rowId         = Convert.ToInt32(Grid["id", selectedIndex].Value);

            FormAddCar form = new FormAddCar();

            form.RowId = rowId;
            if (form.ShowDialog() == DialogResult.OK)
            {
                RefreshData();
            }
        }
예제 #2
0
        private void AddNewCar()
        {
            FormAddCar form = new FormAddCar();

            if (form.ShowDialog() == DialogResult.OK)
            {
                RefreshData();
            }
        }
예제 #3
0
        private void mnuEdit_Click(object sender, EventArgs e)
        {
            if (grid.SelectedRows.Count == 0)
            {
                return;
            }
            int selectedIndex = grid.SelectedRows[0].Index;
            int rowId         = Convert.ToInt32(grid["id", selectedIndex].Value);

            FormAddCar form = new FormAddCar();

            form.rowId = rowId;
            if (form.ShowDialog() == DialogResult.OK)
            {
                RefreshData();
            }
        }
예제 #4
0
        private void mnuEditCar_Click(object sender, EventArgs e)
        {
            if (grid.SelectedRows.Count == 0)
            {
                return;                               //jesli kolekcja jest pusta to nic nie moge edytowac
            }
            int selectedIndex = grid.SelectedRows[0].Index;
            int rowId         = Convert.ToInt32(grid["id", selectedIndex].Value);

            FormAddCar form = new FormAddCar();

            form.RowId = rowId;
            if (form.ShowDialog() == DialogResult.OK)
            {
                RefreshData();
            }
        }