private void LoadSearchList() { //throw new NotImplementedException(); HallInfoBll hiBll = new HallInfoBll(); var list = hiBll.GetList(); list.Insert(0, new HallInfo() { HId = 0, HTitle = "All" }); ddlHallSearch.DataSource = list; ddlHallSearch.ValueMember = "hid"; ddlHallSearch.DisplayMember = "htitle"; ddlHallAdd.DataSource = hiBll.GetList(); ddlHallAdd.ValueMember = "hid"; ddlHallAdd.DisplayMember = "htitle"; List <DdlModel> listDdl = new List <DdlModel>() { new DdlModel("-1", "All"), new DdlModel("1", "Available"), new DdlModel("0", "Occupied") }; ddlFreeSearch.DataSource = listDdl; ddlFreeSearch.ValueMember = "id"; ddlFreeSearch.DisplayMember = "title"; }
#pragma warning restore CS0108 // Member hides inherited member; missing new keyword /// <summary> /// LoadSearch Hall IsFree /// </summary> private void LoadSearchList() { HallInfoBll hiBll = new HallInfoBll(); //厅包查询 var HallSearchList = hiBll.GetList(); HallSearchList.Insert(0, new HallInfo() { HId = 0, HTitle = "全部" }); ddlHallSearch.DataSource = HallSearchList; ddlHallSearch.ValueMember = "HId"; ddlHallSearch.DisplayMember = "HTitle"; //空闲查询 List <DdlModel> ListDdl = new List <DdlModel>() { new DdlModel("-1", "全部"), new DdlModel("0", "占用"), new DdlModel("1", "空闲") }; ddlFreeSearch.DataSource = ListDdl; ddlFreeSearch.ValueMember = "Id"; ddlFreeSearch.DisplayMember = "Title"; //厅包添加 var HallAddList = hiBll.GetList(); ddlHallAdd.DataSource = HallAddList; ddlHallAdd.ValueMember = "HId"; ddlHallAdd.DisplayMember = "HTitle"; }
private void LoadTypeList() { HallInfoBll hiBll = new HallInfoBll(); List <HallInfo> list = hiBll.GetList(); list.Insert(0, new HallInfo() { HId = 0, HTitle = "全部" }); ddlHallSearch.DataSource = list; ddlHallSearch.DisplayMember = "HTitle"; ddlHallSearch.ValueMember = "HId"; ddlHallAdd.DataSource = hiBll.GetList(); ddlHallAdd.DisplayMember = "HTitle"; ddlHallAdd.ValueMember = "HId"; //#region 空闲筛选列表 //List<DdlModel> listDdl = new List<DdlModel>() //{ // new DdlModel("-1","全部"), // new DdlModel("1","空闲"), // new DdlModel("0","使用中") //}; //ddlFreeSearch.DataSource = listDdl; //ddlFreeSearch.DisplayMember = "Title"; //ddlFreeSearch.ValueMember = "Id"; //#endregion }
private void LoadSearch() { HallInfoBll hiBll = new HallInfoBll(); var list = hiBll.GetList(); var listSearch = hiBll.GetList(); listSearch.Insert(0, new HallInfo() { HId = -1, HTitle = "全部" }); cbHallTypeSearch.DisplayMember = "HTitle"; cbHallTypeSearch.ValueMember = "HId"; cbHallTypeSearch.DataSource = listSearch; cbHallTitleAdd.DisplayMember = "HTitle"; cbHallTitleAdd.ValueMember = "HId"; cbHallTitleAdd.DataSource = list; List <TableState> listState = new List <TableState>(); listState.Add(new TableState(-1, "全部")); listState.Add(new TableState(0, "非空闲")); listState.Add(new TableState(1, "空闲")); cbTIsFreeSearch.DisplayMember = "Title"; cbTIsFreeSearch.ValueMember = "State"; cbTIsFreeSearch.DataSource = listState; }
private void LoadSearch() { HallInfoBll hiBll = new HallInfoBll(); var list = hiBll.GetList(); list.Insert(0, new HallInfo() { HId = 0, HTitle = "全部" }); comboBox3.DisplayMember = "HTitle"; comboBox3.ValueMember = "HId"; comboBox3.DataSource = list; comboBox1.DisplayMember = "HTitle"; comboBox1.ValueMember = "HId"; comboBox1.DataSource = hiBll.GetList(); List <TableState> listState = new List <TableState>(); listState.Add(new TableState(-1, "全部")); listState.Add(new TableState(0, "非空闲")); listState.Add(new TableState(1, "空闲")); comboBox2.DisplayMember = "Title"; comboBox2.ValueMember = "State"; comboBox2.DataSource = listState; }
private void LoadHallInfo() { HallInfoBll hiBll = new HallInfoBll(); //绑定修改窗口的分类下拉框 cbxHallInfo.DisplayMember = "HTitle"; cbxHallInfo.ValueMember = "HId"; cbxHallInfo.DataSource = hiBll.GetList(); //绑定查询窗口分类下拉框 var list = hiBll.GetList(); list.Insert(0, new HallInfo() { HId = 0, HTitle = "全部", }); cbxHallSearch.DisplayMember = "HTitle"; cbxHallSearch.ValueMember = "HId"; cbxHallSearch.DataSource = list; List <TableState> listState = new List <TableState>(); listState.Add(new TableState(-1, "全部")); listState.Add(new TableState(0, "使用中")); listState.Add(new TableState(1, "空闲中")); cbxFreeSearch.DisplayMember = "Title"; cbxFreeSearch.ValueMember = "State"; cbxFreeSearch.DataSource = listState; }
private void LoadSearchList() { HallInfoBll hiBll = new HallInfoBll(); var list = hiBll.GetList(); list.Insert(0, new HallInfo() { HId = 0, HTitle = "全部" }); ddlHallSearch.DataSource = list; ddlHallSearch.ValueMember = "hid"; ddlHallSearch.DisplayMember = "htitle"; ddlHallAdd.DataSource = hiBll.GetList(); ddlHallAdd.ValueMember = "hid"; ddlHallAdd.DisplayMember = "htitle"; List <DdlModel> listDdl = new List <DdlModel>() { new DdlModel("-1", "全部"), new DdlModel("1", "空闲"), new DdlModel("0", "使用中") }; ddlFreeSearch.DataSource = listDdl; ddlFreeSearch.ValueMember = "id"; ddlFreeSearch.DisplayMember = "title"; }
private void LoadTypeList() { HallInfoBll hiBll = new HallInfoBll(); List <HallInfo> list = new List <HallInfo>(); list = hiBll.GetList(); list.Insert(0, new HallInfo() { HId = 0, HTitle = "全部" }); ddlHallSearch.DataSource = list; ddlHallSearch.ValueMember = "HId"; ddlHallSearch.DisplayMember = "HTitle"; List <ddlFree> listDf = new List <ddlFree>() { new ddlFree(-1, "全部"), new ddlFree(1, "空闲"), new ddlFree(0, "使用中") };; ddlFreeSearch.DataSource = listDf; ddlFreeSearch.ValueMember = "Value"; ddlFreeSearch.DisplayMember = "Display"; ddlHallAdd.DataSource = hiBll.GetList(); ddlHallAdd.ValueMember = "HId"; ddlHallAdd.DisplayMember = "HTitle"; }
private void LoadHallInfo() { HallInfoBll hiBll = new HallInfoBll(); var list = hiBll.GetList(); tcHallInfo.TabPages.Clear(); TableInfoBll tiBll = new TableInfoBll(); foreach (var hi in list) { TabPage tp = new TabPage(hi.HTitle); Dictionary <string, string> dic = new Dictionary <string, string>(); dic.Add("thallid", hi.HId.ToString()); var listTableInfo = tiBll.GetList(dic); ListView lvTableInfo = new ListView(); lvTableInfo.LargeImageList = imageList1; lvTableInfo.DoubleClick += LvTableInfo_DoubleClick; lvTableInfo.Dock = DockStyle.Fill; tp.Controls.Add(lvTableInfo); foreach (var ti in listTableInfo) { var lvi = new ListViewItem(ti.TTitle, ti.TIsFree ? 0 : 1); lvi.Tag = ti.TId; lvTableInfo.Items.Add(lvi); } tcHallInfo.TabPages.Add(tp); } }
//加载主界面信息 void LoadHallInfo() { HallInfoBll bll = new HallInfoBll(); var halllist = bll.GetList(); foreach (var hall in halllist) { //根据包间名创建标签页 TabPage tp = new TabPage(hall.HTitle); //创建显示列表 ListView lvtableinfo = new ListView(); //给显示列表绑定图片表 lvtableinfo.LargeImageList = imageList1; //给显示列表绑定双击事件 lvtableinfo.DoubleClick += lvtableinfo_DoubleClick; //获得当前包间内所有的餐桌对象 Dictionary <string, string> dic = new Dictionary <string, string>(); dic.Add("thallid", hall.HId.ToString()); TableInfoBll tbll = new TableInfoBll(); var tables = tbll.GetList(dic); //向显示列表中添加餐桌对象 foreach (var table in tables) { ListViewItem item = new ListViewItem(table.TTitle, table.TIsFree?0:1); item.Tag = table.TId;//绑定餐桌号码 lvtableinfo.Items.Add(item); } //将显示列表加入当前标签页中 tp.Controls.Add(lvtableinfo); //将当前标签页加入tabtable中 tcHallInfo.Controls.Add(tp); } }
private void LoadHallInfo() { HallInfoBll hiBll = new HallInfoBll(); var listHi = hiBll.GetList(); TableInfoBll tiBll = new TableInfoBll(); tabHallInfo.TabPages.Clear(); foreach (var hi in listHi) { Dictionary <string, string> dic = new Dictionary <string, string>(); dic.Add("THallId", hi.HId.ToString()); var listTi = tiBll.GetList(dic); TabPage tp = new TabPage(hi.HTitle); ListView lv = new ListView(); lv.LargeImageList = ilTableInfo; foreach (var ti in listTi) { ListViewItem lvi = new ListViewItem(ti.TTitle, ti.TIsFree ? 0 : 1); lvi.Tag = ti.TId; lv.Items.Add(lvi); } lv.Dock = DockStyle.Fill; lv.DoubleClick += Lv_DoubleClick; tp.Controls.Add(lv); tabHallInfo.TabPages.Add(tp); } }
private void LoadHallInfo() { //2.1 Get all the area object HallInfoBll hiBll = new HallInfoBll(); var list = hiBll.GetList(); //Clear previous tab pages //2.2 Go through the set, add info to tag pages. tcHallInfo.TabPages.Clear(); TableInfoBll tiBll = new TableInfoBll(); foreach (var hi in list) { //Create a tab each area. TabPage tp = new TabPage(hi.HTitle); //3.1 Create a ListView for each area tap ListView lvTableInfo = new ListView(); //Double click to create a new order lvTableInfo.DoubleClick += lvTableInfo_DoubleClick; //3.2 Combine the imageList to listview lvTableInfo.LargeImageList = imageList1; lvTableInfo.Dock = DockStyle.Fill; tp.Controls.Add(lvTableInfo); //4.1 Get the tables of the area //Set query condition Dictionary <string, string> dic = new Dictionary <string, string>(); dic.Add("thallid", hi.HId.ToString()); var listTableInfo = tiBll.GetList(dic); //Double click the ListView, add a creating new order event lvTableInfo.DoubleClick += LvTableInfo_DoubleClick_New_Order; //4.2 Add table info to the list foreach (var ti in listTableInfo) { var lvi = new ListViewItem(ti.TTitle, ti.TIsFree ? 0 : 1); //Keep the table number in lvi.Tag, which could be used when creating a new order lvi.Tag = ti.TId; lvTableInfo.Items.Add(lvi); } //2.3 Add tab page into a tab container tcHallInfo.TabPages.Add(tp); //tcHallInfo.TabPages.Add(new TabPage(hi.HTitle)); } }
//tablecontrol控件 private void LoadHallInfo() { var hiBll = new HallInfoBll(); var list = hiBll.GetList(); foreach (var hallInfo in list) { var page = new TabPage(hallInfo.HTitle); page.Tag = hallInfo.HId; tabHall.TabPages.Add(page); } tabHall_SelectedIndexChanged(null, null); }
void LoadTypeList() { HallInfoBll hbll = new HallInfoBll(); List <HallInfo> list = hbll.GetList(); list.Insert(0, new HallInfo() { HId = 0, HTitle = "全部" }); ddlHallSearch.DataSource = list; ddlHallSearch.DisplayMember = "HTitle"; ddlHallSearch.ValueMember = "HId"; ddlHallAdd.DataSource = hbll.GetList(); ddlHallAdd.DisplayMember = "HTitle"; ddlHallAdd.ValueMember = "HId"; List <DdlModel> listm = new List <DdlModel>() { new DdlModel() { Id = -1, Title = "全部" }, new DdlModel() { Id = 1, Title = "空闲中" }, new DdlModel() { Id = 0, Title = "使用中" } }; ddlFreeSearch.DataSource = listm; ddlFreeSearch.DisplayMember = "Title"; ddlFreeSearch.ValueMember = "Id"; }
private void TabControlTest_Load(object sender, EventArgs e) { //查询厅包表 HallInfoBll hiBll = new HallInfoBll(); var list = hiBll.GetList(); //遍历集合,向tabcontrol中添加页 foreach (var hallInfo in list) { var tabPage = new TabPage(hallInfo.HTitle); //tabPage.Controls.Add() tabControl1.TabPages.Add(tabPage); } }
//加载所有所有厅包信息 private void LoadHallInfo() { HallInfoBll hiBll = new HallInfoBll(); var list = hiBll.GetList(); foreach (var hallInfo in list) { TabPage page = new TabPage(hallInfo.HTitle); page.Tag = hallInfo.HId;//给当前选项卡页tag属性存储餐桌所属的包房编号,给下面根据包房编号查询包房下面的所有餐桌 tabHall.TabPages.Add(page); } tabHall_SelectedIndexChanged(null, null);//调用一下这个事件方法,直接触发事件 }
private void LoadList() { Dictionary <string, string> dic = new Dictionary <string, string>(); if (ddlHallSearch.SelectedIndex > 0) { dic.Add("tHallId", ddlHallSearch.SelectedValue.ToString()); } if (ddlFreeSearch.SelectedIndex > 0) { dic.Add("tIsFree", ddlFreeSearch.SelectedValue.ToString()); } dgvList.AutoGenerateColumns = false; dgvList.DataSource = hiBll.GetList(); }
private void LoadSearch() { List <HallInfo> HallList = hiBll.GetList(); ddlHallAdd.DisplayMember = "HTitle"; ddlHallAdd.ValueMember = "HId"; ddlHallAdd.DataSource = hiBll.GetList(); HallList.Insert(0, new HallInfo() { HId = 0, HTitle = "全部" }); ddlHallSearch.DisplayMember = "HTitle"; ddlHallSearch.ValueMember = "HId"; ddlHallSearch.DataSource = HallList; List <TableInfo> tiList = new List <TableInfo>(); tiList.Add(new TableInfo() { HState = -1, TTitle = "全部" }); tiList.Add(new TableInfo() { HState = 0, TTitle = "非空闲" }); tiList.Add(new TableInfo() { HState = 1, TTitle = "空闲" }); ddlFreeSearch.DisplayMember = "TTitle"; ddlFreeSearch.ValueMember = "HState"; ddlFreeSearch.DataSource = tiList; }
private void LoadHallInfo() { //获取所有的HallInfo厅包对象 HallInfoBll hiBll = new HallInfoBll(); List <HallInfo> list = hiBll.GetList(); //遍历集合,向标签页中添加信息.遍历以前先清理一下TabPage集合 tcHallInfo.TabPages.Clear(); TableInfoBll tiBll = new TableInfoBll(); foreach (var hi in list) { //根据厅包对象创建标签页 TabPage tp = new TabPage(hi.HTitle); //获取到当前厅包的餐桌 Dictionary <string, string> dic = new Dictionary <string, string>(); dic.Add("THallId", hi.HId.ToString()); List <TableInfo> tableInfoList = tiBll.GetList(dic); //动态创建元素(列表)添加到容器(标签页)上 ListView lvTableInfo = new ListView(); //添加listview双击事件,完成开单功能 lvTableInfo.DoubleClick += LvTableInfo_DoubleClick; //设置imagelist,让列表使用图片 lvTableInfo.LargeImageList = imageList1; lvTableInfo.Dock = DockStyle.Fill; tp.Controls.Add(lvTableInfo); foreach (var ti in tableInfoList) { var lvi = new ListViewItem(ti.TTitle, ti.TIsFree ? 0 : 1); //后续操作需要用到餐桌编号,所以在这里存一下 lvi.Tag = ti.TId; lvTableInfo.Items.Add(lvi); } //将标签页加入到标签容器 tcHallInfo.TabPages.Add(tp); } }
/// <summary> /// 动态加载厅包 /// </summary> private void LoadHallInfo() { //清空对象 tcHallInfo.TabPages.Clear(); //获取所有厅包对象 HallInfoBll hiBll = new HallInfoBll(); TableInfoBll tiBll = new TableInfoBll(); var list = hiBll.GetList(); //遍历集合,向标签页中添加信息 foreach (var hallInfo in list) { //根据厅包对象创建标签页对象 TabPage tp = new TabPage(hallInfo.HTitle); //获取当前厅包的所有餐桌 Dictionary <string, string> dic = new Dictionary <string, string>(); dic.Add("THallId", hallInfo.HId.ToString()); var listT = tiBll.GetList(dic); //动态创建元素添加到标签页上 ListView lvTableInfo = new ListView(); lvTableInfo.DoubleClick += lvTableInfo_DoubleClick; tp.Controls.Add(lvTableInfo); lvTableInfo.ShowItemToolTips = true; //控件充满容器 lvTableInfo.Dock = DockStyle.Fill; //让列表使用图片 lvTableInfo.LargeImageList = imageList1; //添加餐桌信息 foreach (var ti in listT) { ListViewItem lvi = new ListViewItem(ti.TTitle, ti.TIsFree == 1 ? 0 : 1); //存一下餐桌编号,后续要用到 lvi.Tag = ti.TId; //设置提示信息 lvi.ToolTipText = lvi.Tag.ToString() + "号桌 " + (lvi.ImageIndex == 0 ? "空闲" : "使用中"); lvTableInfo.Items.Add(lvi); } //将标签页加入标签容器 tcHallInfo.TabPages.Add(tp); } }
private void LoadHallInfo() { //2.1、获取所有的厅包对象 HallInfoBll hiBll = new HallInfoBll(); var list = hiBll.GetList(); //2.2、遍历集合,向标签页中添加信息 tabControl1.TabPages.Clear(); TableInfoBll tiBll = new TableInfoBll(); foreach (var hi in list) { //根据厅包对象创建标签页对象 TabPage tp = new TabPage(hi.HTitle); //3.1、动态创建列表添加到标签页上 ListView lvTableInfo = new ListView(); //添加双击事件,完成开单功能 lvTableInfo.DoubleClick += lvTableInfo_DoubleClick; //3.2、让列表使用图片 lvTableInfo.LargeImageList = imageList1; lvTableInfo.Dock = DockStyle.Fill; //3.3、将listview添加到标签页中 tp.Controls.Add(lvTableInfo); //4.1、获取当前厅包对象的所有餐桌 Dictionary <string, string> dic = new Dictionary <string, string>(); dic.Add("thallid", hi.HId.ToString()); var listTableInfo = tiBll.GetList(dic); //4.2、向列表中添加餐桌信息 foreach (var ti in listTableInfo) { var lvi = new ListViewItem(ti.TTitle, ti.TIsFree ? 0 : 1); //后续操作需要用到餐桌编号,所以在这里存一下 lvi.Tag = ti.TId; lvTableInfo.Items.Add(lvi); } //2.3、将标签页加入标签容器 tabControl1.TabPages.Add(tp); } }
private void LoadSearchList() { HallInfoBll hiBll = new HallInfoBll(); var list = hiBll.GetList(); List <string> hallList = new List <string>(); //搜索 hallList.Add("-请选择-"); foreach (HallInfo hall in list) { hallList.Add(hall.HTitle); } ddlHallAdd.DataSource = hallList; hallList.Clear(); //添加、删除 list.Insert(0, new HallInfo() { Id = 0, HTitle = "全部" }); foreach (HallInfo hall in list) { hallList.Add(hall.HTitle); } ddlHallSearch.DataSource = hallList; List <DdlModel> listDdl = new List <DdlModel>() { new DdlModel("-1", "全部"), new DdlModel("1", "空闲"), new DdlModel("0", "使用中") }; List <string> ddlModelStringList = new List <string>(); foreach (DdlModel ddl in listDdl) { ddlModelStringList.Add(ddl.Title); } ddlFreeSearch.DataSource = ddlModelStringList; }
private void LoadHallInfo()//在主页面加载厅包信息 { //获取所有的厅包对象 HallInfoBll hiBll = new HallInfoBll(); var list = hiBll.GetList(); //清空,避免修改后反复添加 tcHallInfo.TabPages.Clear(); //遍历集合,向标签页中添加信息 TableInfoBll tiBll = new TableInfoBll(); foreach (var hi in list) { //根据厅包对象,创建标签页对象 TabPage tp = new TabPage(hi.HTitle); //获取当前厅包对象的所有餐桌 Dictionary <string, string> dic = new Dictionary <string, string>(); dic.Add("thallid", hi.HId.ToString()); var listTableInfo = tiBll.GetList(dic); //动态创建列表,添加到标签页上 ListView lvTableInfo = new ListView(); //添加双击事件,完成开单功能,+=之后双击Tab键,获得双击事件的方法 lvTableInfo.DoubleClick += LvTableInfo_DoubleClick1; lvTableInfo.LargeImageList = imageList1; lvTableInfo.Dock = DockStyle.Fill; tp.Controls.Add(lvTableInfo); //向列表中添加餐桌信息 foreach (var ti in listTableInfo) { var lvi = new ListViewItem(ti.TTitle, ti.TIsFree ? 0 : 1); //后续开单操作需要用到餐桌编号,所以在这里存一下 lvi.Tag = ti.TId; lvTableInfo.Items.Add(lvi); } //将标签页加入标签容器 tcHallInfo.TabPages.Add(tp); } }
private void LoadList() { dataGridView1.AutoGenerateColumns = false; dataGridView1.DataSource = hiBll.GetList(); }
private void LoadList() { dgvList.AutoGenerateColumns = false; dgvList.DataSource = hiBll.GetList(); }
private void LoadList() { //throw new NotImplementedException(); dgvList.AutoGenerateColumns = false; dgvList.DataSource = hiBll.GetList(); }
private void LoadHallInfoList() { gvHallInfo.AutoGenerateColumns = false; gvHallInfo.DataSource = hiBll.GetList(); }
private void LoadList() { gv_HallInfoList.AutoGenerateColumns = false; gv_HallInfoList.DataSource = _hiBll.GetList(); }