private void LoadAllPlane() { try { List <Plane> planes = _planeService.GetAllPlanes(); if (planes.Count > 0) { dgvPlane.Rows.Clear(); for (int i = 0; i < planes.Count; i++) { dgvPlane.Rows.Add(); dgvPlane.Rows[i].Cells["SN"].Value = i + 1; dgvPlane.Rows[i].Cells["Id"].Value = planes[i].Id.ToString(); dgvPlane.Rows[i].Cells["PlaneName"].Value = planes[i].PlaneName.ToString(); dgvPlane.Rows[i].Cells["PlaneType"].Value = planes[i].PlaneType.ToString(); dgvPlane.Rows[i].Cells["Capacity"].Value = planes[i].Capacity.ToString(); dgvPlane.Rows[i].Cells["Passengers"].Value = planes[i].PassengerNumber.ToString(); } } } catch (Exception ex) { throw; } }