Untitled
unknown
plain_text
24 days ago
5.3 kB
1
Indexable
Description Scenario : "Tech Fusion," a leading technology company, is hosting an exciting event where participants have a chance to win a free mobile device. To facilitate the registration process, TechFusion intends to develop an ASP.NET Core application. As a talented software developer, your goal is to design and develop a user-friendly online registration system that allows users to enter the contest and stand a chance to win the free mobile device. Functionalities : Implement the model as per the below-mentioned public properties in FusionLogin.cs Data Type Variable Name Data Annotation string Email -- Required -- Error Message = "Please enter the email" 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 Applicant.cs Data Type Variable Name Data Annotation int Id -- Key string Name -- Required -- Error Message = "Please enter the applicant 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 Email -- Required -- Error Message = "Please enter the email" -- Datatype should be EmailAddress long Contact -- Required -- Error Message = "Please enter the contact details" Implement the below-mentioned public properties in FusionDBContext.cs which extends the DbContext Data Type Variable Name DbSet<Applicant> Applicants 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 FusionController.cs which extends the Controller Method Rules public IActionResult ApplicantLogin() -- This method's view page should get the input from the user and click on the Submit button or need to click the Register link to register the applicant details -- Get the inputs such as Email and Password public IActionResult ApplicantLogin(FusionLogin login) -- This method is http post request of the ApplicantLogin() method -- Check whether the given Email is present in the database or not. If yes then navigate to Success.cshtml page else return to the same page. public IActionResult AddApplicant() -- This method's view page should get the inputs from the user and click on the Create button. -- Get the inputs such as Name, Email, Password, ConfirmPassword, Contact. Note: No need to display the Id because it should be declared as Key public IActionResult AddApplicant(Applicant applicant) -- This method is http post request of the AddApplicant() method -- Add the details to the database -- If the Email and Password is same then display the message as per the sample output public IActionResult Success() -- This method's view page should display the registration completed message for the applicant Create the following views for the FusionController class with Razor view Engine Create a view named ApplicantLogin.cshtml for the ApplicantLogin method that has the Login form, Submit button id should be 'btnSubmit' and Register link's id should 'lnkRegister' Create a view named AddApplicant.cshtml for the AddApplicant method that has the Applicant form, Create button id should be 'btnCreate' Create a view named Success.cshtml for the Success 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 email and password in the ApplicantLogin page, then it should navigate to Success page and display the message. Sample Input/Output: Step 1: User launches the application and ApplicantLogin page is displayed to the user as follows Step 2: If there are any validation failures in the ApplicantLogin page, application will display the appropriate message as follows Step 3: User click on the Register link, then AddApplicant.cshtml page is displayed to the user as follows Step 4: If there are any validation failures in the AddApplicant page, application will display the appropriate message as follows Step 5: User fill up all the required details(Same email and password) and click the Raise 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 ApplicantLogin page and enter the valid details Step 7: Success.cshtml page will display the message as follows
Editor is loading...
Leave a Comment