示例#1
0
        private void cmdInBN_Click(object sender, EventArgs e)
        {
            DataTable dtBN         = new DataTable();
            DataTable dtCheckPrint = new DataTable();

            txtSodoc.Text    = gridView1.GetRowCellValue(gridView1.FocusedRowHandle, "so_doc").ToString().Trim();
            txtTensodoc.Text = gridView1.GetRowCellValue(gridView1.FocusedRowHandle, "ten_so_doc").ToString();
            ////txtbd.Text = dt.Rows[0]["stt_order"].ToString();
            ////txtkt.Text = dt.Rows[dt.Rows.Count - 1]["stt_order"].ToString();
            //so_lan_in = GetData.Get_CheckPrint(dateEdit1.DateTime.Month, dateEdit1.DateTime.Year, txtSodoc.Text);
            dtBN      = GetData.Get_InvoiceListBN(txtSodoc.Text, dateEdit1.DateTime.Month, dateEdit1.DateTime.Year, Convert.ToInt32(txtbd.Text), Convert.ToInt32(txtkt.Text), "InvoiceListBN");
            so_lan_in = GetData.Get_CheckPrint(dateEdit1.DateTime.Month, dateEdit1.DateTime.Year, txtSodoc.Text);
            if (so_lan_in > 1)
            {
                DialogResult dialogResult = MessageBox.Show(String.Format("Sổ đọc {0} - {1} đã được in lần thứ {2}, bạn có muốn tiếp tục in?", txtSodoc.Text, txtTensodoc.Text, so_lan_in),
                                                            "Cảnh báo",
                                                            MessageBoxButtons.YesNo,
                                                            MessageBoxIcon.Warning);
                if (dialogResult == DialogResult.No)
                {
                    return;
                }
            }
            //XtraReportBN rp = new XtraReportBN(txtTensodoc.Text.Trim(),dateEdit1.Text);
            //XtraReportTTNS rp = new XtraReportTTNS(txtTensodoc.Text.Trim(), dateEdit1.Text);
            XtraReportTTNS rp = new XtraReportTTNS(dateEdit1.Text);

            //masterReport rp = new masterReport();
            //XtraReportPT rp = new XtraReportPT();
            rp.DataSource = dtBN;
            rp.CreateDocument();
            rp.ShowPreviewDialog();
        }
示例#2
0
        private void btnInLaiBN_Click(object sender, EventArgs e)
        {
            DataTable dtBN = new DataTable();

            //txtSodoc.Text = gridView1.GetRowCellValue(gridView1.FocusedRowHandle, "so_doc").ToString().Trim();
            //txtTensodoc.Text = gridView1.GetRowCellValue(gridView1.FocusedRowHandle, "ten_so_doc").ToString();

            ////txtbd.Text = dt.Rows[0]["stt_order"].ToString();
            ////txtkt.Text = dt.Rows[dt.Rows.Count - 1]["stt_order"].ToString();
            dtBN = GetData.Get_InvoiceListBNErr(dateEdit2.DateTime.Month, dateEdit2.DateTime.Year, Convert.ToInt32(txtbd.Text), Convert.ToInt32(txtkt.Text), "InvoiceListExcelErr");

            //XtraReportBN rp = new XtraReportBN(txtTensodoc.Text.Trim(),dateEdit1.Text);
            XtraReportTTNS rp = new XtraReportTTNS(dateEdit2.Text);

            //masterReport rp = new masterReport();
            //XtraReportPT rp = new XtraReportPT();
            rp.DataSource = dtBN;
            rp.CreateDocument();
            rp.ShowPreviewDialog();
        }