Example #1
0
        public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
        {
            InvoiceTotal rpt = new InvoiceTotal();

            rpt.Site = this.Site;
            return(rpt);
        }
Example #2
0
        private void button1_Click_1(object sender, EventArgs e)
        {
            DateTime DateTime1 = new DateTime(2009, 12, 27);
            DateTime DateTime2 = new DateTime(2010, 1, 3);

            ReportClass invoiceT = new InvoiceTotal();
            invoiceT.DataSourceConnections[0].SetConnection(Services.get_GUI.serverName, Services.get_GUI.databaseName, true);           
           
            invoiceT.SetParameterValue("@Store_ID", StaticClass.storeId);
            invoiceT.SetParameterValue("@DateTime1", DateTime1);
            invoiceT.SetParameterValue("@DateTime2", DateTime2);

            //ReportClass invoice = new rptItemDept();
            //string[] pa = {"@Store_ID","Report_Title_Param"};
            //string[] value = {StaticClass.storeId,"mat hang"};
            //test.FillDataReport(invoice,pa,value,true);
            //crystalReportViewer1.ReportSource = invoice;



            //ReportClass invoice = new rptInventoryByApha();
            //string[] pa = { "@Store_ID", "Report_Title_Param" };
            //string[] value = { StaticClass.storeId, "mat hang" };
            //test.FillDataReport(invoice, pa, value, true);
            //crystalReportViewer1.ReportSource = invoice;


            ReportClass invoice = new rptInvoiceTotalsDaily();
            string[] pa = { "@Store_ID", "Report_Title_Param" };
            string[] value = { StaticClass.storeId, "mat hang" };
            test.FillDataReport(invoice, pa, value, true);
            crystalReportViewer1.ReportSource = invoice;
            ////string[] para = {"@Store_ID", "Report_Title_Param" };
            ////string[] value = {StaticClass.storeId,"Invoice Daily"};

            ////test.FillDataReport(invoiceT, para, value, true);

            ////invoiceT.SetParameterValue("@Store_ID", StaticClass.storeId);
            ////invoiceT.SetParameterValue("Report_Title_Param", "thanh report");
            //crystalReportViewer1.ReportSource = invoiceT;
            //string[] para = { "@Store_ID", "Report_Title_Param" };
            //string[] value = { StaticClass.storeId, "Invoice Daily" };
            //rptItemDept t = new rptItemDept();
            //test.FillDataReport(t, para, value, true);
            //crystalReportViewer1.ReportSource = invoiceT};
            ////crystalReportViewer1.Update();
            //invoiceT.PrintToPrinter(1, false, 1, 1);

            //string result = MessBox2Choice.ShowBox("Do you want to exit?",Color.Red);
            //if (result.Equals("1"))
            //{
            //    MessageBox.Show("OK Button was Clicked");
            //}

            //if (result.Equals("2"))
            //{
            //    MessageBox.Show("Cancel Button was Clicked");
            //}
        }
