1 2 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
| Sub Click(Source As Button)
Dim Db As NotesDatabase
Dim doc As NotesDocument
Dim dc As NotesDocumentCollection
Dim Ok As Boolean
Dim Dates As NotesDateRange
Dim NuméroAgent As String
Dim s As New NotesSession
Dim workspace As New NotesUIWorkspace
Dim CodeMenu As Integer
Dim Question As String
Set db=s.currentdatabase
Set dc=db.UnprocessedDocuments
Set doc=dc.GetFirstDocument
If doc Is Nothing Then
Set doc=db.CreateDocument
End If
Ok = workspace.DialogBox ("Saisie ajout repas", True, True, False, False, False, False, "C.C.F - Ajouter des repas", doc )
' flag = pace.DialogBox( form$, [autoHorzFit] , [autoVertFit] , [noCancel] , [noNewFields] , [noFieldUpdate] , [readOnly] , [title$] , [notesDocument] , [sizeToTable] , [noOkCancel] , [okCancelAtBottom] )
If Not Ok Then Exit Sub
Set Dates = s.CreateDateRange()
Dates.Text = Cstr (Doc.DATE_REPAS(0) ) + "-" + Cstr ( Doc.DATE_FIN(0) )
NuméroAgent = Cstr ( Doc.NUMERO_AGENT ( 0 ) )
Set view = db.GetView( "Agent-All" )
view.AutoUpdate = False
Set entry = view.GetEntryByKey ( NuméroAgent, True )
CodeMenu = entry.ColumnValues ( 6 )
If CodeMenu = 0 Then
x = Evaluate({@if(@Contains(@UserRoles;"[RH]");"1";"0")})
If x(0) = "1" Then
Question = "L'agent " & GetAgentName(NuméroAgent) & " n'a aucun menu sélectionné dans sa fiche, voulez-vous modifier sa fiche maintenant ?"
Ok = Messagebox (Question , MB_YESNO + MB_ICONQUESTION, "C.C.F. - Ajouter des repas") = 1
If Not Ok Then Exit Sub
Set doc = entry.Document
Set uidoc = workspace.EditDocument ( 1, doc )
Exit Sub
End If
End If
Call AjouterDesRepas ( NuméroAgent, Dates )
Call workspace.ViewRefresh
Call workspace.ViewRefresh ' dupliqué car la vue ne se rafraîchit pas toujours !!!
End Sub |
Partager