示例#1
0
        public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
        {
            rpt_QT_KHTCHuyen rpt = new rpt_QT_KHTCHuyen();

            rpt.Site = this.Site;
            return(rpt);
        }
示例#2
0
        private void btnOk_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                cls.ClsConnect();
                const int thamso = 2;
                string[]  bien   = new string[thamso];
                object[]  giatri = new object[thamso];
                bien[0] = "@Ngay";
                if (dtpNgay.SelectedDate != null)
                {
                    giatri[0] = dtpNgay.SelectedDate.Value.ToString("dd/MM/yyyy");
                }
                bien[1]   = "@MaPos";
                giatri[1] = bll.Left(CboPos.SelectedValue.ToString().Trim(), 6);
                //MessageBox.Show(giatri[0].ToString() + "   " + giatri[1].ToString());
                //dt = cls.LoadDataProcPara("usp_QT_KHTC", bien, giatri, thamso);
                cls.LoadDataProcPara("usp_QT_KHTC", bien, giatri, thamso);

                if (BienBll.NdMadv == BienBll.MainPos)
                {
                    if (bll.Left(CboPos.SelectedValue.ToString().Trim(), 6) == "003000")
                    {
                        string str1 = "select * from TAM_KHTC where MAU='1' order by TT";
                        dt = cls.LoadDataText(str1);
                        rpt_QT_KHTC rpt = new rpt_QT_KHTC();
                        RPUtility.ShowRp(rpt, dt, this, srv.DbSourceSerVer(), srv.DbNameSerVer(), srv.DbUserSerVer(),
                                         srv.DbPassSerVer());
                        string str2 = "select * from TAM_KHTC where MAU='2' order by TT";
                        dt = cls.LoadDataText(str2);
                        rpt_QT_KHTC rpt1 = new rpt_QT_KHTC();
                        RPUtility.ShowRp(rpt1, dt, this, srv.DbSourceSerVer(), srv.DbNameSerVer(), srv.DbUserSerVer(),
                                         srv.DbPassSerVer());
                    }
                    else
                    {
                        string str1 = "select * from TAM_KHTC where MAU='1' order by TT";
                        dt = cls.LoadDataText(str1);
                        rpt_QT_KHTCHuyen rpt = new rpt_QT_KHTCHuyen();
                        RPUtility.ShowRp(rpt, dt, this, srv.DbSourceSerVer(), srv.DbNameSerVer(), srv.DbUserSerVer(), srv.DbPassSerVer());
                        string str2 = "select * from TAM_KHTC where MAU='2' order by TT";
                        dt = cls.LoadDataText(str2);
                        rpt_QT_KHTCHuyen rpt1 = new rpt_QT_KHTCHuyen();
                        RPUtility.ShowRp(rpt1, dt, this, srv.DbSourceSerVer(), srv.DbNameSerVer(), srv.DbUserSerVer(), srv.DbPassSerVer());
                    }
                }
                else
                {
                    string str1 = "select * from TAM_KHTC where MAU='1' order by TT";
                    dt = cls.LoadDataText(str1);
                    rpt_QT_KHTCHuyen rpt = new rpt_QT_KHTCHuyen();
                    RPUtility.ShowRp(rpt, dt, this, srv.DbSourceSerVer(), srv.DbNameSerVer(), srv.DbUserSerVer(), srv.DbPassSerVer());
                    string str2 = "select * from TAM_KHTC where MAU='2' order by TT";
                    dt = cls.LoadDataText(str2);
                    rpt_QT_KHTCHuyen rpt1 = new rpt_QT_KHTCHuyen();
                    RPUtility.ShowRp(rpt1, dt, this, srv.DbSourceSerVer(), srv.DbNameSerVer(), srv.DbUserSerVer(), srv.DbPassSerVer());
                }

                cls.DongKetNoi();
            }
            catch (Exception ex)
            {
                MessageBox.Show("Lổi, liên hệ phòng tin học" + ex.Message, "Thông báo", MessageBoxButton.OK, MessageBoxImage.Error);
            }
        }