Example #3
0
        private ReportClass ViewReport(int s)
        {
            //EnableDateTime();
            switch (s)
            {
            case 0:
            {
                if (DateTime2.Ticks <= DateTime1.Ticks)
                {
                    Alert.Show("Nhập Ngày Sai.\n Nhập lại ngày", Color.Red);
                    return(null);
                }
                string status = "";
                if (StatusInvoice == Const.Invoice_Status.THANH_TOAN_ROI)
                {
                    status = "Hóa đơn thanh toán";
                }
                else if (StatusInvoice == Const.Invoice_Status.HUY)
                {
                    status = "Hóa đơn hủy";
                }
                POSReport.Report.InvoiceTotal invoiceTotal = new POSReport.Report.InvoiceTotal();
                string[] pa    = { "@Store_ID", "@DateTime1", "@DateTime2", "@Status", "@Cashier_ID", "HuyOrThanhToan" };
                object[] value = { StaticClass.storeId, DateTime1, DateTime2, StatusInvoice, Cashier_ID, status };
                test.FillDataReport(invoiceTotal, pa, value, true);
                return(invoiceTotal);
            }

            case 1:
            {
                string status = "";
                if (StatusInvoice == Const.Invoice_Status.THANH_TOAN_ROI)
                {
                    status = "Hóa đơn thanh toán";
                }
                else if (StatusInvoice == Const.Invoice_Status.HUY)
                {
                    status = "Hóa đơn hủy";
                }
                POSReport.Report.rptInvoiceTotalsDaily invoiceTotalsDaily = new rptInvoiceTotalsDaily();
                string[] pa    = { "@Store_ID", "Report_Title_Param", "@Status", "@Cashier_ID", "HuyOrThanhToan" };
                object[] value = { StaticClass.storeId, "Báo cáo hóa đơn theo từng ngày", StatusInvoice, Cashier_ID, status };
                test.FillDataReport(invoiceTotalsDaily, pa, value, true);
                return(invoiceTotalsDaily);
            }

            case 2:
            {
                POSReport.Report.rptDetailSaleReport DetailSaleReport = new rptDetailSaleReport();
                string[] pa    = { "@Store_ID", "@DateTime1", "@DateTime2", "@Status", "@Cashier_ID", "Report Title", };
                object[] value = { StaticClass.storeId, DateTime1, DateTime2, StatusInvoice, Cashier_ID, "Báo cáo bán hàng chi tiết trong ngày" };
                test.FillDataReport(DetailSaleReport, pa, value, true);
                return(DetailSaleReport);
            }

            case 3:
            {
                POSReport.Report.rptReturn rptReturn = new rptReturn();
                string[] pa    = { "@Store_ID", "@DateTime1", "@DateTime2", "@Status", "@Cashier_ID", "Report_Title", };
                object[] value = { StaticClass.storeId, DateTime1, DateTime2, StatusInvoice, Cashier_ID, "Báo cáo các mặt hàng trả lại" };
                test.FillDataReport(rptReturn, pa, value, true);
                return(rptReturn);
            }

            case 4:
            {
                POSReport.Report.rptItemDept invoice = new rptItemDept();
                string[] pa    = { "@Store_ID", "Report_Title_Param", "@Status", "@DateTime1", "@DateTime2" };
                object[] value = { StaticClass.storeId, "Báo cáo chi tiết bán hàng theo nhóm", StatusInvoice, DateTime1, DateTime2 };
                test.FillDataReport(invoice, pa, value, true);
                return(invoice);
            }

            case 5:
            {
                POSReport.Report.rptItemDetail invoice = new rptItemDetail();
                string[] pa    = { "@Store_ID", "@ReportTitle", "@Status", "@DateTime1", "@DateTime2" };
                object[] value = { StaticClass.storeId, "Báo cáo chi tiết bán hàng theo từng mặt hàng", StatusInvoice, DateTime1, DateTime2 };
                test.FillDataReport(invoice, pa, value, true);
                return(invoice);
            }

            case 40:
            {
                POSReport.Report.rptInventoryByApha rptInventoryByApha = new rptInventoryByApha();
                string[] pa    = { "@Store_ID", "Report_Title_Param" };
                string[] value = { StaticClass.storeId, "Báo cáo tồn kho" };
                test.FillDataReport(rptInventoryByApha, pa, value, true);
                return(rptInventoryByApha);
            }

            case 41:
            {
                POSReport.Report.rptReceivedItems invoice = new rptReceivedItems();
                string[] pa    = { "@DateTime1", "@DateTime2" };
                object[] value = { DateTime1, DateTime2 };
                test.FillDataReport(invoice, pa, value, true);
                return(invoice);
            }

            case 42:
            {
                POSReport.Report.rptReOrderReport report = new rptReOrderReport();
                string[] pa    = { "@Store_ID" };
                object[] value = { StaticClass.storeId };
                test.FillDataReport(report, pa, value, true);
                return(report);
            }

            default:
                return(null);
            }
        }
Example #4
0
 public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() {
     InvoiceTotal rpt = new InvoiceTotal();
     rpt.Site = this.Site;
     return rpt;
 }
