Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
LaMartin-Webomagic
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Deep Dey
LaMartin-Webomagic
Commits
05bb994c
Commit
05bb994c
authored
Jan 27, 2025
by
Pratik Shrivastava
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: add method to validate form data fields
parent
11a162fa
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
0 deletions
+33
-0
lamartinBackend/src/main/java/com/example/LaMartin/admission/dao/controller/AdmissionFormDAOController.java
.../admission/dao/controller/AdmissionFormDAOController.java
+33
-0
No files found.
lamartinBackend/src/main/java/com/example/LaMartin/admission/dao/controller/AdmissionFormDAOController.java
View file @
05bb994c
...
@@ -280,5 +280,38 @@ public class AdmissionFormDAOController {
...
@@ -280,5 +280,38 @@ public class AdmissionFormDAOController {
workbook
.
write
(
out
);
workbook
.
write
(
out
);
return
out
.
toByteArray
();
return
out
.
toByteArray
();
}
}
public
void
validateAdmissionFormDataForAdminSubmit
(
AdmissionFormData
formData
)
{
if
(
formData
.
getSchool
()
==
null
||
formData
.
getSchool
().
isEmpty
())
{
throw
new
IllegalArgumentException
(
"School is missing"
);
}
if
(
formData
.
getCategory
()
==
null
||
formData
.
getCategory
().
isEmpty
())
{
throw
new
IllegalArgumentException
(
"Category is missing"
);
}
if
(
formData
.
getFullName
()
==
null
||
formData
.
getFullName
().
isEmpty
())
{
throw
new
IllegalArgumentException
(
"Full Name is missing"
);
}
if
(
formData
.
getAdmissionClass
()
==
null
||
formData
.
getAdmissionClass
().
isEmpty
())
{
throw
new
IllegalArgumentException
(
"Admission Class is missing"
);
}
if
(
formData
.
getDateOfBirth
()
==
null
||
formData
.
getDateOfBirth
().
isEmpty
())
{
throw
new
IllegalArgumentException
(
"Date of Birth is missing"
);
}
if
(
formData
.
getFatherName
()
==
null
||
formData
.
getFatherName
().
isEmpty
())
{
throw
new
IllegalArgumentException
(
"Father's Name is missing"
);
}
if
(
formData
.
getFatherEmail
()
==
null
||
formData
.
getFatherEmail
().
isEmpty
())
{
throw
new
IllegalArgumentException
(
"Father's Email is missing"
);
}
if
(
formData
.
getFatherMobile
()
==
null
||
formData
.
getFatherMobile
().
isEmpty
())
{
throw
new
IllegalArgumentException
(
"Father's Mobile is missing"
);
}
if
(
formData
.
getCorrespondenceAddress
()
==
null
||
formData
.
getCorrespondenceAddress
().
isEmpty
())
{
throw
new
IllegalArgumentException
(
"Correspondence Address is missing"
);
}
if
(
formData
.
getHomeAddress
()
==
null
||
formData
.
getHomeAddress
().
isEmpty
())
{
throw
new
IllegalArgumentException
(
"Home Address is missing"
);
}
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment