Skip to content

Commit

Permalink
Inserted CHART into member's form
Browse files Browse the repository at this point in the history
  • Loading branch information
Artanemus committed Mar 3, 2024
1 parent ba86d3a commit 47b803c
Show file tree
Hide file tree
Showing 9 changed files with 774 additions and 4 deletions.
68 changes: 68 additions & 0 deletions MEMBERS/dmManageMemberData.dfm
Original file line number Diff line number Diff line change
Expand Up @@ -885,4 +885,72 @@ object ManageMemberData: TManageMemberData
Size = 11
end
end
object qryChart: TFDQuery
Connection = SCM.scmConnection
SQL.Strings = (
'USE [SwimClubMeet];'
''
'DECLARE @StrokeID AS INT;'
'DECLARE @DistanceID AS INT;'
'DECLARE @MemberID AS INT;'
''
'SET @StrokeID = :STROKEID;'
'SET @DistanceID = :DISTANCEID;'
'SET @MemberID = :MEMBERID;'
''

'SELECT [dbo].[SwimTimeToString](Entrant.RaceTime) AS RaceTimeAsS' +
'tring'

#9',(DATEPART(MILLISECOND, Entrant.RaceTime) / 1000.0) + (DATEPART' +
'(SECOND, Entrant.RaceTime)) + (DATEPART(MINUTE, Entrant.RaceTime' +
') / 60.0) AS Seconds'
''
#9',Session.SessionStart'
#9',Distance.Caption AS cDistance'
#9',Stroke.Caption AS cStroke'

',ROW_NUMBER()OVER (PARTITION BY 1 ORDER BY SessionStart ) AS Ch' +
'artX'
'FROM Entrant'

'INNER JOIN HeatIndividual ON Entrant.HeatID = HeatIndividual.Hea' +
'tID'
'INNER JOIN Event ON HeatIndividual.EventID = Event.EventID'
'INNER JOIN Session ON Event.SessionID = Session.SessionID'
'INNER JOIN Stroke ON Event.StrokeID = Stroke.StrokeID'
'INNER JOIN Distance ON Event.DistanceID = Distance.DistanceID'
'WHERE (Event.StrokeID = @StrokeID)'

#9'AND (Event.DistanceID = @DistanceID) AND (Entrant.MemberID = @M' +
'emberID) AND [dbo].[SwimTimeToString](Entrant.RaceTime) IS NOT N' +
'ULL'
'ORDER BY SessionStart')
Left = 496
Top = 592
ParamData = <
item
Name = 'STROKEID'
DataType = ftInteger
ParamType = ptInput
Value = 1
end
item
Name = 'DISTANCEID'
DataType = ftInteger
ParamType = ptInput
Value = 1
end
item
Name = 'MEMBERID'
DataType = ftInteger
ParamType = ptInput
Value = 1
end>
end
object dsChart: TDataSource
DataSet = qryChart
Left = 560
Top = 592
end
end
7 changes: 7 additions & 0 deletions MEMBERS/dmManageMemberData.pas
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ TManageMemberData = class(TDataModule)
qryMemberEventsEventStr: TWideStringField;
qryMemberEventsRaceTime: TTimeField;
qryMemberEventsEventDate: TStringField;
qryChart: TFDQuery;
dsChart: TDataSource;
procedure DataModuleCreate(Sender: TObject);
procedure qryMemberAfterInsert(DataSet: TDataSet);
procedure qryMemberAfterPost(DataSet: TDataSet);
Expand Down Expand Up @@ -188,6 +190,7 @@ procedure TManageMemberData.ActivateTable;
qryMemberRoleLnk.Connection := FConnection;
qryMemberPB.Connection := FConnection;
qryMemberEvents.Connection := FConnection;
qryChart.Connection := FConnection;

// prepare lookup tables.
tblStroke.Connection := FConnection;
Expand Down Expand Up @@ -216,6 +219,7 @@ procedure TManageMemberData.ActivateTable;
qryMemberRoleLnk.Open;
qryMemberPB.Open;
qryMemberEvents.Open;

