コード例 #1
0
ファイル: FunctionForm.cs プロジェクト: 001220/HuaAo
 private void timer2_Tick(object sender, EventArgs e)
 {
     //总状态
     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() + "%";
 }
コード例 #2
0
ファイル: FunctionForm.cs プロジェクト: 001220/HuaAo
        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();
            }
        }