private void EditButtonrro_Click(object sender, RoutedEventArgs e)
        {
            LocationsTabControl.SelectedIndex = 2;
            RoomGridModel room = (RoomGridModel)dataGridRoom.SelectedItem;

            _ = LoadDataForEditRoom(room.RoomId);
        }
Exemplo n.º 2
0
        public ActionResult Room()
        {
            var gridModel = new RoomGridModel();

            SetupRoomGridModel(gridModel.RoomGrid);
            return(View(gridModel));
        }
Exemplo n.º 3
0
        public ActionResult Room_EditData(DXInfo.Models.Rooms room)
        {
            var gridModel = new RoomGridModel();

            SetupRoomGridModel(gridModel.RoomGrid);
            return(ajaxCallBack <DXInfo.Models.Rooms>(gridModel.RoomGrid, room, addRoom, editRoom, delRoom));
        }
        private void DeleteButtonroom_Click(object sender, RoutedEventArgs e)
        {
            RoomGridModel roo = (RoomGridModel)dataGridRoom.SelectedItem;

            RoomDataService roomdataservice = new RoomDataService(new EntityFramework.TimetableManagerDbContext());

            roomdataservice.deleteRooms(roo.RoomId).ContinueWith(result =>
            {
                MessageBox.Show("Deleted");
            });

            _ = RoomDataList.Remove(roo);
        }
Exemplo n.º 5
0
        public ActionResult Room_RequestData()
        {
            var gridModel = new RoomGridModel();

            SetupRoomGridModel(gridModel.RoomGrid);

            var q = from r in Uow.Rooms.GetAll()
                    join d in Uow.Depts.GetAll() on r.DeptId equals d.DeptId into rd
                    from rds in rd.DefaultIfEmpty()
                    join d1 in Uow.NameCode.GetAll().Where(w => w.Type == "RoomStatus") on SqlFunctions.StringConvert((double?)r.Status).Trim() equals d1.Code into dd1
                    from dd1s in dd1.DefaultIfEmpty()
                    select new { r.Id, r.DeptId, r.Code, r.Name, r.Comment, r.Status, StatusName = dd1s.Name, rds.DeptName };

            return(QueryAndExcel(gridModel.RoomGrid, q, "房间.xls"));
        }
        private async Task LoadRoomData()
        {
            RoomDataService roomdataservice = new RoomDataService(new EntityFramework.TimetableManagerDbContext());

            roomList = await roomdataservice.GetRoomAsync();

            roomList.ForEach(g => {
                RoomGridModel roomobj = new RoomGridModel();

                roomobj.RoomId       = g.RoomId;
                roomobj.RoomName     = g.RoomName;
                roomobj.Capacity     = g.Capacity;
                roomobj.BuildingName = g.Building.BuildingName;
                roomobj.CenterName   = g.Center.CenterName;

                RoomDataList.Add(roomobj);
            });
        }