Пример #1
0
        private void mQuanLyKho_Click(object sender, EventArgs e)
        {
            lblTieuDe.Text = "Quản lý kho";
            Cursor.Current = Cursors.WaitCursor;
            XuLyChuyenForm();
            FrmQuanLyKho m_FrmQuanLyKho = FrmQuanLyKho.Instance;

            f = m_FrmQuanLyKho;
            m_FrmQuanLyKho.MdiParent = this;
            m_FrmQuanLyKho.Dock      = DockStyle.Fill;
            m_FrmQuanLyKho.Show();

            Label lbl = new Label();

            lbl.Dock      = DockStyle.Left;
            lbl.Text      = "Lập báo cáo nhanh";
            lbl.ForeColor = Color.CadetBlue;
            lbl.TextAlign = ContentAlignment.MiddleLeft;
            lbl.Font      = new Font("SegoeUI", 11, FontStyle.Bold);
            panelBaoCao.Controls.Add(lbl);
            lbl.BringToFront();

            MaterialFlatButton btnTatCaNguyenLieu = new MaterialFlatButton();

            btnTatCaNguyenLieu.Dock   = DockStyle.Left;
            btnTatCaNguyenLieu.Text   = "Tất cả nguyên liệu";
            btnTatCaNguyenLieu.Name   = "TatCaNguyenLieu";
            btnTatCaNguyenLieu.Click += btn_Click;
            panelBaoCao.Controls.Add(btnTatCaNguyenLieu);
            btnTatCaNguyenLieu.BringToFront();
        }
Пример #2
0
        private void LayDanhSachLoaiMon()
        {
            List <LoaiMonDTO> dsLoaiMon = LoaiMonBUS.LayDanhSachLoaiMon();

            foreach (LoaiMonDTO loaiMon in dsLoaiMon)
            {
                MaterialFlatButton btn = new MaterialFlatButton();
                btn.Text     = loaiMon.TenLoaiMon + " (" + MonBUS.LaySoLuongMonTheoLoai(loaiMon.MaLoaiMon) + ")";
                btn.Name     = loaiMon.MaLoaiMon.ToString();
                btn.AutoSize = false;
                btn.Size     = new Size(140, 60);
                btn.Dock     = DockStyle.Left;
                btn.Tag      = loaiMon;
                btn.Click   += new EventHandler(ChonLoai);
                panelLoai.Controls.Add(btn);
                btn.BringToFront();
            }

            MaterialFlatButton btnTatCa = new MaterialFlatButton();

            btnTatCa.Text     = "Tất cả" + " (" + MonBUS.LaySoLuongMonTheoLoai(0) + ")";;
            btnTatCa.Name     = "0";
            btnTatCa.AutoSize = false;
            btnTatCa.Size     = new Size(140, 60);
            btnTatCa.Dock     = DockStyle.Left;
            btnTatCa.Tag      = new LoaiMonDTO();
            btnTatCa.Click   += new EventHandler(ChonLoai);
            panelLoai.Controls.Add(btnTatCa);
        }
Пример #3
0
        private void mThongKeNhapHang_Click(object sender, EventArgs e)
        {
            lblTieuDe.Text = "Thống kê nhập hàng";
            Cursor.Current = Cursors.WaitCursor;
            XuLyChuyenForm();
            FrmThongKeNhapHang m_FrmThongKeNhapHang = FrmThongKeNhapHang.Instance;

            f = m_FrmThongKeNhapHang;
            m_FrmThongKeNhapHang.MdiParent = this;
            m_FrmThongKeNhapHang.Dock      = DockStyle.Fill;
            m_FrmThongKeNhapHang.Show();

            Label lbl = new Label();

            lbl.Dock      = DockStyle.Left;
            lbl.Text      = "Lập báo cáo nhanh";
            lbl.ForeColor = Color.CadetBlue;
            lbl.TextAlign = ContentAlignment.MiddleLeft;
            lbl.Font      = new Font("SegoeUI", 11, FontStyle.Bold);
            panelBaoCao.Controls.Add(lbl);
            lbl.BringToFront();

            MaterialFlatButton btnTatCaPhieuNhap = new MaterialFlatButton();

            btnTatCaPhieuNhap.Dock   = DockStyle.Left;
            btnTatCaPhieuNhap.Text   = "Tất cả phiếu nhập";
            btnTatCaPhieuNhap.Name   = "TatCaPhieuNhap";
            btnTatCaPhieuNhap.Click += btn_Click;
            panelBaoCao.Controls.Add(btnTatCaPhieuNhap);
            btnTatCaPhieuNhap.BringToFront();
        }
