Hi,
I want to use Options in PreferencesDialog which apect list. How can I add list with exact index from ms sql table (Options list need to contains f.e. DepartmentID and DeparmentName); user will pick the DeparmentName and system should writte DeparmentID in sql table...
I cann fullfill Options list with Sql quiry (from ms Sql db), but I receive list with all options. I declared custom type - how can I get in Option list just Names, connected behind wiht ID-s:
My Code for fulfil Options list is here:
I want to use Options in PreferencesDialog which apect list. How can I add list with exact index from ms sql table (Options list need to contains f.e. DepartmentID and DeparmentName); user will pick the DeparmentName and system should writte DeparmentID in sql table...
I cann fullfill Options list with Sql quiry (from ms Sql db), but I receive list with all options. I declared custom type - how can I get in Option list just Names, connected behind wiht ID-s:
My Code for fulfil Options list is here:
Example code:
Type Oddelki (Sifra As Int, Naziv As String)
Private listOddelki As List
' click of button ADD
Private Sub btnUredi_Click
myData.Clear
' fill oddelki
FillOddelki
Wait For (modiDialog.ShowDialog(myData, "OK", "CANCEL")) Complete (Result As Int)
If Result = xui.DialogResponse_Positive Then
' zapišemo podatke v Sql
InsertUpdateMachine(myData)
RefreshTableGrid
End If
End Sub
' fill mydepartmens
Sub FillOddelki
listOddelki.Initialize
Query = "select SifOddelekID, SifOddelekDescription from sifOddelki where isnull(SifOddelekIsDeleted,0) = 0 and isnull(SifOddelekIsNonActive,0) = 0 order by sifOddelekId desc"
Dim rs As ResultSet = Main.MsSql.ExecQuery(Query)
Do While rs.NextRow
listOddelki.Add(CreateListOddelki(rs.GetInt("SifOddelekID"), rs.GetString("SifOddelekDescription")))
Loop
rs.Close
' fill modify dialog - options = Oddelek
modiDialog.SetOptions("Oddelek", listOddelki)
End sub
' createlist of deparments
Sub CreateListOddelki(Sifra As Int, Naziv As String) As Oddelki
Dim odd As Oddelki
odd.Initialize
odd.Sifra = Sifra
odd.Naziv = Naziv
Return odd
End Sub