Skip to content

Commit

Permalink
Merge pull request #10 from Tirtstan/experimental
Browse files Browse the repository at this point in the history
add clsRegistration and fixed bio max character limit
  • Loading branch information
Tirtstan authored Aug 15, 2022
2 parents 0344de9 + 10b5554 commit 4776ebb
Show file tree
Hide file tree
Showing 18 changed files with 770 additions and 26 deletions.
5 changes: 4 additions & 1 deletion PAT2022/PAT2022.dpr
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ uses
frmCourseInfo_U in 'frmCourseInfo_U.pas' {frmCourseInfo},
frmProfile_U in 'frmProfile_U.pas' {frmProfile},
frmCustomise_U in 'frmCustomise_U.pas' {frmCustomise},
clsReviews in 'clsReviews.pas';
clsReviews in 'clsReviews.pas',
clsRegistration in 'clsRegistration.pas',
frmRegistration_U in 'frmRegistration_U.pas' {frmRegistration};

{$R *.res}

Expand All @@ -35,6 +37,7 @@ begin
Application.CreateForm(TfrmCourseInfo, frmCourseInfo);
Application.CreateForm(TfrmProfile, frmProfile);
Application.CreateForm(TfrmCustomise, frmCustomise);
Application.CreateForm(TfrmRegistration, frmRegistration);
Application.Run;

end.
7 changes: 6 additions & 1 deletion PAT2022/PAT2022.dproj
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,11 @@
<FormType>dfm</FormType>
</DCCReference>
<DCCReference Include="clsReviews.pas"/>
<DCCReference Include="clsRegistration.pas"/>
<DCCReference Include="frmRegistration_U.pas">
<Form>frmRegistration</Form>
<FormType>dfm</FormType>
</DCCReference>
<BuildConfiguration Include="Base">
<Key>Base</Key>
</BuildConfiguration>
Expand Down Expand Up @@ -983,8 +988,8 @@
<ProjectRoot Platform="OSX64" Name="$(PROJECTNAME).app"/>
<ProjectRoot Platform="Win32" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="OSXARM64" Name="$(PROJECTNAME).app"/>
<ProjectRoot Platform="Android64" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="Android" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="Android64" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="Win64" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="Linux64" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="iOSDevice32" Name="$(PROJECTNAME).app"/>
Expand Down
2 changes: 1 addition & 1 deletion PAT2022/Win32/Debug/Database/desktop.ini
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[.ShellClassInfo]
IconResource=C:\Program Files\Google\Drive File Stream\60.0.2.0\GoogleDriveFS.exe,23
IconResource=C:\Program Files\Google\Drive File Stream\62.0.1.0\GoogleDriveFS.exe,23
2 changes: 1 addition & 1 deletion PAT2022/Win32/Debug/desktop.ini
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[.ShellClassInfo]
IconResource=C:\Program Files\Google\Drive File Stream\60.0.2.0\GoogleDriveFS.exe,23
IconResource=C:\Program Files\Google\Drive File Stream\62.0.1.0\GoogleDriveFS.exe,23
2 changes: 1 addition & 1 deletion PAT2022/Win32/desktop.ini
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[.ShellClassInfo]
IconResource=C:\Program Files\Google\Drive File Stream\60.0.2.0\GoogleDriveFS.exe,23
IconResource=C:\Program Files\Google\Drive File Stream\62.0.1.0\GoogleDriveFS.exe,23
7 changes: 2 additions & 5 deletions PAT2022/clsFormatCalculations.pas
Original file line number Diff line number Diff line change
Expand Up @@ -150,21 +150,18 @@ function TFormatCalculation.FindCourseDescription(): string;
end;

function TFormatCalculation.FindCourseFee(lblCourse: TLabel): real;
var
bFlag: boolean;
begin
// Finding CourseID
bFlag := true;

with dbmPAT2022 do
begin
tblCourses.First;
while NOT(tblCourses.Eof) OR (bFlag = true) do
while NOT(tblCourses.Eof) do
begin
if (tblCourses['CourseID']) = StrToInt(copy(lblCourse.Name, 10)) then
begin
result := tblCourses['Fee'];
bFlag := false;
break;
end;
tblCourses.Next;
end;
Expand Down
81 changes: 81 additions & 0 deletions PAT2022/clsRegistration.pas
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
unit clsRegistration;