if qryContactNum.Active then
begin
fManageMemberDataActive := True;
Expand Down Expand Up @@ -317,6 +321,9 @@ procedure TManageMemberData.qryMemberAfterScroll(DataSet: TDataSet);
// Updates the display of the member's age.
if Owner is TForm then
PostMessage(TForm(Owner).Handle, SCM_AFTERSCROLL, 0, 0);

// Update chart query?

end;

procedure TManageMemberData.qryMemberBeforeDelete(DataSet: TDataSet);
Expand Down
114 changes: 112 additions & 2 deletions MEMBERS/frmManageMember.dfm
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,6 @@ object ManageMember: TManageMember
TabHeight = 40
TabOrder = 2
TabWidth = 180
ExplicitWidth = 1359
ExplicitHeight = 701
object TabSheet1: TTabSheet
Caption = 'Member'#39's Details 1'
object Panel7: TPanel
Expand Down Expand Up @@ -1035,6 +1033,118 @@ object ManageMember: TManageMember
OnClick = btnClubMembersListClick
end
end
object TabSheet5: TTabSheet
Caption = 'CHART'
ImageIndex = 4
object DBChart1: TDBChart
Left = 0
Top = 65
Width = 1355
Height = 587
SubTitle.Font.Color = clBlack
SubTitle.Font.Height = -13
SubTitle.Font.Name = 'Segoe UI'
Title.Font.Color = clBlack
Title.Font.Height = -24
Title.Font.Name = 'Segoe UI'
Title.Text.Strings = (
'TDBChart')
BottomAxis.DateTimeFormat = 'dd/MM/yy'
BottomAxis.LabelsOnAxis = False
BottomAxis.LabelStyle = talPointValue
BottomAxis.Title.Caption = 'Session Date'
BottomAxis.Title.Font.Height = -13
BottomAxis.Title.Font.Name = 'Segoe UI'
LeftAxis.Increment = 1.000000000000000000
LeftAxis.MaximumRound = True
LeftAxis.MinimumRound = True
View3D = False
View3DWalls = False
OnGetAxisLabel = DBChart1GetAxisLabel
Align = alClient
Color = clWhite
TabOrder = 0
ExplicitWidth = 1351
ExplicitHeight = 586
DefaultCanvas = 'TGDIPlusCanvas'
PrintMargins = (
15
21
15
21)
ColorPaletteIndex = 6
object Series1: TLineSeries
HoverElement = [heCurrent]
Legend.Visible = False
Marks.Visible = True
Marks.AutoPosition = False
SeriesColor = clBlack
ShowInLegend = False
XLabelsSource = 'RaceTimeAsString'
Brush.BackColor = clDefault
DrawStyle = dsCurve
OutLine.Color = clDefault
OutLine.Visible = True
Pointer.InflateMargins = True
Pointer.Style = psHexagon
Pointer.Visible = True
XValues.Name = 'X'
XValues.Order = loAscending
XValues.ValueSource = 'ChartX'
YValues.Name = 'Y'
YValues.Order = loNone
YValues.ValueSource = 'Seconds'
object TSmoothingFunction
Period = 1.000000000000000000
Factor = 8
end
end
end
object Panel2: TPanel
Left = 0
Top = 0
Width = 1355
Height = 65
Align = alTop
Caption = 'Panel2'
TabOrder = 1
ExplicitWidth = 1351
object Label27: TLabel
Left = 24
Top = 11
Width = 59
Height = 19
Alignment = taRightJustify
Caption = 'Distance'
end
object Label28: TLabel
Left = 334
Top = 11
Width = 45
Height = 19
Alignment = taRightJustify
Caption = 'Stroke'
end
object cmboDistance: TComboBox
Left = 89
Top = 8
Width = 183
Height = 27
TabOrder = 0
Text = 'cmboDistance'
OnChange = cmboDistanceChange
end
object cmboStroke: TComboBox
Left = 385
Top = 9
Width = 184
Height = 27
TabOrder = 1
Text = 'cmboStroke'
OnChange = cmboStrokeChange
end
end
end
end
object ActnMemberMenuBar: TActionMainMenuBar
Left = 0
Expand Down
Loading

0 comments on commit 47b803c

Please sign in to comment.