0% found this document useful (0 votes)
2 views

MVC Assignment FrontEndTrack3

The document outlines three scenarios involving the creation of classes and ASP.Net MVC applications. Scenario 1 focuses on defining a Partner class and its derived ManagedPartner class, including methods for managing specializations and validating email properties. Scenarios 2 and 3 detail the development of ASP.Net MVC applications that interact with a REST API and a database to manage employee and project data, respectively, including CRUD operations and client-side validations.

Uploaded by

ashish Gupta
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

MVC Assignment FrontEndTrack3

The document outlines three scenarios involving the creation of classes and ASP.Net MVC applications. Scenario 1 focuses on defining a Partner class and its derived ManagedPartner class, including methods for managing specializations and validating email properties. Scenarios 2 and 3 detail the development of ASP.Net MVC applications that interact with a REST API and a database to manage employee and project data, respectively, including CRUD operations and client-side validations.

Uploaded by

ashish Gupta
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Scenario 1:

Define a class named Partner. Define the following properties (choose


appropriate names for the properties): partner ID, partner name, partner -
contact e-mail, partner geography, partner specializations (an array of
specialization names).
Define methods to add and remove specializations, one at a time (method
accepts a name, and adds or removes from the array of specializations
based on the method).
Define methods to update partner geography (perform validations such as
it’s not set to null, or empty string, etc. before performing the update).
Define another class named PartnerAccountManager. Define the following
properties: Employee ID, E-mail, Manager Email, Specialization (string).
Derive a ManagedPartner class from Partner Class. Add properties:
Managed From (date), PartnerAccountManager. Define a method to
update the PartnerAccountManager (perform validations for the object not
being null, object has the necessary properties with values for the partner
account manager).
For all e-mail properties, perform a regex-based validation for the set
accessor before allowing an update.

Scenario 2:
Use the WorldWideImporters Database to complete this Assignment. Use
ADO .Net to interact with the database from C# code. Do not use entity
framework to develop the solution. Use ADO .Net to work with the
database.
1. Create an ASP.Net MVC Web application.
2. Populate employee data into a table from REST API using AJAX Calls.
a. REST API End Point:
http://dummy.restapiexample.com/api/v1/employees
b. REST API Method: GET
3. Create a Text box and a Filter button on the top table – to filter the table of
employees by id
a. Textbox should allow users to enter employee id as input.
b. On click on the submit button, table should be updated with the data
of that employee only.
c. Show ‘No Records Found’ message if the employee id is not found.
d. REST API End Point:
http://dummy.restapiexample.com/api/v1/employee/1
e. REST API Method: GET
4. Create a form below the table to enter new employee data.
a. Textboxes should take employee name, salary and age as input.
b. On click of the submit button, post the form data to the REST API and
show that data in the same table above. Ensure data is added in
correct order in table (end / beginning – depending on how data is
ordered by default in your table)
c. REST API End Point:
http://dummy.restapiexample.com/api/v1/create
d. REST API Method: POST
5. Allow users to update the employee data using the same form, by adding
one more Textbox for taking employee id as input
a. The 4th textbox should be optional.
b. When it is filled, CREATE button at end of form should be disabled
and UPDATE button beside it should be enabled. By default, it stays
disabled.
c. On clicking of UPDATE, clear form data and disable the button.
CREATE button should be enabled by default.
d. REST API End Point:
http://dummy.restapiexample.com/api/v1/update/21
e. REST API Method: PUT
6. Allow users to delete the employee data using the table shown above –
a. In each table row, show employee data and a cross (X) icon beside it
to Delete the employee record.
b. By clicking the (X) icon, trigger REST API call to delete the employee
with the specific ID.
c. REST API End Point:
http://dummy.restapiexample.com/api/v1/update/21
d. REST API Method: DELETE
e. The deleted record should be removed from the table.
Reference: http://dummy.restapiexample.com/

Scenario 3:
Use the WorldWideImporters Database to complete this Assignment. Use
ADO .Net to interact with the database from C# code. Do not use entity
framework to develop the solution. Use ADO .Net to work with the
database.

1. Create a new ASP.Net MVC Web API Application – for tracking Project
Details. Add a new table in database for Projects – containing columns
Project ID, name, status and revenue.
2. Create /GetProjects endpoint to get all projects data
a. Endpoint Method: GET
b. Show all the projects in a table in the view – should all columns
mentioned above.
3. Create /UpdateProject endpoint to update the project data in the table.
a. Endpoint Method: POST
b. Input: Form data with project id as mandatory input. When the user
inputs the project ID, displays the current attributes of the product in
the form fields in editable controls (so that the user can change the
values). Use another web API call to retrieve the current values of the
attributes. User should be able to update any of the project details,
and then click on ‘Update’. Have client-side validations to ensure that
all the necessary fields are filled by the user.
c. Invoke UpdateProjects end point to save the updated values of the
product in the database.
4. Create /AddProject endpoint to insert new project details.
a. Endpoint Method: PUT
b. Input: Form data with required data points. Have input controls on
the form so that the user can input the values for the attributes of
the product. Have client-side validations to ensure that all the
necessary fields are input by the user. When the user clicks on Add,
invoke /AddProject end point to add the project data to the
database.
5. Create /DeleteProject endpoint to delete the existing product from the
table.
a. Endpoint Method: DELETE
b. Input: Project ID.
c. On entering an invalid ID and clicking on Delete – Should show error
message of invalid Project ID.
d. On entering correct ID, show message on UI as “Project {X} deleted”,
where X is the name of the project deleted latest.
6. Like the above, create endpoints for Application.Countries table available in
the database (GetCountries, UpdateCountry, AddCountry, and
DeleteCountry).

Submission instructions:
Within your code folders, please delete the bin and obj folders from all the
projects. Capture screenshots of the execution results on your machine (with
system date and time at the bottom right visible) for scenarios 2 and 3. Then, zip
the solutions along with the screenshots together into a single zip file. Name the
zip file as <EmpID>_<Name>.zip (For example, EMP01831_AshishG.zip).

You might also like