コード例 #1
0
        public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
        {
            rptMaVachTheGT rpt = new rptMaVachTheGT();

            rpt.Site = this.Site;
            return(rpt);
        }
コード例 #2
0
        private void frmBaoCaoBarcode_Load(object sender, EventArgs e)
        {
            try
            {
                switch (HanhDong)
                {
                case "MotCot":
                    if (Code.Length > 0)
                    {
                        Report.rptBarcode report = new Report.rptBarcode();
                        report.SetDataSource(Code);
                        crvReport.ReportSource = report;
                        crvReport.Show();
                    }
                    else
                    {
                        MessageBox.Show("Chưa có mã vạch để in hãy kiểm tra lại"); this.Close();
                    }
                    break;

                case "Loại A5":
                    if (Code.Length > 0)
                    {
                        Report.In_MaVach_Chuan report = new Report.In_MaVach_Chuan();
                        report.SetDataSource(Code);
                        crvReport.ReportSource = report;
                        crvReport.Show();
                    }
                    else
                    {
                        MessageBox.Show("Chưa có mã vạch để in hãy kiểm tra lại"); this.Close();
                    }
                    break;

                case "Loại 110":
                    if (Code.Length > 0)
                    {
                        Report.In_MaVach_ChuyenDung report = new Report.In_MaVach_ChuyenDung();
                        report.PrintOptions.PaperSize = PaperSize.DefaultPaperSize;
                        //report.PrintOptions.DissociatePageSizeAndPrinterPaperSize = true;
                        report.SetDataSource(Code);
                        ////report.Section3.Height = 300;
                        //report.PrintOptions.PageContentHeight
                        //report.PrintOptions.PaperSize = PaperSize.PaperLegal;
                        crvReport.ReportSource = report;
                        //crvReport.Size = new Size(300, 100);
                        //crvReport.ToolPanelWidth = 300;
                        //report.Section3.Height = 400;
                        //report.PrintOptions.PaperSize = PaperSize.PaperLegal;
                        //report.PrintOptions.DissociatePageSizeAndPrinterPaperSize = false;
                        crvReport.Show();
                    }
                    else
                    {
                        MessageBox.Show("Chưa có mã vạch để in hãy kiểm tra lại"); Close();
                    }
                    break;

                case "Loại A4":
                    if (Code.Length > 0)
                    {
                        Report.In_MaVach_Khac report = new Report.In_MaVach_Khac();
                        report.SetDataSource(Code);
                        crvReport.ReportSource = report;
                        crvReport.Show();
                    }
                    else
                    {
                        MessageBox.Show("Chưa có mã vạch để in hãy kiểm tra lại"); Close();
                    }
                    break;

                case "TV":
                    if (_maVach.Length > 0)
                    {
                        Report.rptMaVachTheVip report = new Report.rptMaVachTheVip();
                        report.SetDataSource(_maVach);
                        crvReport.ReportSource = report;
                        crvReport.Show();
                    }
                    else
                    {
                        MessageBox.Show("Chưa có mã vạch để in hãy kiểm tra lại"); Close();
                    }
                    break;

                case "TGT":
                    if (_maVach.Length > 0)
                    {
                        Report.rptMaVachTheGT report = new Report.rptMaVachTheGT();
                        report.SetDataSource(_maVach);
                        crvReport.ReportSource = report;
                        crvReport.Show();
                    }
                    else
                    {
                        MessageBox.Show("Chưa có mã vạch để in hãy kiểm tra lại"); Close();
                    }
                    break;

                default:
                    Close();
                    break;
                }
            }
            catch
            {
                MessageBox.Show("Thất bại"); Close();
            }
        }
