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

            rpt.Site = this.Site;
            return(rpt);
        }
Beispiel #2
0
 private void btnOk_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         cls.ClsConnect();
         int      thamso = 7;
         string[] bien   = new string[thamso];
         object[] giatri = new object[thamso];
         bien[0]   = "@MaPos";
         giatri[0] = BienBll.NdMadv.Trim();
         bien[1]   = "@Thang";
         giatri[1] = bll.Left(comboBoxMonth.SelectedValue.ToString().Trim(), 2);
         bien[2]   = "@Nam";
         giatri[2] = comboBoxYear.SelectedValue.ToString().Trim();
         bien[3]   = "@DGiao";
         giatri[3] = CboDgiao.SelectedValue.ToString().Trim();
         bien[4]   = "@Giao";
         giatri[4] = CboGiao.SelectedValue.ToString().Trim();
         bien[5]   = "@Nhan";
         giatri[5] = CboNhan.SelectedValue.ToString().Trim();
         bien[6]   = "@Phong";
         giatri[6] = bll.Left(CboPhong.SelectedValue.ToString().Trim(), 2);
         if (Option1.IsChecked == true)
         {
             dt = cls.LoadDataProcPara("usp_Vpp02", bien, giatri, thamso);
         }
         else if (Option2.IsChecked == true)
         {
             dt = cls.LoadDataProcPara("usp_Vpp03", bien, giatri, thamso);
         }
         else
         {
             dt = cls.LoadDataProcPara("usp_Vpp04", bien, giatri, thamso);
         }
         if (dt.Rows.Count > 0)
         {
             if (Option1.IsChecked == true)
             {
                 if (BienBll.NdMadv.Trim() == BienBll.MainPos.Trim())
                 {
                     rpt_Vpp02 rpt = new rpt_Vpp02();
                     RPUtility.ShowRp(rpt, dt, this, srv.DbSourceSerVer(), srv.DbNameSerVer(), srv.DbUserSerVer(),
                                      srv.DbPassSerVer());
                 }
                 else
                 {
                     rpt_Vpp03 rpt = new rpt_Vpp03();
                     RPUtility.ShowRp(rpt, dt, this, srv.DbSourceSerVer(), srv.DbNameSerVer(), srv.DbUserSerVer(),
                                      srv.DbPassSerVer());
                 }
             }
             else if (Option2.IsChecked == true)
             {
                 rpt_Vpp04 rpt = new rpt_Vpp04();
                 RPUtility.ShowRp(rpt, dt, this, srv.DbSourceSerVer(), srv.DbNameSerVer(), srv.DbUserSerVer(),
                                  srv.DbPassSerVer());
             }
             else
             {
                 rpt_Vpp05 rpt = new rpt_Vpp05();
                 RPUtility.ShowRp(rpt, dt, this, srv.DbSourceSerVer(), srv.DbNameSerVer(), srv.DbUserSerVer(),
                                  srv.DbPassSerVer());
             }
         }
         else
         {
             MessageBox.Show("Không có bản ghi nào !", "Thông báo", MessageBoxButton.OK, MessageBoxImage.Information);
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Error", MessageBoxButton.OK, MessageBoxImage.Error);
     }
     cls.DongKetNoi();
 }