Exemple #1
0
        public void InHD()
        {
            ExcelExport ex = new ExcelExport();

            if (dgvCTHD.Rows.Count == 0)
            {
                MessageBox.Show("Khong co du lieu de Xuat");
                return;
            }
            List <INHOADON> plistdiem = new List <INHOADON>();
            int             Stt       = 1;
            string          path      = "";

            foreach (DataGridViewRow item in dgvCTHD.Rows)
            {
                INHOADON d = new INHOADON();
                d.MANUOC    = item.Cells[0].Value.ToString();
                d.TENNUOC   = item.Cells[1].Value.ToString();
                d.SOLUONG   = int.Parse(item.Cells[2].Value.ToString());
                d.DONGIA    = double.Parse(item.Cells[3].Value.ToString());
                d.THANHTIEN = double.Parse(item.Cells[4].Value.ToString());
                d.STT       = Stt.ToString();
                Stt++;
                plistdiem.Add(d);

                path = string.Empty;
                ex.ExportKhoa(plistdiem, ref path, false, txtMaHD.Text, txtNgayLap.Text, cboNV.Text, cboBan.Text, double.Parse(txtTongTien.Text));
            }
            ex.OpenFile(path);
        }