' Copyright (C) 2025  P4pillon.org
'
' This program is free software: you can redistribute it and/or modify
' it under the terms of the GNU Affero General Public License as
' published by the Free Software Foundation, either version 3 of the
' License, or (at your option) any later version.
'
' This program is distributed in the hope that it will be useful,
' but WITHOUT ANY WARRANTY; without even the implied warranty of
' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
' GNU Affero General Public License for more details.
'
' You should have received a copy of the GNU Affero General Public License
' along with this program.  If not, see <https://www.gnu.org/licenses/>.
Public Class Gestion_Main

#Region "Form"


    Private Sub Gestion_Main_Load(sender As Object, e As EventArgs) Handles Me.Load
        Me.Width = Screen.PrimaryScreen.Bounds.Width
        Me.Height = Screen.PrimaryScreen.Bounds.Height
        WebBrowser1.Width = Screen.PrimaryScreen.Bounds.Width
        WebBrowser1.Height = Screen.PrimaryScreen.Bounds.Height - WebBrowser1.Location.Y
    End Sub
    Private Sub WebBrowser1_Navigating(sender As Object, e As WebBrowserNavigatingEventArgs) Handles WebBrowser1.Navigating
        Me.Cursor = Cursors.AppStarting
    End Sub
    Private Sub WebBrowser1_DocumentCompleted(sender As Object, e As WebBrowserDocumentCompletedEventArgs) Handles WebBrowser1.DocumentCompleted
        Me.Cursor = Cursors.Default
    End Sub
    Private Sub Gestion_Main_FormClosed(sender As Object, e As FormClosedEventArgs) Handles Me.FormClosed
        COMPTOIR_MAIN.DP_Affiche_Msg()
    End Sub
#End Region

#Region "Financier"

    Private Sub Synthèse_comptable_LinkLabel_Click(sender As Object, e As EventArgs)
        Dim parameters As String = "&Début=" & Format(Now, "yyyy-MM-dd") & "T00:00:00" & "&Fin=" & Format(Now, "yyyy-MM-dd") & "T23:59:59"
        WebBrowser1.Navigate("http://" & Replace(Config.LocalNetwork_ServerName, "\", "") & "/ReportServer_SQLEXPRESS/Pages/ReportViewer.aspx?%2fAdministratif%2fSynth%c3%a8se+comptable&rs:Command=Render" & parameters)
    End Sub

    Private Sub Encaissements_LinkLabel_LinkClicked(sender As Object, e As LinkLabelLinkClickedEventArgs)
        Encaissements.Visible = True
        Me.Close()
    End Sub
   
    Private Sub Balance_TVA_LinkLabel_LinkClicked(sender As Object, e As LinkLabelLinkClickedEventArgs)
        Balance_Comptable.Visible = True

    End Sub
#End Region



#Region "Outils"
    Private Sub Recherche_actes_LinkLabel_Click(sender As Object, e As EventArgs) Handles Recherche_actes_LinkLabel.Click
        WebBrowser1.Navigate("http://" & Replace(Config.LocalNetwork_ServerName, "\", "") & "/ReportServer_SQLEXPRESS/Pages/ReportViewer.aspx?%2fActes%2fActes&rs:Command=Render")
    End Sub
    Private Sub Anomalies_comptables_LinkLabel_Click(sender As Object, e As EventArgs) Handles Anomalies_comptables_LinkLabel.Click
        WebBrowser1.Navigate("http://" & Replace(Config.LocalNetwork_ServerName, "\", "") & "/ReportServer_SQLEXPRESS/Pages/ReportViewer.aspx?%2fAdministratif%2fControle+des+encaissements&rs:Command=Render")
    End Sub
    Private Sub Attente_paiements_LinkLabel_Click(sender As Object, e As EventArgs)

    End Sub
#End Region


    Private Sub Back_Button_Click(sender As Object, e As EventArgs) Handles Back_Button.Click
        WebBrowser1.GoBack()
    End Sub

    Private Sub Forward_Button_Click(sender As Object, e As EventArgs) Handles Forward_Button.Click
        WebBrowser1.GoForward()
    End Sub

 
    Private Sub FSE_Facture_LinkLabel_LinkClicked(sender As Object, e As LinkLabelLinkClickedEventArgs)

    End Sub

    Private Sub Attente_paiements_LinkLabel_LinkClicked(sender As Object, e As LinkLabelLinkClickedEventArgs)

    End Sub

    Private Sub Synthèse_comptable_LinkLabel_LinkClicked(sender As Object, e As LinkLabelLinkClickedEventArgs)

    End Sub


    Private Sub Supprimer_FSE_LinkLabel_LinkClicked(sender As Object, e As LinkLabelLinkClickedEventArgs)

    End Sub

    Private Sub Supprimer_VD_LinkLabel_LinkClicked(sender As Object, e As LinkLabelLinkClickedEventArgs)

    End Sub

    Private Sub Balance_Stupéfiants_LinkLabel_LinkClicked(sender As Object, e As LinkLabelLinkClickedEventArgs)

    End Sub

    Private Sub Rejets_LinkLabel_LinkClicked(sender As Object, e As LinkLabelLinkClickedEventArgs)

    End Sub

    Private Sub VD_Liste_LinkLabel_LinkClicked(sender As Object, e As LinkLabelLinkClickedEventArgs)

    End Sub

    Private Sub VD_Facture_LinkLabel_LinkClicked(sender As Object, e As LinkLabelLinkClickedEventArgs)

    End Sub

    Private Sub Produits_Vendus_LinkLabel_LinkClicked(sender As Object, e As LinkLabelLinkClickedEventArgs)

    End Sub
End Class