Untitled

 avatar
unknown
plain_text
a month ago
5.3 kB
3
Indexable
Description

Scenario :

"Buttercup Events," a prestigious annual art exhibition, is looking to streamline its attendee registration process by developing an ASP.NET Core application. As a skilled software developer, your task is to create a user-friendly and efficient online registration system that allows art enthusiasts and visitors to sign up for the upcoming exhibition.



Functionalities :

Implement the model as per the below-mentioned public properties in LoginDetail.cs

  Data Type

Variable Name

Data Annotation

  string

  FirstName

  -- Required

  -- Error Message = "Please enter the first name"

  string

  Password

  -- Required

  -- Error Message = "Please enter the password"

  -- Annotation type should be Password

 

Implement the model as per the below-mentioned public properties in Member.cs

  Data Type

Variable Name

Data Annotation

  int

  Id

  -- Key

  string

  FirstName

  -- Required

  -- Error Message = "Please enter the first name"

  string

  LastName

  -- Required

  -- Error Message = "Please enter the last name"

  string

  Password

  -- Required

  -- Error Message = "Please enter the password"

  -- Annotation type should be Password

  string

  ConfirmPassword

  -- Required

  -- Error Message = "Please re-enter the password"

  -- Annotation type should be Password

  -- Compare this ConfirmPassword with Password

  string

  Address

  -- Required

  -- Error Message = "Please enter the address"

  long

  Contact

  -- Required

  -- Error Message = "Please enter the contact details"

 

Implement the below-mentioned public properties in EventDBContext.cs which extends the DbContext

           Data Type

Variable Name

      DbSet<Member>

               Members

 

NOTE:

For Creating Migration, Use this below code in the Package Manager Console 

1. add-migration SampleName- once this migration is successful, then move to next step 

2. update-database

You can give any name instead of SampleName

 

Implement the below-mentioned public methods in the EventController.cs which extends the Controller

      Method

                             Rules

 

public IActionResult EventLogForm()

  -- This method's view page should get the input from the user and click on the Login button or need to click the Register link to register the details

  -- Get the inputs such as FirstName and Password

public IActionResult EventLogForm(LoginDetail login)

  -- This method is http post request of the EventLogForm() method

  -- Check whether the given FirstName is present in the database or not. If yes then navigate to WelcomingNote page else return to the same page.

public IActionResult AddMember()

  -- This method's view page should get the inputs from the user and click on the Create button.

  -- Get the inputs such as FirstName, LastName,  Password, ConfirmPassword,  Address,  Contact.

  Note: No need to display the Id because it should be declared as Key

public IActionResult AddMember(Member member)

 -- This method is http post request of the AddMember() method

 -- Add the details to the database

 -- If the FirstName and Password is same then display the message as per the sample output

public IActionResult WelcomingNote(LoginDetail model)

 -- This method's view page should display the welcome message for the member

 

Create the following views for the EventController class with Razor view Engine

Create a view named EventLogForm.cshtml for the EventLogForm method that has the Login form, Login button id should be 'btnLogin' and Register link's id should 'lnkRegister'

 

Create a view named AddMember.cshtml for the AddMember method that has the Member form, Create button id should be 'btnCreate'

 

Create a view named WelcomingNote.cshtml for the WelcomeNote method that should display the message as per the given sample output. The message should be in a h1 tag with id 'message'

 

When the user enters the valid FirstName and Password in the EventLogForm page, then it should navigate to WelcomingNote page and display the message.

Sample Input/Output:

Step 1:

User launches the application and EventLogForm page is displayed to the user as follows

 



Step 2:

If there are any validation failures in the EventLogForm page, application will display the appropriate message as follows

 



Step 3:

User click on the Register link, then AddMember.cshtml page is displayed to the user as follows

 



Step 4:

If there are any validation failures in the AddMember page, application will display the appropriate message as follows

 



Step 5:

User fill up all the required details(Same first name and password) and click the Create button which will display the message in the same page as follows

 



Step 6:

User fill up all the required details and click the Create button which will save the user details in the database

 



It should navigate to EventLogForm page and enter the valid details

 



Step 7:

WelcomingNote.cshtml page will display the message as follows

 

Editor is loading...
Leave a Comment