Ejemplo n.º 1
0
        private void btnLuu_Click(object sender, EventArgs e)
        {
            int     sl        = int.Parse(txtSL.Text);
            long    gia       = long.Parse(txtGiaNhap.Text);
            long    thanhtien = (long)sl * gia;
            long    masp      = long.Parse(cbbMaSP.SelectedValue.ToString());
            CTPNDTO ctpn      = new CTPNDTO(maphieu, masp, sl, gia, thanhtien);

            PhieuNhapBUS.InsertCTPN(ctpn);
            dgvNhapHang.DataSource = PhieuNhapBUS.GetCTPN(maphieu);
        }
Ejemplo n.º 2
0
        private void frmPhieuNhap_Load(object sender, EventArgs e)
        {
            DataTable ctpn = PhieuNhapBUS.GetCTPN(maphieunhap);
            DataTable pn   = PhieuNhapBUS.GetPhieuNhap(maphieunhap);

            //PhieuNhap pn = PhieuNhapBUS.GetPhieuNhap(maphieunhap);
            //QLshopthoitrangDataSet dataSet = new QLshopthoitrangDataSet();
            ReportParameter[] param = new ReportParameter[4];
            param[0] = new ReportParameter("MaPN", "" + maphieunhap);
            param[1] = new ReportParameter("NguoiLap", pn.Rows[0][1].ToString());
            param[2] = new ReportParameter("NgayLap", pn.Rows[0][2].ToString());
            param[3] = new ReportParameter("TongTien", pn.Rows[0][3].ToString());
            this.reportViewer1.LocalReport.SetParameters(param);
            ReportDataSource rds = new ReportDataSource("DataSetPhieuNhap", ctpn);

            this.reportViewer1.LocalReport.DataSources.Clear();
            this.reportViewer1.LocalReport.DataSources.Add(rds);
            this.reportViewer1.RefreshReport();
        }