예제 #1
0
        private void RoomTypeList_AfterSelect(object sender, TreeViewEventArgs e)
        {
            RoomsList.Items.Clear();

            list = RoomManger.GetRoomList(RoomTypeList.SelectedNode.Text);

            foreach (Room i in list)
            {
                ListViewItem lvi = new ListViewItem();
                lvi.ImageIndex = 0;
                lvi.Text       = i.RoomNumber.Trim();
                lvi.Tag        = i;
                string output = "类型:" + RoomTypeService.GetRoomType(i.RoomTypeID).TypeName + "\r\n状态:" +
                                RoomStatusService.FindStatusByID(i.RoomStatus).RoomStatusName + "\r\n描述:" + i.Description + "\r\n床数:" +
                                i.NumOfBeds.ToString() + "\r\n最大居住人数:" + i.NumOfCust.ToString();
                lvi.ToolTipText = output;

                RoomsList.Items.Add(lvi);
            }
        }
예제 #2
0
        public static List <RoomManageModel> GetAllModelList()
        {
            List <Room>            roomlist  = null;
            List <RoomManageModel> modellist = new List <RoomManageModel>();

            roomlist = RoomService.GetRoomList();

            foreach (Room i in roomlist)
            {
                RoomManageModel node = new RoomManageModel();
                node.RoomID      = i.RoomID;
                node.Description = i.Description;
                node.RoomName    = i.RoomNumber.Trim();
                node.RoomType    = RoomTypeService.GetRoomType(i.RoomTypeID).TypeName;
                node.BedNum      = i.NumOfBeds;
                node.MaxCustNum  = i.NumOfCust;
                node.RoomStatus  = RoomStatusService.FindStatusByID(i.RoomStatus).RoomStatusName;
                modellist.Add(node);
            }

            return(modellist);
        }