Example #1
0
        private void LoadTypeList()
        {
            List <TableInfo> tableInfos = new List <TableInfo>();

            tableInfos.Add(new TableInfo()
            {
                THTitle = "全部"
            });
            tableInfos.Add(new TableInfo()
            {
                THTitle = "空闲", TId = 1
            });
            tableInfos.Add(new TableInfo()
            {
                THTitle = "使用中", TId = 0
            });
            ddlFreeSearch.ValueMember   = "TId";
            ddlFreeSearch.DisplayMember = "THTitle";
            ddlFreeSearch.DataSource    = tableInfos;

            ddlHallSearch.ValueMember   = "HId";
            ddlHallSearch.DisplayMember = "HTitle";
            List <HallInfo> listHallInfos = hiBll.GetList();

            listHallInfos.Insert(0, new HallInfo()
            {
                HTitle = "全部"
            });
            ddlHallSearch.DataSource = listHallInfos;

            ddlHallAdd.ValueMember   = "HId";
            ddlHallAdd.DisplayMember = "HTitle";
            ddlHallAdd.DataSource    = hiBll.GetList();
        }
        private void LoadtcHallInfo()
        {
            this.tcHallInfo.TabPages.Clear();
            //1、获取厅包的集合
            var hallInfolist = hiBll.GetList();

            for (int i = 0; i < hallInfolist.Count; i++)
            {
                var tabPage = new TabPage(hallInfolist[i].HTitle);
                this.tcHallInfo.TabPages.Add(tabPage);

                Dictionary <string, string> dic = new Dictionary <string, string>();
                dic.Add("THallId", hallInfolist[i].HId.ToString());
                //2、获取一个厅包下的所有餐桌的集合
                var      tableInfoList = tiBll.GetList(dic);
                ListView lvTableInfo   = new ListView();
                lvTableInfo.Dock           = DockStyle.Fill;
                lvTableInfo.LargeImageList = imageList1;
                lvTableInfo.Tag            = hallInfolist[i].HId;
                //3、往各个tabpage中添加餐桌。
                foreach (var tableInfo in tableInfoList)
                {
                    var table = new ListViewItem(tableInfo.TTitle, tableInfo.TIsFree ? 0 : 1);
                    table.Tag = tableInfo;
                    lvTableInfo.Items.Add(table);
                    tabPage.Controls.Add(lvTableInfo);
                }
                lvTableInfo.DoubleClick += LvTableInfo_DoubleClick;
            }

            this.tcHallInfo.SelectedIndex = TabIndex;
        }
Example #3
0
 private void LoadList()
 {
     dgvList.AutoGenerateColumns = false;
     dgvList.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
     dgvList.DataSource          = hiBll.GetList();
 }