task

[ CLASS App_Code/BusinessRules.cs ]

[WHAT]

  1. [ def ] BusinessRules - is a class to work with objects, takes an object, of many different types and the tests its properties to ensure they are compliant with the currently specified properties of said object
  2. [ args ] none, [Library, Book, Chapter, Article ], [Warehouse, Inventory, ItemCategory, Item], [sServer, sApp, Procedure, Step] 

[WHY]

  1. [Properties]
    1. LIST.db = 
    2. Errors[] 
  2. [Constructors]
    1. BusinessRules()
    2. BusinessRules(Library library)
    3. BusinessRules(Book book)
    4. BusinessRules(Chapter chapter)*
    5. BusinessRules(Article article)
    6. BusinessRules(Warehouse toValidate)
    7. BusinessRules(Inventory toValidate)
    8. BusinessRules(ItemCategory toValidate)
    9. * BusinessRules(Item toValidate)
    10. BusinessRules(sServer toValidate)
    11. BusinessRules(sApp toValidate)
    12. BusinessRules(Procedure toValidate)
    13. BusinessRules(Step toValidate)
    14. BusinessRules(Community toValidate)
    15. BusinessRules(Member toValidate)
    16. BusinessRules(MemberGroup toValidate)
    17. BusinessRules(Person toValidate)
    18. BusinessRules(Calendar toValidate)
    19. BusinessRules(Plan toValidate)
    20. BusinessRules(TaskGroup toValidate)
    21. BusinessRules(Task toValidate)
    22. BusinessRules(Atlas toValidate)
    23. BusinessRules(Map toValidate)
    24. BusinessRules(Sector toValidate)
    25. BusinessRules(Location toValidate)
  3. [Methods]
    1. isStringTypeName(string name) 
      1. test string length(min1, max90)
      2. test for invalid characters()
    2. isStringTypeDescription(string description) 
      1. test string length(min1, max90),
    3. isParentId(int num) 
      1. test value is valid integer, within range  
    4. isStringTypeContent(string content)
      1. test if null
      2. test length
      3. test characters
    5. isValidQty(int quantity)
      1. test  
    6. isValidCOGS(decimal cogs)
      1. test 

[WHERE]

  1. [called from] 
    1. ] add library - POST
    2. ] edit library - POST
    3. ] add book 
    4. ] edit book 

[WHEN]

  1. []

[EXAMPLE]

  1. ] Library - has property "name_library", name_library can't exceed x characters, name_library can't be empty, name_library can't contain specified characters(), ...  

[HOW-TO]

  1. ]

[REFERENCE]

  1. ] (FEA id=1058) see also 1571*
  2. ] CLASS BusinessRules.cs -v-001 - original version includes code where constructor task "Library" as arg, sets objects "library" instance to values of passed 'library' then tests using method Library() 
  3. ] CLASS BusinessRules.cs -v-002 - REMOVED above code, replaced with calls to validation tests in the constructor

developer implementation

[.process]

  1.  

[.notes]

  1.  

[.by_date]

  1. [YYYY-mm-DD]

status 

[previously]

  1. x] 

[currently]

[next]

Details Photos Edit more

Details

ID: 1831

NAME: CLASS-BusinessRules

DESCRIPTION: CLASS BusinessRules, object to perform validation on user input data

START DATE TIME: 2013-06-10 11:00:00

EST DURATION: 03:00:00

END DATE TIME: 2013-06-10 14:00:00

STATUS: Completed

PRIORITY: -5

OWNER ID: 75

Content Photos Edit more

photos

photos for this task

actions

Agenda Email task SMS task Priorities