Example #5
0
        private ReportClass ViewReport(int s)
        {
            //EnableDateTime();
            switch (s)
            {
                case 0:
                    {
                        if(DateTime2.Ticks<=DateTime1.Ticks)
                        {
                            Alert.Show("Nhập Ngày Sai.\n Nhập lại ngày",Color.Red);
                            return null;
                        }
                        string status = "";
                        if(StatusInvoice==Const.Invoice_Status.THANH_TOAN_ROI)
                        {
                            status = "Hóa đơn thanh toán";
                        }else if(StatusInvoice==Const.Invoice_Status.HUY)
                        {
                            status = "Hóa đơn hủy";
                        }
                        POSReport.Report.InvoiceTotal invoiceTotal = new POSReport.Report.InvoiceTotal();
                        string[] pa = { "@Store_ID", "@DateTime1", "@DateTime2", "@Status", "@Cashier_ID","HuyOrThanhToan" };
                        object[] value = { StaticClass.storeId, DateTime1, DateTime2,StatusInvoice,Cashier_ID,status};
                        test.FillDataReport(invoiceTotal, pa, value, true);
                        return invoiceTotal;
                    }
                    
                case 1:
                    {
                        string status = "";
                        if (StatusInvoice == Const.Invoice_Status.THANH_TOAN_ROI)
                        {
                            status = "Hóa đơn thanh toán";
                        }
                        else if (StatusInvoice == Const.Invoice_Status.HUY)
                        {
                            status = "Hóa đơn hủy";
                        }
                        POSReport.Report.rptInvoiceTotalsDaily invoiceTotalsDaily = new rptInvoiceTotalsDaily();
                        string[] pa = { "@Store_ID", "Report_Title_Param", "@Status", "@Cashier_ID", "HuyOrThanhToan" };
                        object[] value = { StaticClass.storeId, "Báo cáo hóa đơn theo từng ngày", StatusInvoice, Cashier_ID, status };
                        test.FillDataReport(invoiceTotalsDaily, pa, value, true);
                        return invoiceTotalsDaily;
                    }
                case 2:
                    {

                        POSReport.Report.rptDetailSaleReport DetailSaleReport = new rptDetailSaleReport();
                        string[] pa = { "@Store_ID", "@DateTime1", "@DateTime2", "@Status", "@Cashier_ID", "Report Title", };
                        object[] value = { StaticClass.storeId, DateTime1, DateTime2, StatusInvoice, Cashier_ID, "Báo cáo bán hàng chi tiết trong ngày" };
                        test.FillDataReport(DetailSaleReport, pa, value, true);
                        return DetailSaleReport;
                    }
                case 3:
                    {
                        POSReport.Report.rptReturn rptReturn = new rptReturn();
                        string[] pa = { "@Store_ID", "@DateTime1", "@DateTime2", "@Status", "@Cashier_ID", "Report_Title", };
                        object[] value = { StaticClass.storeId, DateTime1, DateTime2, StatusInvoice, Cashier_ID, "Báo cáo các mặt hàng trả lại" };
                        test.FillDataReport(rptReturn, pa, value, true);
                        return rptReturn;
                    }
                case 4:
                    {
                        POSReport.Report.rptItemDept invoice = new rptItemDept();
                        string[] pa = { "@Store_ID", "Report_Title_Param", "@Status", "@DateTime1", "@DateTime2" };
                        object[] value = { StaticClass.storeId, "Báo cáo chi tiết bán hàng theo nhóm", StatusInvoice, DateTime1, DateTime2 };
                        test.FillDataReport(invoice, pa, value, true);
                        return invoice;
                    }
                case 5:
                    {
                        POSReport.Report.rptItemDetail invoice = new rptItemDetail();
                        string[] pa = { "@Store_ID", "@ReportTitle", "@Status", "@DateTime1", "@DateTime2" };
                        object[] value = { StaticClass.storeId, "Báo cáo chi tiết bán hàng theo từng mặt hàng", StatusInvoice, DateTime1, DateTime2 };
                        test.FillDataReport(invoice, pa, value, true);
                        return invoice;
                    }

                case 40:
                    {
                        POSReport.Report.rptInventoryByApha rptInventoryByApha = new rptInventoryByApha();
                        string[] pa = { "@Store_ID", "Report_Title_Param" };
                        string[] value = { StaticClass.storeId, "Báo cáo tồn kho" };
                        test.FillDataReport(rptInventoryByApha, pa, value, true);
                        return rptInventoryByApha; 
                    }

                case 41:
                    {
                        POSReport.Report.rptReceivedItems invoice = new rptReceivedItems();
                        string[] pa = { "@DateTime1", "@DateTime2" };
                        object[] value = { DateTime1, DateTime2 };
                        test.FillDataReport(invoice, pa, value, true);
                        return invoice;
                    }
                case 42:
                    {
                        POSReport.Report.rptReOrderReport report = new rptReOrderReport();
                        string[] pa = { "@Store_ID" };
                        object[] value = { StaticClass.storeId };
                        test.FillDataReport(report, pa, value, true);
                        return report;
                    }
                default:
                    return null;
            }     

        }
