コード例 #1
0
        public void LoadBuildings()
        {
            IBuildingService buildingService = new BuildingService();
            string           message         = String.Empty;

            try
            {
                var buildings = buildingService.GetAllBuildings();
                buildingList          = new List <Building>(buildings);
                gvBuilding.DataSource = buildings;
                gvBuilding.Refresh();

                if (gvBuilding.RowCount != 0)
                {
                    gvBuilding.Rows[0].IsSelected = true;
                }
            }
            catch (Exception ex)
            {
                message = "Error Loading Building List";
                MessageBox.Show(ex.ToString());
            }
        }
コード例 #2
0
        public async Task <IActionResult> GetAllBuildings()
        {
            var res = await BuildingService.GetAllBuildings(_context);

            return(new ObjectResult(res));
        }