Пример #4
0
        private void mThongKeHoaDon_Click(object sender, EventArgs e)
        {
            lblTieuDe.Text = "Thống kê hoá đơn";
            Cursor.Current = Cursors.WaitCursor;
            XuLyChuyenForm();
            FrmThongKeHoaDon m_FrmThongKeHoaDon = FrmThongKeHoaDon.Instance;

            f = m_FrmThongKeHoaDon;
            m_FrmThongKeHoaDon.MdiParent = this;
            m_FrmThongKeHoaDon.Dock      = DockStyle.Fill;
            m_FrmThongKeHoaDon.Show();

            Label lbl = new Label();

            lbl.Dock      = DockStyle.Left;
            lbl.Text      = "Lập báo cáo nhanh";
            lbl.ForeColor = Color.CadetBlue;
            lbl.TextAlign = ContentAlignment.MiddleLeft;
            lbl.Font      = new Font("SegoeUI", 11, FontStyle.Bold);
            panelBaoCao.Controls.Add(lbl);
            lbl.BringToFront();

            MaterialFlatButton btnTatCaHoaDon = new MaterialFlatButton();

            btnTatCaHoaDon.Dock   = DockStyle.Left;
            btnTatCaHoaDon.Text   = "Tất cả hoá đơn";
            btnTatCaHoaDon.Name   = "TatCaHoaDon";
            btnTatCaHoaDon.Click += btn_Click;
            panelBaoCao.Controls.Add(btnTatCaHoaDon);
            btnTatCaHoaDon.BringToFront();
        }
Пример #5
0
        private void mBanHang_Click(object sender, EventArgs e)
        {
            lblTieuDe.Text = "Bán hàng";
            Cursor.Current = Cursors.WaitCursor;
            XuLyChuyenForm();
            FrmBanHang m_frmBanHang = FrmBanHang.Instance;

            f = m_frmBanHang;
            m_frmBanHang.MdiParent = this;
            m_frmBanHang.Dock      = DockStyle.Fill;
            m_frmBanHang.Show();

            Label lbl = new Label();

            lbl.Dock      = DockStyle.Left;
            lbl.Text      = "Tùy chọn nhanh";
            lbl.ForeColor = Color.CadetBlue;
            lbl.TextAlign = ContentAlignment.MiddleLeft;
            lbl.Font      = new Font("SegoeUI", 11, FontStyle.Bold);
            panelBaoCao.Controls.Add(lbl);
            lbl.BringToFront();

            MaterialFlatButton btnLichSuHoaDon = new MaterialFlatButton();

            btnLichSuHoaDon.Dock   = DockStyle.Left;
            btnLichSuHoaDon.Text   = "Lịch sử hoá đơn";
            btnLichSuHoaDon.Name   = "LichSuHoaDon";
            btnLichSuHoaDon.Click += btn_Click;
            panelBaoCao.Controls.Add(btnLichSuHoaDon);
            btnLichSuHoaDon.BringToFront();

            MaterialFlatButton btnHoaDonMoiNhat = new MaterialFlatButton();

            btnHoaDonMoiNhat.Dock   = DockStyle.Left;
            btnHoaDonMoiNhat.Text   = "Hóa đơn mới nhất";
            btnHoaDonMoiNhat.Name   = "HoaDonMoiNhat";
            btnHoaDonMoiNhat.Click += btn_Click;
            panelBaoCao.Controls.Add(btnHoaDonMoiNhat);
            btnHoaDonMoiNhat.BringToFront();

            MaterialFlatButton btnHoaDonTrongNgay = new MaterialFlatButton();

            btnHoaDonTrongNgay.Dock   = DockStyle.Left;
            btnHoaDonTrongNgay.Text   = "Hóa đơn trong ngày";
            btnHoaDonTrongNgay.Name   = "HoaDonTrongNgay";
            btnHoaDonTrongNgay.Click += btn_Click;
            panelBaoCao.Controls.Add(btnHoaDonTrongNgay);
            btnHoaDonTrongNgay.BringToFront();
        }
Пример #6
0
        private void LayDanhSachLoaiTopping(int maLoaiMon)
        {
            List <LoaiToppingDTO> dsLoaiTopping = LoaiToppingBUS.LayDanhSachCTLoaiMon_LoaiTopping(maLoaiMon);

            foreach (LoaiToppingDTO loaiTopping in dsLoaiTopping)
            {
                MaterialFlatButton btn = new MaterialFlatButton();
                btn.Text     = loaiTopping.TenLoaiTopping + " (" + ToppingBUS.LaySoLuongToppingTheoLoai(loaiTopping.MaLoaiTopping) + ")";
                btn.Name     = loaiTopping.MaLoaiTopping.ToString();
                btn.AutoSize = false;
                btn.Size     = new Size(140, 60);
                btn.Dock     = DockStyle.Left;
                btn.Tag      = loaiTopping;
                btn.Click   += new EventHandler(ChonLoai);
                panelLoai.Controls.Add(btn);
                btn.BringToFront();
            }
        }
