コード例 #1
0
ファイル: frmBanHang.cs プロジェクト: projectgpm/CaFeMienPhi
        /// <summary>
        /// danh sách bàn theo IDChiNhanh done
        /// </summary>
        public void DanhSachBan()
        {
            ClearTabControl();
            DataTable dt = BUS_KhuVuc.DanhSachBanTheoKhuVuc(frmDangNhap.NguoiDung.Idchinhanh);

            if (dt.Rows.Count > 0)
            {
                ThongKe(dt);
            }
            else
            {
                MessageBox.Show("Danh sách bàn trống", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            foreach (DataRow dr in dt.Rows)
            {
                string          TenKhuVucNull = dr["TenKhuVuc"].ToString();
                string          IDKhuVucNull  = dr["ID"].ToString();
                FlowLayoutPanel layout        = new FlowLayoutPanel();
                layout.Dock       = DockStyle.Fill;
                layout.AutoScroll = true;
                AddTabControl(TenKhuVucNull, IDKhuVucNull, layout);
                BanKhuVuc(IDKhuVucNull, layout);
            }
            xtraTabControlDanhSach.SelectedTabPageIndex = TabActive;
        }
コード例 #2
0
ファイル: frmTachBan.cs プロジェクト: projectgpm/CaFeMienPhi
        public void LamMoi()
        {
            DanhSachHangHoaA();
            int IDBan = DAO_Setting.KiemtraGiaDien(frmDangNhap.NguoiDung.Idchinhanh) == 0 ? frmBanHang.IDBan : frmBanHang2.IDBan;

            cmbBanA.Properties.NullText = DAO_ChuyenBan.LayTenBan(IDBan);
            int IDkhuVuc = DAO_ChuyenBan.LayIDKhuVuc(IDBan);

            cmbKhuVucA.Properties.NullText = DAO_ChuyenBan.LayTenKhuVuc(IDkhuVuc).ToString();
            DataTable dt = BUS_KhuVuc.DanhSachBanTheoKhuVuc(IDChiNhanh);

            cmbKhuVucB.Properties.DataSource    = dt;
            cmbKhuVucB.Properties.ValueMember   = "ID";
            cmbKhuVucB.Properties.DisplayMember = "TenKhuVuc";
        }
コード例 #3
0
        private void frmChuyenBan_Load(object sender, EventArgs e)
        {
            DanhSachHangHoaA();
            gridViewA.OptionsSelection.EnableAppearanceFocusedRow = false; // Ẩn dòng đầu...
            gridViewB.OptionsSelection.EnableAppearanceFocusedRow = false; // Ẩn dòng đầu...

            cmbBanA.Properties.NullText = DAO_ChuyenBan.LayTenBan(DAO_Setting.KiemtraGiaDien(frmDangNhap.NguoiDung.Idchinhanh) == 0 ? frmBanHang.IDBan : frmBanHang2.IDBan);
            int IDkhuVuc = DAO_ChuyenBan.LayIDKhuVuc(DAO_Setting.KiemtraGiaDien(frmDangNhap.NguoiDung.Idchinhanh) == 0 ? frmBanHang.IDBan : frmBanHang2.IDBan);

            cmbKhuVucA.Properties.NullText = DAO_ChuyenBan.LayTenKhuVuc(IDkhuVuc).ToString();
            DataTable dt = BUS_KhuVuc.DanhSachBanTheoKhuVuc(IDChiNhanh);

            cmbKhuVucB.Properties.DataSource    = dt;
            cmbKhuVucB.Properties.ValueMember   = "ID";
            cmbKhuVucB.Properties.DisplayMember = "TenKhuVuc";
        }
コード例 #4
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;
                    }
                }
            }
        }