コード例 #3
0
        private void ToolStripStatusLabel1Click(object sender, EventArgs e)
        {
            try
            {
                statusStrip1.Focus();
                //quyen
                if (!Common.Utilities.User.Administrator && !CheckQuyen(Name, 4))
                {
                    return;
                }

                if (checkBox1.Checked)
                {
                    if (dgvHangHoa.RowCount > 0)
                    {
                        Enabled = false;
                        Enabled = true;
                        Barcode[]   barCode  = GetProduct(dgvHangHoa, _congTy);
                        MaVachThe[] theGt    = GetTheGt(barCode, _congTy);
                        MaVachThe[] theVip   = GetTheVip(barCode, _congTy);
                        string      loaiGiay = cbxLoaigiay.SelectedItem.ToString();
                        switch (loaiGiay)
                        {
                        case "Loại A5":
                            //in theo 5 cot NGANG
                            if (barCode.Length > 0)
                            {
                                if (checkXemIn.Checked == false)
                                {
                                    Report.rptBarcodeNamCotA5 report = new Report.rptBarcodeNamCotA5();
                                    report.SetDataSource(barCode);
                                    report.PrintToPrinter(1, true, 0, 999);
                                }
                                else
                                {
                                    frmBaoCaoBarcode frm = new frmBaoCaoBarcode(barCode, "Loại A5", checkXemIn.Checked);
                                    frm.ShowDialog();
                                }
                            }
                            else
                            {
                                MessageBox.Show("Chọn " + GetTenRdo() + " mới có thể in");
                            }
                            break;

                        case "Loại 110":
                            // in theo 3 cot
                            if (barCode.Length > 0)
                            {
                                if (checkXemIn.Checked == false)
                                {
                                    Report.rptBarcodeBaCot report = new Report.rptBarcodeBaCot();
                                    report.SetDataSource(barCode);
                                    report.PrintToPrinter(1, true, 0, 999);
                                }
                                else
                                {
                                    frmBaoCaoBarcode frm = new frmBaoCaoBarcode(barCode, "Loại 110", checkXemIn.Checked);
                                    frm.ShowDialog();
                                }
                            }
                            else
                            {
                                MessageBox.Show("Chọn " + GetTenRdo() + " mới có thể in");
                            }
                            break;

                        case "Loại A4":
                            // in theo 5 cot
                            if (barCode.Length > 0)
                            {
                                if (checkXemIn.Checked == false)
                                {
                                    // Hang Hoa
                                    if (rdoHH.Checked)
                                    {
                                        Report.rptBarcodeNamCot report = new Report.rptBarcodeNamCot();
                                        report.SetDataSource(barCode);
                                        report.PrintToPrinter(1, true, 0, 999);
                                    }
                                    // The Vip
                                    if (rdoTV.Checked)
                                    {
                                        Report.rptMaVachTheVip report = new Report.rptMaVachTheVip();
                                        report.SetDataSource(theVip);
                                        report.PrintToPrinter(1, true, 0, 999);
                                    }
                                    // The GT
                                    if (rdoTGT.Checked)
                                    {
                                        Report.rptMaVachTheGT report = new Report.rptMaVachTheGT();
                                        report.SetDataSource(theGt);
                                        report.PrintToPrinter(1, true, 0, 999);
                                    }
                                }
                                else
                                {
                                    // Hang hoa
                                    if (rdoHH.Checked)
                                    {
                                        frmBaoCaoBarcode frm = new frmBaoCaoBarcode(barCode, "Loại A4", checkXemIn.Checked);
                                        frm.ShowDialog();
                                    }
                                    // The Vip
                                    if (rdoTV.Checked)
                                    {
                                        frmBaoCaoBarcode frm = new frmBaoCaoBarcode("TV", theVip);
                                        frm.ShowDialog();
                                    }
                                    // The GT
                                    if (rdoTGT.Checked)
                                    {
                                        frmBaoCaoBarcode frm = new frmBaoCaoBarcode("TGT", theGt);
                                        frm.ShowDialog();
                                    }
                                }
                            }
                            else
                            {
                                MessageBox.Show("Chọn " + GetTenRdo() + " mới có thể in");
                            }
                            break;
                        }
                    }
                    else
                    {
                        MessageBox.Show("Không có " + GetTenRdo() + " nào để in mã vạch");
                    }
                }
                else
                {
                    MessageBox.Show("Bạn đang chọn in một mã vạch"); checkBox1.Focus();
                }
            }
            catch
            {
            }
        }