Example #6
0
        private ReportClass ViewReport(int s)
        {
            EnableDateTime();
            switch (s)
            {
                case 0:
                    {
                        if(DateTime2.Ticks<=DateTime1.Ticks)
                        {
                            Alert.Show("Nhập Ngày Sai.\n Nhập lại ngày",Color.Red);
                            return null;
                        }
                        POSReport.Report.InvoiceTotal invoiceTotal = new POSReport.Report.InvoiceTotal();
                        string[] pa = { "@Store_ID", "@DateTime1", "@DateTime2", "@Status", "@Cashier_ID" };
                        object[] value = { StaticClass.storeId, DateTime1, DateTime2,StatusInvoice,Cashier_ID};
                        test.FillDataReport(invoiceTotal, pa, value, true);
                        return invoiceTotal;
                    }
                    
                case 1:
                    {
                        POSReport.Report.rptInvoiceTotalsDaily invoiceTotalsDaily = new rptInvoiceTotalsDaily();
                        string[] pa = { "@Store_ID", "Report_Title_Param", "@Status", "@Cashier_ID" };
                        object[] value = { StaticClass.storeId, "Báo cáo hóa đơn theo từng ngày", StatusInvoice, Cashier_ID };
                        test.FillDataReport(invoiceTotalsDaily, pa, value, true);
                        return invoiceTotalsDaily;
                    }
                case 2:
                    {

                        POSReport.Report.rptDetailSaleReport DetailSaleReport = new rptDetailSaleReport();
                        string[] pa = { "@Store_ID", "@DateTime1", "@DateTime2", "@Status", "@Cashier_ID", "Report Title", };
                        object[] value = { StaticClass.storeId, DateTime1, DateTime2, StatusInvoice, Cashier_ID, "Báo cáo bán hàng chi tiết trong ngày" };
                        test.FillDataReport(DetailSaleReport, pa, value, true);
                        return DetailSaleReport;
                    }
                case 3:
                    {
                        POSReport.Report.rptReturn rptReturn = new rptReturn();
                        string[] pa = { "@Store_ID", "@DateTime1", "@DateTime2", "@Status", "@Cashier_ID", "Report_Title", };
                        object[] value = { StaticClass.storeId, DateTime1, DateTime2, StatusInvoice, Cashier_ID, "Báo cáo các mặt hàng trả lại" };
                        test.FillDataReport(rptReturn, pa, value, true);
                        return rptReturn;
                    }
                case 4:
                    {
                        POSReport.Report.rptItemDept invoice = new rptItemDept();
                        string[] pa = { "@Store_ID", "Report_Title_Param", "@Status" };
                        string[] value = { StaticClass.storeId, "Báo cáo chi tiết bán hàng theo nhóm", StatusInvoice };
                        test.FillDataReport(invoice, pa, value, true);
                        return invoice;
                    }
                case 40:
                    {
                        POSReport.Report.rptInventoryByApha rptInventoryByApha = new rptInventoryByApha();
                        string[] pa = { "@Store_ID", "Report_Title_Param" };
                        string[] value = { StaticClass.storeId, "Tình hình các mặt hàng trong kho" };
                        test.FillDataReport(rptInventoryByApha, pa, value, true);
                        return rptInventoryByApha; 
                    }

                //case 41:
                //    {
                //        POSReport.Report.rptItemDept invoice = new rptItemDept();
                //        string[] pa = { "@Store_ID", "Report_Title_Param", "@Status"};
                //        string[] value = { StaticClass.storeId, "Báo cáo chi tiết bán hàng theo nhóm",StatusInvoice};
                //        test.FillDataReport(invoice, pa, value, true);
                //        return invoice;
                //    }

                default:
                    return null;
            }     

        }