interface

uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants,
System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.ExtCtrls, Vcl.StdCtrls,
Vcl.ComCtrls, dbPAT2022;

Type
TRegistration = class(TObject)
private
fStudentID, fCourseID, fUniversityID: integer;
fDateRegistered: TDateTime;
fBalance: Real;
public
constructor Create(iConStudentID, iConCourseID, iConUniversityID: integer;
dDateRegistered: TDateTime; rBalance: Real);
procedure SetBalance(rBalance: Real);
function GetStudentID(): integer;
function GetCourseID(): integer;
function GetUniversityID(): integer;
function GetDateRegistered(): TDateTime;
function GetBalance(): Real;
function ToString(): String;
end;

implementation

{ TRegistration }

constructor TRegistration.Create(iConStudentID, iConCourseID, iConUniversityID
: integer; dDateRegistered: TDateTime; rBalance: Real);
begin
fStudentID := iConStudentID;
fCourseID := iConCourseID;
fUniversityID := iConUniversityID;
fDateRegistered := dDateRegistered;
fBalance := rBalance;
end;

function TRegistration.GetBalance: Real;
begin
result := fBalance;
end;

function TRegistration.GetCourseID: integer;
begin
result := fCourseID;
end;

function TRegistration.GetDateRegistered: TDateTime;
begin
result := fDateRegistered;
end;

function TRegistration.GetStudentID: integer;
begin
result := fStudentID;
end;

function TRegistration.GetUniversityID: integer;
begin
result := fUniversityID;
end;

procedure TRegistration.SetBalance(rBalance: Real);
begin
fBalance := rBalance;
end;

function TRegistration.ToString: String;
begin
{ result := 'StudentID: ' + IntToStr(fStudentID) + #13 + 'CourseID: ' +
IntToStr(fCourseID) + #13 + 'UniversityID: ' + IntToStr(fUniversityID) + #13
+ 'Date Registered: ' + DateToStr(fDateRegistered) + #13 + 'Balance: ' +
FloatToStrf(fBalance, ffCurrency, 8, 2); }
end;

