private void LoadRoomInfoByDelFlag(int p)
 {
     RoomInfoBLL rBll = new RoomInfoBLL();
     List<RoomInfo> list = rBll.GetAllRoomInfoByDelFlag(p);
     list.Insert(0, new RoomInfo() { RoomName = "请选择", RoomId = -1 });
     cmbRoom.DataSource = list;
     cmbRoom.DisplayMember = "RoomName";
     cmbRoom.ValueMember = "RoomId";
 }
Example #2
0
 //加载房间
 private void LoadAllRoomInfoByDelFlag(int p)
 {
     RoomInfoBLL rBll = new RoomInfoBLL();
     dgvRoom.AutoGenerateColumns = false;//禁止自动生成列
     dgvRoom.DataSource = rBll.GetAllRoomInfoByDelFlag(p);
     dgvRoom.ClearSelection();//清楚默认选中的行
 }
Example #3
0
 //动态加载所有的房间
 private void LoadRoomInfoByDelFlag(int p)
 {
     //坑==========================================
     //加载所有的房间
     RoomInfoBLL rBll = new RoomInfoBLL();
     List<RoomInfo> listRoom = rBll.GetAllRoomInfoByDelFlag(p);
     for (int i = listRoom.Count - 1; i >= 0; i--)
     {
         TabPage tp = new TabPage();
         tp.Text = listRoom[i].RoomName;//显示房间的名字
         tp.Tag = listRoom[i];//把房间对象存储到每个tabpage控件的tag属性
         ListView lv = new ListView();//餐桌 listview这个控件可以放图片也可以放文字                lv.LargeImageList = imageList1;//设置该控件中显示图片控件
         lv.LargeImageList = imageList1;//设置该控件中显示图片控件
         lv.View = View.LargeIcon;//设置控件中的图片显示的方式
         lv.Dock = DockStyle.Fill;//设置该控件的显示方式
         lv.BackColor = Color.SeaGreen;//设置该控件的背景颜色
         lv.MultiSelect = false;//禁止多选
         //把lv添加到tabpage控件中
         tp.Controls.Add(lv);
         tabMain.TabPages.Add(tp);
     }
 }