Пример #7
0
        private void SetupRecentList()
        {
            RecentList.Controls.Clear();

            MaterialFlatButton       button;
            MaterialContextMenuStrip menu;

            foreach (string file in Config.GetRecentFiles())
            {
                Campaign campaign = Campaign.FromFile(file);

                if (!campaign)
                {
                    continue;
                }

                RecentList.Controls.Add(button = new MaterialFlatButton()
                {
                    Text        = campaign.name,
                    Dock        = DockStyle.Top,
                    MaximumSize = new Size(0, 28),
                    Tag         = file,
                });

                menu = new MaterialContextMenuStrip();
                menu.Items.Add("Remove", null, (sender, e) =>
                {
                    Config.RemoveRecentFile(file);
                    SetupRecentList();
                });

                button.Click += (sender, e) =>
                {
                    Globals.IsFileOpened = true;
                    Globals.MainWindow.GetPage <EditorMainPage>("pages:editormain").GoToFileTab();
                    Globals.MainWindow.GetPage <EditorMainPage>("pages:editormain").LoadCampaign(file);
                    Globals.MainWindow.SetPage("pages:editormain");
                };

                button.ContextMenuStrip = menu;

                button.BringToFront();
            }
        }
Пример #8
0
        //First Time Setup, should be called only once
        public void FirstTimeSetup(bool _show)
        {
            if (_show == true)
            {
                //Color bgCol = ColorTranslator.FromHtml("#0277BD");
                //welcomeBg.BackColor = bgCol;

                Size = new Size(1122, 720);

                welcomeBg.Visible = true;

                if (File.Exists(AppDomain.CurrentDomain.BaseDirectory + @"\resources\images\bg1.png"))
                {
                    welcomeBg.ImageLocation = AppDomain.CurrentDomain.BaseDirectory + @"\resources\images\bg1.png";
                }
                else
                {
                    MessageBox.Show(@"Cannot find \resources\images\bg1.png");
                }

                welcomeBg.Height = this.ClientSize.Height;
                welcomeBg.Width  = this.ClientSize.Width;
                Controls.Add(welcomeBg);
                welcomeBg.BringToFront();

                //Welcome Screen selectdir button
                welcomedirbtn.Visible = true;
                welcomedirbtn.Height  = 50;
                welcomedirbtn.Width   = 140;
                welcomedirbtn.Anchor  = AnchorStyles.None;
                welcomedirbtn.Text    = "Browse";
                Controls.Add(welcomedirbtn);
                welcomedirbtn.BringToFront();
                welcomedirbtn.MouseDown += welcomedirbtn_click;

                //Centers the button
                welcomedirbtn.Location = new Point((this.ClientSize.Width / 2) - (welcomedirbtn.Width / 2), (this.ClientSize.Height / 2) + (welcomedirbtn.Height / 2));
            }
            else
            {
                welcomeBg.Visible     = false;
                welcomedirbtn.Visible = false;
            }
        }
Пример #9
0
        private void mNhapHang_Click(object sender, EventArgs e)
        {
            lblTieuDe.Text = "Nhập hàng";
            Cursor.Current = Cursors.WaitCursor;
            XuLyChuyenForm();
            FrmNhapHang m_frmNhapHang = FrmNhapHang.Instance;

            f = m_frmNhapHang;
            m_frmNhapHang.MdiParent = this;
            m_frmNhapHang.Dock      = DockStyle.Fill;
            m_frmNhapHang.Show();

            Label lbl = new Label();

            lbl.Dock      = DockStyle.Left;
            lbl.Text      = "Lập báo cáo nhanh";
            lbl.ForeColor = Color.CadetBlue;
            lbl.TextAlign = ContentAlignment.MiddleLeft;
            lbl.Font      = new Font("SegoeUI", 11, FontStyle.Bold);
            panelBaoCao.Controls.Add(lbl);
            lbl.BringToFront();

            MaterialFlatButton btnPhieuNhapMoiNhat = new MaterialFlatButton();

            btnPhieuNhapMoiNhat.Dock   = DockStyle.Left;
            btnPhieuNhapMoiNhat.Text   = "Phiếu nhập mới nhất";
            btnPhieuNhapMoiNhat.Name   = "PhieuNhapMoiNhat";
            btnPhieuNhapMoiNhat.Click += btn_Click;
            panelBaoCao.Controls.Add(btnPhieuNhapMoiNhat);
            btnPhieuNhapMoiNhat.BringToFront();

            MaterialFlatButton btnPhieuNhapTrongNgay = new MaterialFlatButton();

            btnPhieuNhapTrongNgay.Dock   = DockStyle.Left;
            btnPhieuNhapTrongNgay.Text   = "Phiếu nhập trong ngày";
            btnPhieuNhapTrongNgay.Name   = "PhieuNhapTrongNgay";
            btnPhieuNhapTrongNgay.Click += btn_Click;
            panelBaoCao.Controls.Add(btnPhieuNhapTrongNgay);
            btnPhieuNhapTrongNgay.BringToFront();
        }