예제 #1
0
        /// <summary>
        /// thống kê theo IDChiNhanh done
        /// </summary>
        /// <param name="tblThongTin"></param>
        public void ThongKe(DataTable tblThongTin)
        {
            DataRow dr11 = tblThongTin.Rows[0];

            btnTrong.Text               = "Trống (" + BUS_BAN.DanhSachThongKe(dr11["IDChiNhanh"].ToString(), 0) + ")";
            btnDatTruoc.Text            = "Đã Đặt (" + BUS_BAN.DanhSachThongKe(dr11["IDChiNhanh"].ToString(), 1) + ")";
            btnDatTruoc.ForeColor       = Color.OrangeRed;
            btnDatTruoc.StyleController = null;
            btnDatTruoc.LookAndFeel.UseDefaultLookAndFeel = false;
            btnDatTruoc.LookAndFeel.Style = DevExpress.LookAndFeel.LookAndFeelStyle.Skin;
            btnCoNguoi.Text            = "Có Người (" + BUS_BAN.DanhSachThongKe(dr11["IDChiNhanh"].ToString(), 2) + ")";
            btnCoNguoi.ForeColor       = Color.Red;
            btnCoNguoi.StyleController = null;
            btnCoNguoi.LookAndFeel.UseDefaultLookAndFeel = false;
            btnCoNguoi.LookAndFeel.Style = DevExpress.LookAndFeel.LookAndFeelStyle.Office2003;
            float SLPhucVu   = BUS_BAN.DanhSachThongKe(dr11["IDChiNhanh"].ToString(), 2);
            float TongSLBan  = BUS_BAN.DanhSachThongKe(dr11["IDChiNhanh"].ToString(), 2) + BUS_BAN.DanhSachThongKe(dr11["IDChiNhanh"].ToString(), 0) + BUS_BAN.DanhSachThongKe(dr11["IDChiNhanh"].ToString(), 1);
            float TyLePhucVu = SLPhucVu / (float)TongSLBan;

            txtTyLyPhucVu.Text = "Tỷ lệ phục vụ: " + Math.Round(TyLePhucVu, 2) * 100 + "%";
        }
예제 #2
0
        public void DanhSachBan()
        {
            IDBan = 0;
            tblTable1.Controls.Clear();
            string    IDChiNhanh = frmDangNhap.NguoiDung.Idchinhanh;
            DataTable dt         = BUS_KhuVuc.DanhSachBanTheoKhuVuc(IDChiNhanh);
            DataRow   dr11       = dt.Rows[0];

            btnTrong.Text = "Trống (" + BUS_BAN.DanhSachThongKe(dr11["ID"].ToString(), 0) + ")";

            btnDatTruoc.Text            = "Đã Đặt (" + BUS_BAN.DanhSachThongKe(dr11["ID"].ToString(), 1) + ")";
            btnDatTruoc.ForeColor       = Color.OrangeRed;
            btnDatTruoc.StyleController = null;
            btnDatTruoc.LookAndFeel.UseDefaultLookAndFeel = false;
            btnDatTruoc.LookAndFeel.Style = DevExpress.LookAndFeel.LookAndFeelStyle.Skin;

            btnCoNguoi.Text            = "Có Người (" + BUS_BAN.DanhSachThongKe(dr11["ID"].ToString(), 2) + ")";
            btnCoNguoi.ForeColor       = Color.Red;
            btnCoNguoi.StyleController = null;
            btnCoNguoi.LookAndFeel.UseDefaultLookAndFeel = false;
            btnCoNguoi.LookAndFeel.Style = DevExpress.LookAndFeel.LookAndFeelStyle.Office2003;

            float SLPhucVu   = BUS_BAN.DanhSachThongKe(dr11["ID"].ToString(), 2);
            float TongSLBan  = BUS_BAN.DanhSachThongKe(dr11["ID"].ToString(), 2) + BUS_BAN.DanhSachThongKe(dr11["ID"].ToString(), 0) + BUS_BAN.DanhSachThongKe(dr11["ID"].ToString(), 1);
            float TyLePhucVu = SLPhucVu / (float)TongSLBan;

            txtTyLyPhucVu.Text = "Tỷ lệ phục vụ: " + Math.Round(TyLePhucVu, 2) * 100 + "%";
            foreach (DataRow dr in dt.Rows)
            {
                string         TenKhuVuc = dr["TenKhuVuc"].ToString();
                string         IDKhuVuc  = dr["ID"].ToString();
                List <DTO_BAN> tablelist = DAO_BAN.Instance.LoadTableList(IDKhuVuc);
                foreach (DTO_BAN item in tablelist)
                {
                    int          TrangThai = item.Trangthai;
                    string       TenBan    = item.Tenban;
                    SimpleButton btn       = new SimpleButton();
                    btn.Width      = 80;
                    btn.Height     = 80;
                    btn.Text       = TenBan;
                    btn.Click     += btn_Click;
                    btn.MouseDown += btn_MouseDown;
                    btn.Tag        = item;
                    switch (TrangThai)
                    {
                    case 0:
                        tblTable1.Controls.Add(btn);
                        btn.ToolTip = "Bàn trống";
                        break;

                    case 1:
                        btn.ForeColor       = Color.OrangeRed;
                        btn.StyleController = null;
                        btn.LookAndFeel.UseDefaultLookAndFeel = false;
                        List <DTO_DatBan> thongtinnguoidat = DAO_DatBan.Instance.LoadTableList(item.Id);
                        foreach (DTO_DatBan dr1 in thongtinnguoidat)
                        {
                            btn.ToolTip = dr1.TenKhachHang + Environment.NewLine + dr1.DienThoai + Environment.NewLine + dr1.GioDat;
                        }
                        btn.LookAndFeel.Style = DevExpress.LookAndFeel.LookAndFeelStyle.Skin;
                        tblTable1.Controls.Add(btn);
                        break;

                    case 2:
                        btn.ForeColor       = Color.Red;
                        btn.StyleController = null;
                        btn.LookAndFeel.UseDefaultLookAndFeel = false;
                        btn.ToolTip           = "Bàn có người ngồi";
                        btn.LookAndFeel.Style = DevExpress.LookAndFeel.LookAndFeelStyle.Office2003;
                        tblTable1.Controls.Add(btn);
                        break;
                    }
                }
            }
        }