<asp:Button ID="btn_lancer" Text="lancer" runat="server" /> <%--popup superieur--%> <asp:Panel ID="PnlMsgAlert" runat="server" Visible="false" Style="display: none; height: 500; width: 500; background-color: #D3D3D3;"> <div id="div1" runat="server"> <asp:Label ID="lbl_message" runat="server" Text="Vous devez alertez tous les conducteurs"> </asp:Label> <asp:Button ID="btnAlertOK" runat="server" Text="Oui" CssClass="cBtnPopup" /> <br /> </div> </asp:Panel> <asp:Button ID="btn_alert" runat="Server" Style="display: none" /> <Ajax:ModalPopupExtender ID="popPopupAlert" PopupControlID="PnlMsgAlert" TargetControlID="btn_alert" runat="server"> </Ajax:ModalPopupExtender> <%--popup inferieur--%> <asp:Panel ID="PnlMsg" runat="server" Visible="false" Style="display: none; height: 500; width: 500; background-color: #D3D3D3;"> <div id="div2" runat="server"> <asp:Label ID="lbMsg" runat="server" Text="Voulez-vous lancer la SESR même si le nombre des inscrits à est en dessous de seuil"> </asp:Label> <asp:Button ID="btnNon" runat="server" Text="Non" CssClass="cBtnPopup" /> <asp:Button ID="btnOui" runat="server" Text="Oui" CssClass="cBtnPopup" /> <br /> </div> </asp:Panel> <asp:Button ID="btnInvisible" runat="Server" Style="display: none" /> <Ajax:ModalPopupExtender ID="popPopup" runat="server" PopupControlID="PnlMsg" TargetControlID="btnInvisible" CancelControlID="btnInvisible"> </Ajax:ModalPopupExtender> <%--unused--%> <%--<Ajax:ConfirmButtonExtender ID="cbe" runat="server" TargetControlID="btn_lancer" ConfirmText="Are you sure you want to click this?" önClientCancel="CancelClick" />--%>
Protected Sub btn_lancer_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btn_lancer.Click 'on recupere le nombre des inscris dans sesr et le nombre des inscris alertes Dim inscriptionDmp As New DataMapper_Cls_Inscription Dim numberInscris As Integer Dim numberInscrisAlerted As Integer numberInscris = inscriptionDmp.NumberConducteurAssignedToSesr(hf_idsesr.Value) numberInscrisAlerted = inscriptionDmp.NumberConducteurAssignedToSesrAndAlerted(hf_idsesr.Value) 'on recupere le nombre minimum Dim paramDmp As New DataMapper_Cls_Parametre Dim numberMinInscris As Integer numberMinInscris = paramDmp.GetLastParameters().nombreMinInscrit 'number Inscrits min est atteint If numberInscris >= numberMinInscris Then 'tous les conducteurs sont alertes If numberInscris = numberInscrisAlerted Then Dim sesrDmp As New DataMapper_Cls_SESR sesrDmp.lanceeSesr(Convert.ToInt32(hf_idsesr.Value)) Response.Redirect("~\Viewer\Gestionnaire\sesr\sesrGestionnaire.aspx") Else 'un conducteur au moins demeure inalerte hf_test.Value = "Nok" popPopupAlert.Show() PnlMsgAlert.Visible = True End If Else hf_test.Value = "wait" PnlMsg.Visible = True popPopup.Show() End If End Sub Private Sub btnOui_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnOui.Click 'on recupere le nombre des inscris dans sesr et le nombre des inscris alertes Dim inscriptionDmp As New DataMapper_Cls_Inscription Dim numberInscris As Integer Dim numberInscrisAlerted As Integer numberInscris = inscriptionDmp.NumberConducteurAssignedToSesr(hf_idsesr.Value) numberInscrisAlerted = inscriptionDmp.NumberConducteurAssignedToSesrAndAlerted(hf_idsesr.Value) If numberInscris = numberInscrisAlerted Then Dim sesrDmp As New DataMapper_Cls_SESR sesrDmp.lanceeSesr(Convert.ToInt32(hf_idsesr.Value)) Response.Redirect("~\Viewer\Gestionnaire\sesr\sesrGestionnaire.aspx") Else hf_test.Value = "nok2" popPopup.Hide() PnlMsgAlert.Visible = True popPopupAlert.Show() End If End Sub Private Sub btnNon_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnNon.Click popPopup.Hide() End Sub Private Sub btnAlertOK_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnAlertOK.Click 'PnlMsgAlert.Visible = False popPopupAlert.Hide() End Sub
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)