Esempio n. 1
0
        private void btntrangchu_Click(object sender, EventArgs e)
        {
            panel2.Controls.Clear();
            page_banhang trangchu = new page_banhang();

            panel2.Controls.Add(trangchu);
            btntrangchu.Normalcolor  = Color.IndianRed;
            btnthucdon.Normalcolor   = Color.Transparent;
            btnnhanvien.Normalcolor  = Color.Transparent;
            btnquanlikho.Normalcolor = Color.Transparent;
            btnkhachhang.Normalcolor = Color.Transparent;
            btnthongke.Normalcolor   = Color.Transparent;
        }
Esempio n. 2
0
        private void Page_Main_Load(object sender, EventArgs e)
        {
            phanquyen();
            loadcanhbao();
            btntrangchu.BackColor  = Color.Transparent;
            btnthucdon.BackColor   = Color.Transparent;
            btnquanlikho.BackColor = Color.Transparent;
            btnnhanvien.BackColor  = Color.Transparent;
            btnthongke.BackColor   = Color.Transparent;
            btnkhachhang.BackColor = Color.Transparent;
            page_banhang trangchu = new page_banhang();

            panel2.Controls.Add(trangchu);
        }
Esempio n. 3
0
        private void VideoCaptureDevice_NewFrame(object sender, NewFrameEventArgs eventArgs)
        {
            Bitmap        bitmap = (Bitmap)eventArgs.Frame.Clone();
            BarcodeReader reader = new BarcodeReader();
            var           result = reader.Decode(bitmap);

            if (result != null)
            {
                textBox1.Invoke(new MethodInvoker(delegate()
                {
                    textBox1.Text   = result.ToString();
                    page_banhang bh = new page_banhang();
                    bh.getID(textBox1.Text);
                    bh.Show();
                    this.Hide();
                }));
            }
            pictureBox1.Image = bitmap;
        }
Esempio n. 4
0
        public void phanquyen()
        {
            using (DatabaseQLTSEntities quanli = new DatabaseQLTSEntities())
            {
                string[] username = label1.Text.Split(':');
                string   user     = username[1].ToString();
                Console.WriteLine(user);
                NhanVien nv   = quanli.NhanViens.FirstOrDefault(p => p.TenDangNhap == user.Trim());
                int      macv = (int)nv.IdChucVu;
                ChucVu   cv   = quanli.ChucVus.FirstOrDefault(p => p.IdChucVu == macv);
                if (cv.BanHang == false)
                {
                    btntrangchu.Visible = false;
                }
                else
                {
                    page_banhang trangchu = new page_banhang(username[1], null);
                    panel2.Controls.Add(trangchu);
                    dem++;
                }

                if (cv.QuanLy == false)
                {
                    btnnhanvien.Visible = false;
                }
                else
                {
                    if (dem == 0)
                    {
                        page_nhanvien nhanvien = new page_nhanvien();
                        panel2.Controls.Add(nhanvien);
                        dem++;
                    }
                }
                if (cv.ThongKe == false)
                {
                    btnthongke.Visible = false;
                }
                else
                {
                    if (dem == 0)
                    {
                        page_thongke nhanvien = new page_thongke();

                        panel2.Controls.Add(nhanvien);
                        dem++;
                    }
                }
                if (cv.Kho == false)
                {
                    btnquanlikho.Visible = false;
                }

                else
                {
                    if (dem == 0)
                    {
                        page_nguyenlieu nguyenlieu = new page_nguyenlieu(username[1], erro());

                        panel2.Controls.Add(nguyenlieu);
                        dem++;
                    }
                }
                if (cv.KhachHang == false)
                {
                    btnkhachhang.Visible = false;
                }
                else
                {
                    if (dem == 0)
                    {
                        page_khachhang nhanvien = new page_khachhang();

                        panel2.Controls.Add(nhanvien);
                        dem++;
                    }
                }
            }
        }