コード例 #4
0
 public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
 {
     rptMaVachTheGT rpt = new rptMaVachTheGT();
     rpt.Site = this.Site;
     return rpt;
 }
コード例 #5
0
        private void frmBaoCaoBarcode_Load(object sender, EventArgs e)
        {
            try
            {
                switch (HanhDong)
                {
                    case "MotCot":
                        if (Code.Length > 0)
                        {
                            Report.rptBarcode report = new Report.rptBarcode();
                            report.SetDataSource(Code);
                            crvReport.ReportSource = report;
                            crvReport.Show();
                        }
                        else
                        { MessageBox.Show("Chưa có mã vạch để in hãy kiểm tra lại"); this.Close(); }
                        break;
                    case "Loại A5":
                        if (Code.Length > 0)
                        {
                            Report.In_MaVach_Chuan report = new Report.In_MaVach_Chuan();
                            report.SetDataSource(Code);
                            crvReport.ReportSource = report;
                            crvReport.Show();
                        }
                        else
                        { MessageBox.Show("Chưa có mã vạch để in hãy kiểm tra lại"); this.Close(); }
                        break;

                    case "Loại 110":
                        if (Code.Length > 0)
                        {
                            Report.In_MaVach_ChuyenDung report = new Report.In_MaVach_ChuyenDung();
                            report.PrintOptions.PaperSize = PaperSize.DefaultPaperSize;
                            //report.PrintOptions.DissociatePageSizeAndPrinterPaperSize = true;
                            report.SetDataSource(Code);
                            ////report.Section3.Height = 300;
                            //report.PrintOptions.PageContentHeight
                            //report.PrintOptions.PaperSize = PaperSize.PaperLegal;
                            crvReport.ReportSource = report;
                            //crvReport.Size = new Size(300, 100);
                            //crvReport.ToolPanelWidth = 300;
                            //report.Section3.Height = 400;
                            //report.PrintOptions.PaperSize = PaperSize.PaperLegal;
                            //report.PrintOptions.DissociatePageSizeAndPrinterPaperSize = false;
                            crvReport.Show();
                        }
                        else
                        { MessageBox.Show("Chưa có mã vạch để in hãy kiểm tra lại"); Close(); }
                        break;
                    case "Loại A4":
                        if (Code.Length > 0)
                        {
                            Report.In_MaVach_Khac report = new Report.In_MaVach_Khac();
                            report.SetDataSource(Code);
                            crvReport.ReportSource = report;
                            crvReport.Show();
                        }
                        else
                        { MessageBox.Show("Chưa có mã vạch để in hãy kiểm tra lại"); Close(); }
                        break;
                    case "TV":
                        if (_maVach.Length > 0)
                        {
                            Report.rptMaVachTheVip report = new Report.rptMaVachTheVip();
                            report.SetDataSource(_maVach);
                            crvReport.ReportSource = report;
                            crvReport.Show();
                        }
                        else
                        { MessageBox.Show("Chưa có mã vạch để in hãy kiểm tra lại"); Close(); }
                        break;
                    case "TGT":
                        if (_maVach.Length > 0)
                        {
                            Report.rptMaVachTheGT report = new Report.rptMaVachTheGT();
                            report.SetDataSource(_maVach);
                            crvReport.ReportSource = report;
                            crvReport.Show();
                        }
                        else
                        { MessageBox.Show("Chưa có mã vạch để in hãy kiểm tra lại"); Close(); }
                        break;
                    default:
                        Close();
                        break;
                }
            }
            catch
            {
                MessageBox.Show("Thất bại"); Close();
            }
        }
