Overview

Currently new fosters must fill out a foster application via a PDF which can be printed or filled out and saved. We want to create an online application form much like our online adoption application. As a result we are actually going to change the foster application to reflect the adoption application and only change the verbiage of the page slightly to reflect that it is a foster application.

 

Requirements

A new set of Views (cshtml) and ViewModels (cs) will be needed and modifications to the existing Adoption Application database tables will be required. Because we want to base the Foster Application on the Adoption Application we will be re-using a lot of code and logic rather than starting from scratch.

Database Changes

Make sure scripts are created to reflect the below changes

  1. Modify table AdoptionApplications to contain a new column
    1. column name: AppType
    2. data type: char(1) IS NULLABLE
    3. Script goes in \txhr\HuskyRescue.Model\SqlScripts
      1. Name script with date and number (starting at zero), see existing scripts for example
  2. Create script to set all existing applications to “A” in the AppType column
    1. Script goes in \txhr\HuskyRescue.Model\SqlScripts\DataInserts

Code Changes

  1. Controllers
    1. Create new controller called “FosterController”
      1. Goes in \txhr\HuskyRescue.Web\Controllers
    2. Copy code from Adoption Controller and rename all instances of Adoption to Foster
      1. Take note of casing A vs a
  2. ViewModels
    1. ViewModels go in \txhr\HuskyRescue.Web.Core\ViewModel\Entity
    2. AdoptionApplication.cs
      1. Add new property AppType with type string
      2. Default to “A” in constructor
    3. FosterApplication.cs
      1. Inherit class AdoptionApplication
      2. Override all properties that have DisplayName attributes with the word “Adopt” and change to “Foster”
      3. Default AppType to “F” in constructor
  3. Scripts
    1. Copy \txhr\HuskyRescue.Web\Scripts\Controllers\Adoption\AdoptionApplication.js to new file \txhr\HuskyRescue.Web\Scripts\Controllers\Adoption\FosterApplication.js
    2. Create Foster script bundle
      1. \txhr\HuskyRescue.Web\App_Start\BundleConfig.cs
  4. Views
    1. Right click on the Apply action in the FosterController and create a view for it
      1. Copy the code from the \txhr\HuskyRescue.Web\Views\Adoption\Apply.cshtml view to the new Foster Apply.cshtml and change all “Adoption” to “Foster”
    2. Create a new shared view under \txhr\HuskyRescue.Web\Views\Shared\EditorTemplates\ and copy the existing view AdoptionApplication.cshtml to FosterApplication.cshtml
      1. change all “Adoption” to “Foster”
      2. update script render to reflect new foster bundle
    3. Update Fostering info page to have link to new online Foster Application
      1. \txhr\HuskyRescue.Web\Views\Info\Fostering.cshtml
  5. Model
    1. Update the framework EDMX file
      1. \txhr\HuskyRescue.Model\HuskyRescueModel.edmx
      2. Open the file, right click and select “Update Model from DataBase…”, in the Add tab select the new FosterApplication table
    2. Update the class used to update the data model
      1. \txhr\HuskyRescue.Core\Data\Extensions\HuskyRescueEntitiesHelper.cs
      2. Duplicate the code inside the AdoptionApp region; repurpose the code for the new Foster Application table
    3. Update the class used to call the HuskyRescueEntitiesHelper class with the ViewModels from the Views
      1. \txhr\HuskyRescue.Web.Core\Data\HuskyRescueEntitiesManager.cs
      2. Duplicate the code inside the AdoptionApp method as FosterApp and call the new methods in HuskyRescueEntitiesHelper
  6. AutoMapper
    1. \txhr\HuskyRescue.Web.Core\Infrastructure\Config\AutoMapperConfig.cs
      1. Add mapping for new FosterApplication ViewModel to FosterApplication class in the EF Model
  7. PDF filling
    1. A new PDF will be provided that is a copy of the Adoption Application PDF which will need to be referenced  in GenerateAdoptionAppPdf method (\txhr\HuskyRescue.Core\Pdf\GenerateAdoptionAppPdf.cs)
      1. Using the AppType select the different PDF file to be used and the verbiage used in the email sent

Last edited Jun 7, 2013 at 5:10 AM by jamesbolton, version 1

Comments

No comments yet.