end.
2 changes: 1 addition & 1 deletion PAT2022/desktop.ini
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[.ShellClassInfo]
IconResource=C:\Program Files\Google\Drive File Stream\60.0.2.0\GoogleDriveFS.exe,23
IconResource=C:\Program Files\Google\Drive File Stream\62.0.1.0\GoogleDriveFS.exe,23
21 changes: 17 additions & 4 deletions PAT2022/frmBrowserChooser_U.dfm
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ object frmBrowserChooser: TfrmBrowserChooser
ParentBackground = False
ParentFont = False
TabOrder = 0
ExplicitWidth = 1121
ExplicitHeight = 721
object Label1: TLabel
Left = 456
Top = 40
Expand Down Expand Up @@ -138,9 +136,9 @@ object frmBrowserChooser: TfrmBrowserChooser
OnClick = btnBackClick
end
object btnProfile: TButton
Left = 1008
Left = 992
Top = 656
Width = 99
Width = 115
Height = 49
Caption = 'Profile'
Font.Charset = DEFAULT_CHARSET
Expand Down Expand Up @@ -233,5 +231,20 @@ object frmBrowserChooser: TfrmBrowserChooser
TabOrder = 4
OnClick = btnAdminClick
end
object btnRegistration: TButton
Left = 992
Top = 8
Width = 115
Height = 49
Caption = 'Registeration'
Font.Charset = DEFAULT_CHARSET
Font.Color = clMoneyGreen
Font.Height = -16
Font.Name = 'Segoe UI'
Font.Style = [fsBold]
ParentFont = False
TabOrder = 5
OnClick = btnRegistrationClick
end
end
end
10 changes: 9 additions & 1 deletion PAT2022/frmBrowserChooser_U.pas
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ TfrmBrowserChooser = class(TForm)
btnProfile: TButton;
btnAdmin: TButton;
lblUser: TLabel;
btnRegistration: TButton;
procedure btnUniClick(Sender: TObject);
procedure btnCoursesClick(Sender: TObject);
procedure btnBackClick(Sender: TObject);
Expand All @@ -36,6 +37,7 @@ TfrmBrowserChooser = class(TForm)
procedure FormShow(Sender: TObject);
procedure btnAdminClick(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure btnRegistrationClick(Sender: TObject);
private
{ Private declarations }
objFormatCalculations: TFormatCalculation;
Expand All @@ -50,7 +52,7 @@ implementation

uses
frmCourseBrowser_U, frmUniversityBrowser_U, frmLogin_U, frmProfile_U,
frmWelcome_U, frmCustomise_U, frmAdminPage_U;
frmWelcome_U, frmCustomise_U, frmAdminPage_U, frmRegistration_U;

{$R *.dfm}

Expand Down Expand Up @@ -84,6 +86,12 @@ procedure TfrmBrowserChooser.btnUniClick(Sender: TObject);
frmUniversityBrowser.Show;
end;

procedure TfrmBrowserChooser.btnRegistrationClick(Sender: TObject);
begin
frmBrowserChooser.Hide;
frmRegistration.Show;
end;

procedure TfrmBrowserChooser.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
Expand Down
1 change: 0 additions & 1 deletion PAT2022/frmLogin_U.dfm
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ object frmLogin: TfrmLogin
ParentBackground = False
ParentFont = False
TabOrder = 0
ExplicitHeight = 737
object Label1: TLabel
Left = 494
Top = 120
Expand Down
4 changes: 4 additions & 0 deletions PAT2022/frmLogin_U.pas
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,10 @@ procedure TfrmLogin.FormCreate(Sender: TObject);
edtEmailL.Text := 'admin@app.com';
edtPasswordL.Text := 'admin11!!';

// Student Version

edtEmailL.Text := 'tirt@gmail.com';
edtPasswordL.Text := 'SupBro32!!';
end;

procedure TfrmLogin.FormShow(Sender: TObject);
Expand Down
7 changes: 2 additions & 5 deletions PAT2022/frmRegister_U.dfm
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@ object frmRegister: TfrmRegister
Color = 9128543
ParentBackground = False
TabOrder = 1
ExplicitTop = -6
ExplicitWidth = 1129
ExplicitHeight = 741
object Label1: TLabel
Left = 464
Top = 48
Expand Down Expand Up @@ -321,7 +318,7 @@ object frmRegister: TfrmRegister
Top = 101
Width = 123
Height = 17
Caption = 'Max Characters: 255'
Caption = 'Max Characters: 240'
Font.Charset = DEFAULT_CHARSET
Font.Color = 4822522
Font.Height = -13
Expand Down Expand Up @@ -357,7 +354,7 @@ object frmRegister: TfrmRegister
Font.Height = -15
Font.Name = 'Segoe UI'
Font.Style = [fsBold]
MaxLength = 255
MaxLength = 240
ParentFont = False
ParentShowHint = False
ScrollBars = ssVertical
Expand Down
6 changes: 3 additions & 3 deletions PAT2022/frmRegister_U.pas
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ procedure TfrmRegister.FormCreate(Sender: TObject);
lblPhoneNumberError.Visible := false;
lblPfpError.Visible := false;

redBioR.MaxLength := 255;
redBioR.MaxLength := 240;

end;

Expand Down Expand Up @@ -439,7 +439,7 @@ procedure TfrmRegister.FormShow(Sender: TObject);

// Loading stuff

redBioR.MaxLength := 255;
redBioR.MaxLength := 240;

pfp1.Picture.LoadFromFile('hmmm2.png');
pfp1.Cursor := crHandPoint;
Expand Down Expand Up @@ -516,7 +516,7 @@ procedure TfrmRegister.redBioRChange(Sender: TObject);
var
iCharactersLeft: integer;
begin
iCharactersLeft := 255 - (length(redBioR.Text));
iCharactersLeft := 240 - (length(redBioR.Text));
lblMaxCharacters.Caption := 'Characters Left: ' + IntToStr(iCharactersLeft);
end;

Expand Down
Loading

0 comments on commit 4776ebb

Please sign in to comment.