private void RoomForm_Load(object sender, EventArgs e) { //标题 this.Text = "房间-餐台设置"; //房间类型 //背景 dataGridView1.BackgroundColor = Color.White; //禁止添加 dataGridView1.AllowUserToAddRows = false; //禁止调整列 dataGridView1.AllowUserToResizeColumns = false; //禁止调整行 dataGridView1.AllowUserToResizeRows = false; //取消头列 dataGridView1.RowHeadersVisible = false; //禁止多选 dataGridView1.MultiSelect = false; //加载数据 DataTable dt = RommBLL.getTable(); dataGridView1.DataSource = dt; dataGridView1.Columns[0].Visible = false; //房间类型 cmdType.Items.Add("所有餐台"); cmdType.SelectedIndex = 0; DataTable dt2 = RommBLL.getTable(); for (int i = 0; i < dt2.Rows.Count; i++) { cmdType.Items.Add(dt2.Rows[i]["房间类型"].ToString()); } //餐桌设置 //背景 dataGridView2.BackgroundColor = Color.White; //禁止添加 dataGridView2.AllowUserToAddRows = false; //禁止调整列 dataGridView2.AllowUserToResizeColumns = false; //禁止调整行 dataGridView2.AllowUserToResizeRows = false; //取消头列 dataGridView2.RowHeadersVisible = false; //禁止多选 dataGridView2.MultiSelect = false; //加载数据 DataTable dt3 = RommBLL.getTableMeal(); dataGridView2.DataSource = dt3; dataGridView2.Columns[0].Visible = false; }
private void 显示可用ToolStripMenuItem_Click(object sender, EventArgs e) { tabControl2.TabPages.Clear(); //房间类型加载Room类型 DataTable dt = RommBLL.getTable(); for (int i = 0; i < dt.Rows.Count; i++) { //创建子页 TabPage tp = new TabPage(); tp.Text = dt.Rows[i]["房间类型"].ToString(); //创建ListView ListView lv = new ListView(); lv.Dock = DockStyle.Fill; DataTable dt2 = RommBLL.getTableDT(dt.Rows[i]["房间类型"].ToString(), 0); for (int j = 0; j < dt2.Rows.Count; j++) { if (dt2.Rows[j]["餐台状态"].ToString() == "可用") { lv.LargeImageList = imageList1; ListViewItem lvi = new ListViewItem(dt2.Rows[j]["餐台名称"].ToString()); if (dt2.Rows[j]["餐台状态"].ToString() == "可用") { lvi.ImageIndex = 8; } else if (dt2.Rows[j]["餐台状态"].ToString() == "占用") { lvi.ImageIndex = 9; } else if (dt2.Rows[j]["餐台状态"].ToString() == "预订") { lvi.ImageIndex = 10; } else if (dt2.Rows[j]["餐台状态"].ToString() == "停用") { lvi.ImageIndex = 11; } if (dt2.Rows[j]["餐台状态"].ToString() == "可用") { this.顾客开单ToolStripMenuItem.Enabled = true; this.宾客结账ToolStripMenuItem.Enabled = false; this.增加消费ToolStripMenuItem.Enabled = false; this.顾客预订ToolStripMenuItem.Enabled = true; } lv.Items.Add(lvi); } } lv.ContextMenuStrip = this.contextMenuStrip1; tp.Controls.Add(lv); tabControl2.TabPages.Add(tp); } }
private void TheTableEditorForm_Load(object sender, EventArgs e) { //标题 this.Text = "餐桌编辑"; //加载下拉框 DataTable dt2 = RommBLL.getTable(); for (int i = 0; i < dt2.Rows.Count; i++) { cmdType.Items.Add(dt2.Rows[i]["房间类型"].ToString()); } txtName.Text = tables.TableName1; txtAdrees.Text = tables.TableArea1; cmdType.SelectedIndex = tables.RTID1; }
public void FunctionForm_Load(object sender, EventArgs e) { //最大化 this.WindowState = FormWindowState.Maximized; //禁止放大缩小 this.MaximizeBox = false; #region 属性栏 billing.Image = imageList1.Images[4]; Insert.Image = imageList1.Images[0]; settleAccounts.Image = imageList1.Images[7]; vip.Image = imageList1.Images[5]; inquire.Image = imageList1.Images[3]; room.Image = imageList1.Images[2]; commodity.Image = imageList1.Images[1]; system.Image = imageList1.Images[6]; tabControl2.Dock = DockStyle.Fill; #endregion //读取XML文件 //创建XML文件流 XmlDocument doc = new XmlDocument(); //加载xml doc.Load(@"setup.xml"); //获得根节点 XmlElement root = doc.DocumentElement; //获得子节点 XmlNodeList xnl = root.ChildNodes; //标题 this.Text = xnl[0].InnerText; //下标题 this.tslName.Text = xnl[0].InnerText; //登录人 this.tslDL.Text = "当前登录"; this.tslDLName.Text = ""; //启动总状态,5分钟一次 timer2.Start(); //总状态 lblCount.Text = RommBLL.getObjectZTS().ToString(); //占用 lblZY.Text = RommBLL.getObjectZY().ToString(); //可用 lblKG.Text = RommBLL.getObjectKY().ToString(); //预定 lblYD.Text = RommBLL.getObjectYD().ToString(); //停用 lblTY.Text = RommBLL.getObjectTY().ToString(); //上座率 lblSZL.Text = RommBLL.getObjectSZL().ToString() + "%"; //房间类型加载Room类型 DataTable dt = RommBLL.getTable(); for (int i = 0; i < dt.Rows.Count; i++) { //创建子页 TabPage tp = new TabPage(); tp.Text = dt.Rows[i]["房间类型"].ToString(); //创建ListView ListView lv = new ListView(); lv.Dock = DockStyle.Fill; DataTable dt2 = RommBLL.getTableDT(dt.Rows[i]["房间类型"].ToString()); for (int j = 0; j < dt2.Rows.Count; j++) { lv.LargeImageList = imageList1; ListViewItem lvi = new ListViewItem(dt2.Rows[j]["餐台名称"].ToString()); if (dt2.Rows[j]["餐台状态"].ToString() == "可用") { lvi.ImageIndex = 8; } else if (dt2.Rows[j]["餐台状态"].ToString() == "占用") { lvi.ImageIndex = 9; } else if (dt2.Rows[j]["餐台状态"].ToString() == "预订") { lvi.ImageIndex = 10; } else if (dt2.Rows[j]["餐台状态"].ToString() == "停用") { lvi.ImageIndex = 11; } //if (dt2.Rows[j]["餐台状态"].ToString() == "可用") //{ // this.宾客结账ToolStripMenuItem.Enabled = false; // this.增加消费ToolStripMenuItem.Enabled = false; // this.顾客开单ToolStripMenuItem.Enabled = true; // this.顾客预订ToolStripMenuItem.Enabled = true; //} lvi.Name = dt2.Rows[j]["TableID"].ToString(); lvi.Tag = dt2.Rows[j]["餐台名称"].ToString(); lv.Items.Add(lvi); } lv.DoubleClick += lv_DoubleClick; lv.Click += lv_Click; lv.ContextMenuStrip = this.contextMenuStrip1; tp.Controls.Add(lv); tabControl2.TabPages.Add(tp); //当前时间 tslTime.Text = "当前时间"; timer1.Start(); } }