private void HienThiDanhSanhSachPhieuXuat()
        {
            int i = 0;

            dgvPhieuXuat.Rows.Clear();
            List <PhieuXuatHang> pxlist = pxbll.GetAllListPhieuXuat();

            foreach (PhieuXuatHang pxs in pxlist)
            {
                DataGridViewRow row = new DataGridViewRow();
                row.CreateCells(dgvPhieuXuat);
                row.Cells[0].Value = i + 1;
                row.Cells[1].Value = pxs.MaPx;
                row.Cells[2].Value = pxs.MaNv;
                row.Cells[3].Value = pxs.MaSp;
                row.Cells[4].Value = pxs.MaKh;
                row.Cells[5].Value = pxs.Slx;
                row.Cells[6].Value = pxs.NgayXuat;
                row.Cells[7].Value = pxs.PhanTram;
                row.Cells[8].Value = pxs.ThanhTiens;

                dgvPhieuXuat.Rows.Add(row);
                ++i;
            }
            cboMaSp.DataSource = pxbll.ShowMaSanPham();
            cboMaKh.DataSource = pxbll.ShowMaKhachHang();
            cboSlx.DataSource  = pxbll.ShowSoLuongDatHang();
            txtMaNv.Text       = UserInfo.Id.ToString();
            txtTenNv.Text      = UserInfo.FullName.ToString();
        }
Exemplo n.º 2
0
        private void HienThiPhieuXuat()
        {
            dgvPhieuXuat.DataSource   = pxbll.ShowListPhieuXuat();
            dgvCTPX.DataSource        = pxbll.ShowListCTPX();
            cboMaKh.DataSource        = pxbll.ShowMaKhachHang();
            cboTenKh.DataSource       = pxbll.ShowTenKhachHang();
            cboMaSp.DataSource        = pxbll.ShowMaSanPham();
            cboMaDh.DataSource        = pxbll.ShowMaDonHang();
            cboSoLuongXuat.DataSource = pxbll.ShowSoLuongDatHang();
            txtMaNv.Text    = UserInfo.Id.ToString();
            cboMaSp.Enabled = false;
            txtMaNv.Enabled = false;
            txtMaPx.Enabled = false;

            // Căn chỉnh các columns trong DataGridView
            dgvPhieuXuat.ColumnHeadersDefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
            dgvCTPX.ColumnHeadersDefaultCellStyle.Alignment      = DataGridViewContentAlignment.MiddleCenter;
        }