| 12
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
 100
 101
 102
 103
 104
 105
 106
 107
 108
 109
 110
 111
 112
 113
 114
 115
 116
 117
 118
 119
 120
 121
 122
 123
 124
 125
 126
 127
 128
 129
 130
 131
 132
 133
 134
 135
 136
 137
 138
 139
 140
 141
 142
 143
 144
 145
 146
 
 | 
Option Strict Off
Imports System
Imports System.Web
Imports System.Web.UI
Imports System.Web.UI.Control
Imports System.Web.UI.WebControls.LinkButton
Imports System.Web.UI.WebControls
Namespace Sagem.DNN.Modules.BonsLivraison
    Public MustInherit Class BonsLivraison
		Inherits Entities.Modules.PortalModuleBase
		Implements Entities.Modules.IActionable
		Implements Entities.Modules.IPortable
		Implements Entities.Modules.ISearchable
        Private bon As bon
        Private entrepriseExpeditrice As Entreprise
        Private personneExpeditrice As Personne
        Protected WithEvents Ddl_Personne As System.Web.UI.WebControls.DropDownList
#Region "Controls"
#End Region
#Region "Event Handlers"
        Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            If Not Page.IsPostBack Then
                Dim i As Integer
                Dim temp As Integer
                If Ddl_Personne.SelectedValue = "" Then
                    temp = 0
                Else
                    temp = Ddl_Personne.SelectedValue
                End If
                'Dim ChoixExpe As Integer
                bon = New bon
                entrepriseExpeditrice = New Entreprise(1)
                personneExpeditrice = New Personne(temp)
                Afficher_Personne()
                'chargement du DataGrid
                If Page.IsPostBack Then
                    If personneExpeditrice.IdPersonne > 0 Then
                        DG_Bons.DataSource = bon.ListerOne(personneExpeditrice.IdPersonne)
                        DG_Bons.DataBind()
                    Else
                        DG_Bons.DataSource = bon.Lister
                        DG_Bons.DataBind()
                    End If
                Else
                    DG_Bons.DataSource = bon.Lister
                    DG_Bons.DataBind()
                End If
            End If
        End Sub
        Private Sub Afficher_Personne()
            Dim i As Integer
            Ddl_Personne.SelectedIndex = -1
            Ddl_Personne.DataSource = personneExpeditrice.Lister(entrepriseExpeditrice.IdEntreprise)
            Ddl_Personne.DataValueField = "Pe_idPersonne"
            Ddl_Personne.DataTextField = "NomPrenom"
            Ddl_Personne.DataBind()
            For i = 0 To Ddl_Personne.Items.Count - 1
                If Ddl_Personne.Items(i).Value = personneExpeditrice.IdPersonne Then
                    Ddl_Personne.SelectedIndex = i
                End If
            Next
            If Not Ddl_Personne.SelectedItem Is Nothing Then
                personneExpeditrice.IdPersonne = Ddl_Personne.SelectedValue
            End If
        End Sub
        Private Sub DG_Bons_ItemCommand(ByVal sender As System.Object, ByVal e As DataGridCommandEventArgs) Handles DG_Bons.ItemCommand
            Select Case e.CommandName
                Case "Imprimerf"
                Case "Supprimer"
                    bon = New bon(CInt(e.Item.Cells(0).Text))
                    bon.Supprimer()
                    DG_Bons.DataSource = bon.Lister
                    DG_Bons.DataBind()
            End Select
        End Sub
        Private Sub DG_Bons_PageIndexChanged1(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridPageChangedEventArgs) Handles DG_Bons.PageIndexChanged
            DG_Bons.CurrentPageIndex = e.NewPageIndex
            DG_Bons.DataSource = bon.Lister
            DG_Bons.DataBind()
        End Sub
#End Region
#Region "Optional Interfaces"
        Public ReadOnly Property ModuleActions() As Entities.Modules.Actions.ModuleActionCollection Implements Entities.Modules.IActionable.ModuleActions
            Get
                Dim Actions As New Entities.Modules.Actions.ModuleActionCollection
                Actions.Add(GetNextActionID, Localization.GetString(Entities.Modules.Actions.ModuleActionType.AddContent, LocalResourceFile), Entities.Modules.Actions.ModuleActionType.AddContent, "", "", EditUrl(), False, DotNetNuke.Security.SecurityAccessLevel.Edit, True, False)
                Return Actions
            End Get
        End Property
        Public Function ExportModule(ByVal ModuleID As Integer) As String Implements Entities.Modules.IPortable.ExportModule
            ' included as a stub only so that the core knows this module Implements Entities.Modules.IPortable
        End Function
        Public Sub ImportModule(ByVal ModuleID As Integer, ByVal Content As String, ByVal Version As String, ByVal UserID As Integer) Implements Entities.Modules.IPortable.ImportModule
            ' included as a stub only so that the core knows this module Implements Entities.Modules.IPortable
        End Sub
        Public Function GetSearchItems(ByVal ModInfo As Entities.Modules.ModuleInfo) As Services.Search.SearchItemInfoCollection Implements Entities.Modules.ISearchable.GetSearchItems
            ' included as a stub only so that the core knows this module Implements Entities.Modules.ISearchable
        End Function
#End Region
#Region " Web Form Designer Generated Code "
        'This call is required by the Web Form Designer.
        <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
        End Sub
        Protected WithEvents DG_Bons As System.Web.UI.WebControls.DataGrid
        'NOTE: The following placeholder declaration is required by the Web Form Designer.
        'Do not delete or move it.
        Private designerPlaceholderDeclaration As System.Object
        Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
            'CODEGEN: This method call is required by the Web Form Designer
            'Do not modify it using the code editor.
            InitializeComponent()
        End Sub
#End Region
    End Class
End Namespace | 
Partager