Example #7
0
        private ReportClass ViewReport(int s)
        {
            EnableDateTime();
            switch (s)
            {
            case 0:
            {
                if (DateTime2.Ticks <= DateTime1.Ticks)
                {
                    Alert.Show("Nhập Ngày Sai.\n Nhập lại ngày", Color.Red);
                    return(null);
                }
                POSReport.Report.InvoiceTotal invoiceTotal = new POSReport.Report.InvoiceTotal();
                string[] pa    = { "@Store_ID", "@DateTime1", "@DateTime2", "@Status", "@Cashier_ID" };
                object[] value = { StaticClass.storeId, DateTime1, DateTime2, StatusInvoice, Cashier_ID };
                test.FillDataReport(invoiceTotal, pa, value, true);
                return(invoiceTotal);
            }

            case 1:
            {
                POSReport.Report.rptInvoiceTotalsDaily invoiceTotalsDaily = new rptInvoiceTotalsDaily();
                string[] pa    = { "@Store_ID", "Report_Title_Param", "@Status", "@Cashier_ID" };
                object[] value = { StaticClass.storeId, "Báo cáo hóa đơn theo từng ngày", StatusInvoice, Cashier_ID };
                test.FillDataReport(invoiceTotalsDaily, pa, value, true);
                return(invoiceTotalsDaily);
            }

            case 2:
            {
                POSReport.Report.rptDetailSaleReport DetailSaleReport = new rptDetailSaleReport();
                string[] pa    = { "@Store_ID", "@DateTime1", "@DateTime2", "@Status", "@Cashier_ID", "Report Title", };
                object[] value = { StaticClass.storeId, DateTime1, DateTime2, StatusInvoice, Cashier_ID, "Báo cáo bán hàng chi tiết trong ngày" };
                test.FillDataReport(DetailSaleReport, pa, value, true);
                return(DetailSaleReport);
            }

            case 3:
            {
                POSReport.Report.rptReturn rptReturn = new rptReturn();
                string[] pa    = { "@Store_ID", "@DateTime1", "@DateTime2", "@Status", "@Cashier_ID", "Report_Title", };
                object[] value = { StaticClass.storeId, DateTime1, DateTime2, StatusInvoice, Cashier_ID, "Báo cáo các mặt hàng trả lại" };
                test.FillDataReport(rptReturn, pa, value, true);
                return(rptReturn);
            }

            case 4:
            {
                POSReport.Report.rptItemDept invoice = new rptItemDept();
                string[] pa    = { "@Store_ID", "Report_Title_Param", "@Status" };
                string[] value = { StaticClass.storeId, "Báo cáo chi tiết bán hàng theo nhóm", StatusInvoice };
                test.FillDataReport(invoice, pa, value, true);
                return(invoice);
            }

            case 40:
            {
                POSReport.Report.rptInventoryByApha rptInventoryByApha = new rptInventoryByApha();
                string[] pa    = { "@Store_ID", "Report_Title_Param" };
                string[] value = { StaticClass.storeId, "Tình hình các mặt hàng trong kho" };
                test.FillDataReport(rptInventoryByApha, pa, value, true);
                return(rptInventoryByApha);
            }

            //case 41:
            //    {
            //        POSReport.Report.rptItemDept invoice = new rptItemDept();
            //        string[] pa = { "@Store_ID", "Report_Title_Param", "@Status"};
            //        string[] value = { StaticClass.storeId, "Báo cáo chi tiết bán hàng theo nhóm",StatusInvoice};
            //        test.FillDataReport(invoice, pa, value, true);
            //        return invoice;
            //    }

            default:
                return(null);
            }
        }