Imports System.Web.UI.WebControls Imports System.Web.Configuration Imports Telerik.Web.UI Imports System.Data.SqlClient Imports System.Configuration Imports Telerik.Web.UI.RadWebControl Public Class WebStatistik Inherits System.Web.UI.Page Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load If Page.IsPostBack Then Exit Sub Me.txtJahr.Text = Year(Now).ToString ' Refresh_Webstat() End Sub Sub Refresh_Webstat() Me.cbboxStatistikdaten.DataBind() Exit Sub Dim dh As New clsDatahandling Dim t As New DataTable t = dh.Get_Webstatistik_Data Me.cbboxStatistikdaten.DataSource = t Me.cbboxStatistikdaten.DataTextField = "Beschreibung" Me.cbboxStatistikdaten.DataValueField = "WebStatistikNr" End Sub Protected Sub RadButton1_Click(sender As Object, e As EventArgs) Handles RadButton1.Click Dim db As New clsDatahandling db.Statistikdaten_Speichern(Me.txtJahr.Text, Me.txtBeschreibung.Text, Session("UserID")) Me.cbboxStatistikdaten.DataBind() End Sub Sub show_report(ByVal sql As String, ByVal sqltype As String, ByVal filename As String, dokumentnr As String) Try If dokumentnr <> "" Then If dokumentnr <> "-1" Then sql = sql.Replace("%DOKNR%", dokumentnr) End If Dim ds1 As New DataSet Dim ds As New DataSet Dim dh As New clsDatahandling If sqltype = "SP" Then ds = dh.Get_Tabledata(sql, True, False) Else If sqltype = "SQL" Then ds = dh.Get_Tabledata(sql, False, True) Else ds = dh.Get_Tabledata(sql, False, False) End If End If Me.WebReport1.Prepare() Me.WebReport1.ReportFile = "~/Reporting/" + filename Me.WebReport1.DataBind() Dim x As FastReport.Report = WebReport1.Report x.RegisterData(ds) Catch ex As Exception MsgBox(ex.Message) End Try End Sub Private Sub WebReport1_StartReport(sender As Object, e As System.EventArgs) Handles WebReport1.StartReport Dim dh As New clsDatahandling Me.WebReport1.Report.SetParameterValue("Parcours", dh.Get_Option(2)) Me.WebReport1.Report.SetParameterValue("Spruch", dh.Get_Option(3)) Me.WebReport1.Report.SetParameterValue("URL", dh.Get_Option(27)) End Sub Protected Sub btnZusammenfassung_Click(sender As Object, e As EventArgs) Handles btnZusammenfassung.Click show_report("exec dbo.sp_webstatistik_getdata 1," + Me.cbboxStatistikdaten.SelectedValue.ToString, "SQL", "WebStat_Zusammenfassung.frx", -1) End Sub Protected Sub btnBerufsbilder_Click(sender As Object, e As EventArgs) Handles btnBerufsbilder.Click show_report("exec dbo.sp_webstatistik_getdata 2," + Me.cbboxStatistikdaten.SelectedValue.ToString, "SQL", "WebStat_Beruf.frx", -1) End Sub Protected Sub btnBerufsbilder0_Click(sender As Object, e As EventArgs) Handles btnBerufsbilder0.Click show_report("exec dbo.sp_webstatistik_getdata 3," + Me.cbboxStatistikdaten.SelectedValue.ToString, "SQL", "WebStat_Firmenangebot.frx", -1) End Sub Protected Sub btnBerufsbilder1_Click(sender As Object, e As EventArgs) Handles btnBerufsbilder1.Click show_report("exec dbo.sp_webstatistik_getdata 4," + Me.cbboxStatistikdaten.SelectedValue.ToString, "SQL", "WebStat_AngebotNachfrage.frx", -1) End Sub Protected Sub RadButton2_Click(sender As Object, e As EventArgs) Handles RadButton2.Click Show_Message(3, "Statistikdaten wirklich löschen?") End Sub Protected Sub Show_Message(ByVal type As Integer, ByVal meldung As String) Dim image1 As String Select Case type Case 1 image1 = WebConfigurationManager.AppSettings("Imagepath") + "Error.png" RadWindowManager1.RadAlert(meldung, 330, 100, "Fehler", "alertCallBackFnError", image1) Case 2 image1 = WebConfigurationManager.AppSettings("Imagepath") + "Info1.png" RadWindowManager1.RadAlert(meldung, 330, 100, "Fehler", "alertCallBackFnError", image1) Case 3 image1 = WebConfigurationManager.AppSettings("Imagepath") + "Info1.png" RadWindowManager1.RadConfirm(meldung, "ConfirmCallBackFn", 330, 100, Nothing, "Statistikdaten löschen?") Case 4 image1 = WebConfigurationManager.AppSettings("Imagepath") + "Info1.png" RadWindowManager1.RadConfirm(meldung, "ConfirmCallBackFn1", 330, 100, Nothing, "Schülerdaten?") End Select End Sub Private Sub RadAjaxManager1_AjaxRequest(sender As Object, e As Telerik.Web.UI.AjaxRequestEventArgs) Handles RadAjaxManager1.AjaxRequest If e.Argument.ToString = "ok" Then Dim dh As New clsDatahandling dh.Delete_Webstatistik(Me.cbboxStatistikdaten.SelectedValue) Refresh_Webstat() End If End Sub End Class