Exemplo n.º 1
0
        private void QuanLyKhoHang_Load(object sender, EventArgs e)
        {
            this.Hide();
            tabControl1.Hide();
            tabControl2.Hide();
            tabControl3.Hide();
            tabControl4.Hide();
            DangNhap     fm     = new DangNhap();
            DialogResult result = fm.ShowDialog();

            if (result == DialogResult.Yes)
            {
                this.Show();
                this.Refresh();
            }
            else
            {
                this.Hide();
            }

            lbgetUser.Text   = "Xin chào " + strUser;
            this.WindowState = FormWindowState.Maximized;
            DateTime today = DateTime.Today;

            txtNgayNhap.Text = today.ToString();
            txtNgayCat.Text  = today.ToString();

            ds                       = getProduct();
            productTable             = ds.Tables[0];
            dataGridView1.DataSource = productTable;

            ds1                      = getLocationProduct();
            LocationProduct          = ds1.Tables[0];
            dataGridView2.DataSource = LocationProduct;

            ds2    = SapXep();
            sapxep = ds2.Tables[0];
            dataGridView3.DataSource = sapxep;
            dataGridView4.DataSource = sapxep;
            dataGridView5.DataSource = sapxep;
        }
 private void đăngXuấtToolStripMenuItem_Click(object sender, EventArgs e)
 {
     this.Hide();
     fm     = new DangNhap();
     result = fm.ShowDialog();
     this.Refresh();
     this.txtNgayNhap.Text = this.txtNgayCat.Text = (DateTime.Now).ToString();
     if (cc.KetNoi(sqlcnn) == true)
     {
         this.Hide();
         tabControl1.Hide();
         tabControl2.Hide();
         tabControl3.Hide();
         tabControl4.Hide();
         tabControlHistory.Hide();
         if (result == DialogResult.Yes)
         {
             this.Show();
         }
         else
         {
             this.Hide();
         }
     }
     else
     {
         MessageBox.Show("Chưa kết nối với CSDL");
     }
     label11.Text     = intLoai;
     lbgetUser.Text   = strUser;
     this.WindowState = FormWindowState.Maximized;
     tabControl1.Hide();
     tabControl2.Hide();
     tabControl3.Hide();
     tabControl4.Hide();
     tabControlHistory.Hide();
     panel4.Hide();
     dataGridView10.Hide();
 }
        private void QuanLyKhoHang_Load(object sender, EventArgs e)
        {
            this.Refresh();
            this.txtNgayNhap.Text = this.txtNgayCat.Text = (DateTime.Now).ToString();
            if (cc.KetNoi(sqlcnn) == true)
            {
                this.Hide();
                tabControl1.Hide();
                tabControl2.Hide();
                tabControl3.Hide();
                tabControl4.Hide();
                tabControlHistory.Hide();
                this.dataGridView10.Hide();
                label11.Hide();
                panel4.Hide();
                fm     = new DangNhap();
                result = fm.ShowDialog();
                if (result == DialogResult.Yes)
                {
                    this.Show();
                }
                else
                {
                    this.Hide();
                }

                label11.Text     = intLoai;
                lbgetUser.Text   = strUser;
                this.WindowState = FormWindowState.Maximized;
                DateTime today = DateTime.Today;
                txtNgayNhap.Text = today.ToString();
                txtNgayCat.Text  = today.ToString();

                ds                           = getNhapHang();
                productTable                 = ds.Tables[0];
                dataGridView1.DataSource     = productTable;
                dataGridViewInPut.DataSource = productTable;
                dataGridView8.DataSource     = productTable;

                ds      = getCatHang();
                CHTable = ds.Tables[0];
                dataGridView2.DataSource = CHTable;
                dataGridView6.DataSource = CHTable;
                //ds1 = getLocationProduct();
                //LocationProduct = ds1.Tables[0];
                //dataGridView2.DataSource = LocationProduct;
                //dataGridView6.DataSource = LocationProduct;

                ds      = getSanPham();
                SPTable = ds.Tables[0];
                dataGridView3.DataSource  = SPTable;
                dataGridView4.DataSource  = SPTable;
                dataGridView5.DataSource  = SPTable;
                dataGridView10.DataSource = SPTable;
                //ds2 = SapXep();
                //sapxep = ds2.Tables[0];
                //dataGridView3.DataSource = sapxep;
                //dataGridView4.DataSource = sapxep;
                //dataGridView5.DataSource = sapxep;

                ds      = getLayHang();
                LHTable = ds.Tables[0];
                dataGridView7.DataSource = LHTable;
                dataGridView9.DataSource = LHTable;
                //dataGridView7.DataSource = pick;
            }
            else
            {
                MessageBox.Show("Chưa kết nối với CSDL");
            }
        }