コード例 #6
0
        private void ToolStripStatusLabel1Click(object sender, EventArgs e)
        {
            try
            {
                statusStrip1.Focus();
                //quyen
                if (!Common.Utilities.User.Administrator && !CheckQuyen(Name, 4)) return;

                if (checkBox1.Checked)
                {
                    if (dgvHangHoa.RowCount > 0)
                    {
                        Enabled = false;
                        Enabled = true;
                        Barcode[] barCode = GetProduct(dgvHangHoa, _congTy);
                        MaVachThe[] theGt = GetTheGt(barCode, _congTy);
                        MaVachThe[] theVip = GetTheVip(barCode, _congTy);
                        string loaiGiay = cbxLoaigiay.SelectedItem.ToString();
                        switch (loaiGiay)
                        {
                            case "Loại A5":
                                //in theo 5 cot NGANG
                                if (barCode.Length > 0)
                                {
                                    if (checkXemIn.Checked == false)
                                    {
                                        Report.rptBarcodeNamCotA5 report = new Report.rptBarcodeNamCotA5();
                                        report.SetDataSource(barCode);
                                        report.PrintToPrinter(1, true, 0, 999);
                                    }
                                    else
                                    {

                                        frmBaoCaoBarcode frm = new frmBaoCaoBarcode(barCode, "Loại A5", checkXemIn.Checked);
                                        frm.ShowDialog();
                                    }
                                }
                                else
                                { MessageBox.Show("Chọn " + GetTenRdo() + " mới có thể in"); }
                                break;

                            case "Loại 110":
                                // in theo 3 cot
                                if (barCode.Length > 0)
                                {
                                    if (checkXemIn.Checked == false)
                                    {
                                        Report.rptBarcodeBaCot report = new Report.rptBarcodeBaCot();
                                        report.SetDataSource(barCode);
                                        report.PrintToPrinter(1, true, 0, 999);
                                    }
                                    else
                                    {
                                        frmBaoCaoBarcode frm = new frmBaoCaoBarcode(barCode, "Loại 110", checkXemIn.Checked);
                                        frm.ShowDialog();
                                    }
                                }
                                else
                                { MessageBox.Show("Chọn " + GetTenRdo() + " mới có thể in"); }
                                break;
                            case "Loại A4":
                                // in theo 5 cot
                                if (barCode.Length > 0)
                                {
                                    if (checkXemIn.Checked == false)
                                    {
                                        // Hang Hoa
                                        if (rdoHH.Checked)
                                        {
                                            Report.rptBarcodeNamCot report = new Report.rptBarcodeNamCot();
                                            report.SetDataSource(barCode);
                                            report.PrintToPrinter(1, true, 0, 999);
                                        }
                                        // The Vip
                                        if (rdoTV.Checked)
                                        {
                                            Report.rptMaVachTheVip report = new Report.rptMaVachTheVip();
                                            report.SetDataSource(theVip);
                                            report.PrintToPrinter(1, true, 0, 999);
                                        }
                                        // The GT
                                        if (rdoTGT.Checked)
                                        {
                                            Report.rptMaVachTheGT report = new Report.rptMaVachTheGT();
                                            report.SetDataSource(theGt);
                                            report.PrintToPrinter(1, true, 0, 999);
                                        }
                                    }
                                    else
                                    {
                                        // Hang hoa
                                        if (rdoHH.Checked)
                                        {
                                            frmBaoCaoBarcode frm = new frmBaoCaoBarcode(barCode, "Loại A4", checkXemIn.Checked);
                                            frm.ShowDialog();
                                        }
                                        // The Vip
                                        if (rdoTV.Checked)
                                        {
                                            frmBaoCaoBarcode frm = new frmBaoCaoBarcode("TV", theVip);
                                            frm.ShowDialog();
                                        }
                                        // The GT
                                        if (rdoTGT.Checked)
                                        {
                                            frmBaoCaoBarcode frm = new frmBaoCaoBarcode("TGT", theGt);
                                            frm.ShowDialog();
                                        }
                                    }
                                }
                                else
                                { MessageBox.Show("Chọn " + GetTenRdo() + " mới có thể in"); }
                                break;
                        }
                    }
                    else
                    { MessageBox.Show("Không có " + GetTenRdo() + " nào để in mã vạch"); }
                }
                else
                { MessageBox.Show("Bạn đang chọn in một mã vạch"); checkBox1.Focus(); }
            }
            catch
            {

            }
        }