l) < grdContract.TextMatrix(Row2, grdContract.col) Then Cmp = -1 ElseIf grdContract.TextMatrix(Row1, grdContract.col) > grdContract.TextMatrix(Row2, grdContract.col) Then Cmp = 1 Else Cmp = 0 End If Case 0, 1, 4, 11 'sort numeric - intreg If CInt(grdContract.TextMatrix(Row1, grdContract.col)) < CInt(grdContract.TextMatrix(Row2, grdContract.col)) Then Cmp = -1 ElseIf CInt(grdContract.TextMatrix(Row1, grdContract.col)) > CInt(grdContract.TextMatrix(Row2, grdContract.col)) Then Cmp = 1 Else Cmp = 0 End If Case 5, 6, 7, 8, 9 'sort numeric - single If CSng(grdContract.TextMatrix(Row1, grdContract.col)) < CSng(grdContract.TextMatrix(Row2, grdContract.col)) Then Cmp = -1 ElseIf CSng(grdContract.TextMatrix(Row1, grdContract.col)) > CSng(grdContract.TextMatrix(Row2, grdContract.col)) Then Cmp = 1 Else Cmp = 0 End If End Select End Sub Private Sub lstAlteDisc_ItemCheck(Item As Integer) If Not lstAlteDisc.Enabled Then Exit Sub IncarcaGridCC lstAlteDisc 'CalculeazaStatistici End Sub Private Sub lstDisc_ItemCheck(Item As Integer) If Not lstDisc.Enabled Then Exit Sub IncarcaGridC lstDisc 'CalculeazaStatistici End Sub Private Sub lstSemestru_ItemCheck(Item As Integer) Dim poz As Byte Dim semestruCrt As Byte Dim en As Boolean If lstSemestru.ListIndex < 0 Then Exit Sub 'semestrul curent este ultimul semestru marcat semestruCrt = CByte(lstSemestru.ItemData(lstSemestru.ListIndex)) lblSemCrt.Caption = "Semestrul curent: " & semestruCrt 'citeste anul universitar - pentru modificari in txtAnUniv poz = InStr(lstSemestru.List(lstSemestru.ListIndex), " - ") 'txtAnUniv.Text = Mid$(lstSemestru.List(lstSemestru.ListIndex), poz + 3, 4) 'txtSemCrt.Text = semestruCrt 'demarcheaza chkToateDiscOblig chkToateDiscOblig.value = vbUnchecked 'incarca sau sterge din lstDisc disciplinele IncarcaLstDisc lstSemestru, lstDisc IncarcaLstAlteDisc lstAlteDisc, lstDisc 'marcheaza disc existente in gTabelDisciplineContract en = lstDisc.Enabled lstDisc.Enabled = False MarcheazaDiscDinContract lstDisc lstDisc.Enabled = en en = lstAlteDisc.Enabled lstAlteDisc.Enabled = False MarcheazaDiscDinContract lstAlteDisc lstAlteDisc.Enabled = en 'pune sau sterge din grid disciplinele din semestrul curent ActualizeazaGridContract lstSemestru CalculeazaStatistici End Sub Private Sub lstSortGrid_Click() If lstSortGrid.ListIndex >= 0 Then grdContract.col = lstSortGrid.ListIndex grdContract.Sort = 9 ' flexSortCustom End If End Sub Private Function DisciplinaObligatorieMarcata(id As Integer) Dim i As Integer Dim pd As Long Dim pi As Long pd = lstDisc.ItemData(id) For i = 0 To id - 1 If lstDisc.Selected(i) Then pi = lstDisc.ItemData(i) If (gTabelDiscipline(pi).tip = 1 Or _ gTabelDiscipline(pi).tip = 3) And _ gTabelDiscipline(pi).cod = gTabelDiscipline(pd).cod Then DisciplinaObligatorieMarcata = True Exit Function End If End If Next i DisciplinaObligatorieMarcata = False End Function #84101D"WIDTH="90%" CELLSPACING=0>