public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() { rpt_KH_XA_MOI rpt = new rpt_KH_XA_MOI(); rpt.Site = this.Site; return(rpt); }
private void BtnOk_OnClick(object sender, RoutedEventArgs e) { try { cls.ClsConnect(); const int thamso = 3; string[] bien = new string[thamso]; object[] giatri = new object[thamso]; bien[0] = "@MaPos"; giatri[0] = s.Left(CboPos.SelectedValue.ToString().Trim(), 6); bien[1] = "@DenNgay"; if (DtpDenNgay.SelectedDate == null) { return; } giatri[1] = DtpDenNgay.SelectedDate.Value.ToString("yyyy-MM-dd"); bien[2] = "@Mau"; // MessageBox.Show(giatri[1].ToString()+" "+giatri[2].ToString()); if (RadioButton1.IsChecked == true) { giatri[2] = "1"; } else if (RadioButton2.IsChecked == true) { giatri[2] = "2"; } else { giatri[2] = "3"; } dt = cls.LoadDataProcPara(RadioButton4.IsChecked != true ? "usp_KH_CBTD_MOI" : "usp_Export_KH_CBTD_MOI", bien, giatri, thamso); if (dt.Rows.Count > 0) { if ((string)giatri[0] == "003000" || (RadioButton3.IsChecked == true)) { rpt_KH_XA_MOI rpt = new rpt_KH_XA_MOI(); RPUtility.ShowRp(rpt, dt, this, srv.DbSourceSerVer(), srv.DbNameSerVer(), srv.DbUserSerVer(), srv.DbPassSerVer()); } else { rpt_KH_CBTD_MOI rpt = new rpt_KH_CBTD_MOI(); RPUtility.ShowRp(rpt, dt, this, srv.DbSourceSerVer(), srv.DbNameSerVer(), srv.DbUserSerVer(), srv.DbPassSerVer()); } /* * else if (RadioButton1.IsChecked == true) * { * rpt_KH_CBTD rpt = new rpt_KH_CBTD(); * RPUtility.ShowRp(rpt, dt, this, srv.DbSourceSerVer(), srv.DbNameSerVer(), srv.DbUserSerVer(), * srv.DbPassSerVer()); * } * else if (RadioButton2.IsChecked == true) * { * rpt_KH_CBKT rpt = new rpt_KH_CBKT(); * RPUtility.ShowRp(rpt, dt, this, srv.DbSourceSerVer(), srv.DbNameSerVer(), srv.DbUserSerVer(), * srv.DbPassSerVer()); * } */ } else if (RadioButton4.IsChecked == true) { MessageBox.Show("insert OK"); } else { MessageBox.Show("Không có số liệu", "Thông báo", MessageBoxButton.OK, MessageBoxImage.Warning); } } catch (Exception ex) { MessageBox.Show("Error \n" + ex.Message, "Mess", MessageBoxButton.OK, MessageBoxImage.Error); } finally { cls.DongKetNoi(); } }