SlideShare a Scribd company logo
1 of 17
Download to read offline
SetFocus .NET Framework Project
Objective
Build parts of the business tier for a retail company, consisting of two assemblies;
Foundation and AppTypes.

Summary
This project demonstrates fundamental .NET skills and interaction between an n-tiered
application. A list of C# / .NET skills used in this project:

• Delegates, events                             • Abstract classes & interfaces
• Custom exception/attribute classes            • Enumerations
• Custom EventArgs classes                      • Properties
• Event logger and collection classes           • Custom Enumerators Implementation of
• Generic Collections                            ISerializable, IComparer, IComparable, &
• Custom Serializations                          IList<T> interfaces
• Binary & SOAP Formatters

Foundation Assembly
This assembly contains the foundation interfaces and base classes used throughout the
project.




Mark Jackson                mjackson6@kc.rr.com                       Page 1 of 17
AppTypes Assembly
This assembly contains various entity, collection, and exception classes used by the
business.




Mark Jackson               mjackson6@kc.rr.com                      Page 2 of 17
SetFocus Library Phase 1 Project

Objective
Create a Windows Forms-based front-end application that will provide a librarian with a
visual interface through which librarian functions are performed.

Requirements

   •   Design and develop a front end application that satisfies the four basic
       functionalities: Add Adult Member, Add Juvenile Member, Check In a book, Check
       Out a book.
   •   Develop code that is easily maintainable.
   •   Provide validation for all required fields.
   •   Provide adequate error handling.
   •   Produce a user interface that is intuitive, requiring minimal training for users while
       minimizing resource utilization.

Summary
This project demonstrates the use of .NET windows form development techniques. Some of
the techniques used include:
    • User input validation and feedback using the ErrorProvider class.
    • Data binding to a DataGridView control and manipulation of the control.
    • Effective error and exception handling.
    • Use of regular expressions for input validation.
    • Use of a supplied XML file to populate the selection items in a ComboBox control.
    • Inheritance from the TextBox control to perform user input validation.
    • Use of Multiple Document Interface (MDI) forms.

Description
Menus on the parent MDI form were used to access the Add Adult,
Add Juvenile, Check In, and Member Information child MDI forms.

The code behind the user interface (MJ.LibraryWinClient) handled
screen changes, and contained the logic to perform each operation.

The Business Layer (MJ.LibraryBusiness) provides the connection
between the UI and the library of data access functions. In this
project, all book information, member records, loan records, etc.
are all stored on SQL Server 2005. Access to the database occurs
through a Data Access Layer, which was provided as a
precompiled DLL for the project. The UI does not know how the
data is accessed or retrieved. If changes in data access are
necessary, the front end does not need to be modified, providing
for scalability.




Mark Jackson                mjackson6@kc.rr.com                      Page 3 of 17
The MJ.LibraryContolLibrary code provides a means for validation and error handling. An
abstract class, ValidationTextBox, inherits from the TextBox control and contains an
abstract method to perform validation on the text the user entered in the text box. Other
classes, specific to the type of data entered, inherit from ValidationTextBox and override
the abstract method. Through polymorphism, each of these other classes performs the
appropriate input validation.

Display Adult Member:




Mark Jackson               mjackson6@kc.rr.com                     Page 4 of 17
Add Juvenile Member:




Check Out Library Item:




Mark Jackson           mjackson6@kc.rr.com   Page 5 of 17
Check In Library Item:




Mark Jackson             mjackson6@kc.rr.com   Page 6 of 17
SetFocus Library Phase 2 Project

Objective
Develop code to replace the Data Access and Library Entities assemblies supplied in the
Library Phase 1 project.

Requirements
   •   Develop Transact-SQL (T-SQL) Stored Procedures to access the library database to
       perform all library functions.
   •   Generate T-SQL scripts to fully test the Stored Procedures.
   •   Develop code in ADO.NET to call the Stored Procedures for all library functions.
   •   Develop the code for all classes in the Library Entities assembly.
   •   Develop code that is easily maintainable.
   •   Provide adequate error handling.
   •   Use database-programming techniques that provide maximum programming
       flexibility and control while minimizing resource utilization.
   •   Automatically convert the membership to adult when displaying information for a
       juvenile member that has reached 18 years of age (optional).
   •   Highlight an overdue library item when display in the DataGridView control
       (optional).

Summary
This project demonstrates the use of ADO.NET and T-SQL to access a SQL Server 2005
database. Some of the techniques used include:
   • Use of Microsoft SQL Server Management Studio to develop Stored Procedures and
       test scripts.
   • Data validation in SQL.
   • Implementing error handling in SQL.
   • Accessing Stored Procedures through the System.Data.SqlClient namespace.
   • Retrieve and process result sets returned from Stored Procedures.
   • Process errors raised by T-SQL in ADO.NET using error numbers and states.
   • Use Microsoft Visual Studio 2005 to create and utilize strongly typed datasets based
       on Stored Procedures.
   • Change the appearance of data displayed in a DataGridView control.

Description
The goal of this project was to recreate the DLLs provided for the Library Phase 1 project.

LibraryEntities contains the various classes and enumerations referenced by the entire
project. It contains the AdultMember, JuvenileMember, Member, Item, LibraryException
classes as well the ErrorCode enumeration. It also contains the strongly typed
ItemsDataSet dataset.

The LibraryDataAccess project provides the layer between the Business layer and the
database. The UI (user interface) layer makes requests to the LibraryBusiness layer, which
in turn makes the request of the Data Access layer. The Data Access layer executes the
appropriate SQL Server database Stored Procedures through ADO.NET code. The
connection string for the library database is stored at the project level.
Mark Jackson                 mjackson6@kc.rr.com                       Page 7 of 17
The DataAccess and Business layers were not modified except to implement the new
functionality.

The (partial) AddMember method for Juvenile Members in the Data Access
Layer:




A T-SQL Stored Procedure for Adding a Juvenile Member:
/****** Object: StoredProcedure [dbo].[AddJuvenileMember] Script Date: 06/28/2009
15:11:39 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
create proc [dbo].[AddJuvenileMember]
        @FirstName varchar(15), -- The new member's first name
        @MiddleInitial char,      -- The new member's middle initial
        @LastName varchar(15), -- The new member's last name
        @AdultMemberId smallint, -- The new member's parent's member ID
        @BirthDate datetime       -- The new member's birthdate
as
-- Procedure to add a new juvenile member.
-- Check parameters not allowed to be null.
Mark Jackson              mjackson6@kc.rr.com                   Page 8 of 17
if @FirstName is null
begin
        -- First name is invalid.
        raiserror('Invalid value for first name.', 14, 1)
        return 0
end
if @LastName is null
begin
        -- Last name is invalid.
        raiserror('Invalid value for last name.', 14, 1)
        return 0
end
if @AdultMemberId is null or @AdultMemberId < 1
begin
        -- Adult member ID is invalid.
        raiserror('Invalid value for adult member ID.', 14, 2)
        return 0
end
if @BirthDate is null or @BirthDate < dateadd(year, -18, getdate())
begin
        -- Birthdate is invalid.
        raiserror('Invalid value for birthdate.', 14, 3)
        return 0
end
if not exists (select * from adult where member_no = @AdultMemberId)
begin
-- Adult member ID is invalid.
        raiserror('Adult member does not exist.', 14, 2)
        return 0
end
-- Check if adult membership has expired.
if (select expr_date from adult where member_no = @AdultMemberId) < getdate()
begin
        -- Adult member ID is expired.
        raiserror('Adult member ID is expired.', 14, 4)
        return 0
end
declare @MemberId smallint
begin tran
begin try
        -- Insert the new juvenile member into the member table.
        insert member
        values(@LastName, @FirstName, @MiddleInitial, null)
end try
begin catch
        -- Problem inserting row into member table.
        raiserror('Add juvenile member failed.', 14, 1)
        rollback tran
        return 0
end catch
Mark Jackson            mjackson6@kc.rr.com                  Page 9 of 17
-- Save the member ID.
set @MemberId = scope_identity()
begin try
       -- Insert the new juvenile member into the juvenile table.
       insert juvenile
       values(@MemberId, @AdultMemberId, @BirthDate)
end try
begin catch
       -- Problem inserting row into adult table.
       raiserror('Add juvenile member failed.', 14, 1)
       rollback tran
       return 0
end catch
commit tran
return @MemberId
GO




Mark Jackson               mjackson6@kc.rr.com                      Page 10 of 17
SetFocus Library Phase 3 Project

Objective
Create a web application that supports all the functionality required for Phase 1 and 2 of
the Library project.

Additional Requirements
   •   When an adult is displayed that has an expired membership, give the librarian the
       option to renew it.
   •   Use hyperlinks to navigate between pages.
   •   The web application project must use Forms-based authentication and
       authorization. Only members of the Librarian role must be able to access the web
       application.

Summary
This project demonstrates the use of ASP.NET. Some of the techniques used include:
   • Create and use ASP.NET Master Pages to provide a consistent look across the
       website.
   • Use of Membership Roles to restrict access to pages.
   • Utilizing ViewState and SessionState objects to save data between post backs.
   • Create a web interface that is intuitive and requires minimal training.
   • Use various validation controls to validate input before post back.
   • Data binding to a GridView control and manipulation of the control.

Description
The Library Business and Data Access layers as well as the Library Entities classes remain
unchanged, except to implement the new functionality.

Dialog boxes in the Windows form projects were replaced with a single web page, since the
layout of the page remained the same. Only the text explaining the user options changed.

The QueryString property of the HttpRequest was used to display the new member on the
Member Info page after the member was added. It was also used to display messages upon
entry to the Member Info page.




Mark Jackson                mjackson6@kc.rr.com                      Page 11 of 17
The Log In Page:




Adding a new Library Item:




Mark Jackson         mjackson6@kc.rr.com   Page 12 of 17
The Member Information Page:




Mark Jackson        mjackson6@kc.rr.com   Page 13 of 17
The (partial) Page_Load Method for the Member Information Page:




Mark Jackson         mjackson6@kc.rr.com             Page 14 of 17
SetFocus Library Phase 4 Project

Objective
Modify the Library Project to use Web Services.

Requirements
   •   Create a Web service that calls into either the business or data layer.
   •   Update the layers in the system to use the service as deemed appropriate.
   •   Make sure the Web service supports the Basic Profile and uses Document/Literal
       formatting of the Soap messages.
   •   Customize formatting of XML for some of the business types.
   •   Employ WSE 3.0 security using Certificates. Signing, encryption and secure session
       are required.
   •   Support previous project functionality.

Summary
This project demonstrates the use of Web Service implementation techniques. Some of the
techniques used include:
   • Customization of XML attributes
   • Employment of WSE 3.0 security setting
   • Usage of Certificates for Security, Signing, and Encryption
   • True N-Tier structures
   • Use of SoapException objects

Description
The Business Layer was modified to call the Web Service, which called the Data Access
Layer.

The Library Entities classes were changed to control XML Serialization.

Since Basic Profile Web Services do not natively support overloaded operations, the
overloaded methods in the Data Access Layer had to be separated into methods with
different names in the Web Service.

Since pass by reference behavior is not available natively with Web services, the Data
Access Layer’s AddMember methods were changed. Previously the AddMember methods
stored the new member’s membership ID number in the Member object whose reference
was passed in as a parameter. The methods were changed to return the membership ID
number to the Web Service method. The Web Service method returned the value to the
Business Layer.

The custom LibraryExceptions are thrown in the Data Access Layer and caught in the web
methods. The web methods throw SoapExceptions to the Business Layer. The
InnerException property of the SoapException is set to a reference of the LibraryException.

The GetMember web methods return the base class Member. Because these web methods
can return a reference to either the derived AdultMember or JuvenileMember class objects,
XmlInclude attributes were used.
Mark Jackson               mjackson6@kc.rr.com                     Page 15 of 17
The Web Methods of the Web Service:




Mark Jackson        mjackson6@kc.rr.com   Page 16 of 17
The GetItem and AddAdultMember WebMethods:




Mark Jackson       mjackson6@kc.rr.com       Page 17 of 17

More Related Content

What's hot

Arthur Del Prado .Net Portfolio
Arthur Del Prado .Net PortfolioArthur Del Prado .Net Portfolio
Arthur Del Prado .Net Portfolioartsdp
 
Spring Web Service, Spring JMS, Eclipse & Maven tutorials
Spring Web Service, Spring JMS, Eclipse & Maven tutorialsSpring Web Service, Spring JMS, Eclipse & Maven tutorials
Spring Web Service, Spring JMS, Eclipse & Maven tutorialsRaghavan Mohan
 
Spring andspringboot training
Spring andspringboot trainingSpring andspringboot training
Spring andspringboot trainingMallikarjuna G D
 
Portfolio
PortfolioPortfolio
Portfoliojeanux
 
Transformation of Java Server Pages: A Modern Approach
Transformation of Java Server Pages: A Modern ApproachTransformation of Java Server Pages: A Modern Approach
Transformation of Java Server Pages: A Modern ApproachIRJET Journal
 
Introduction to OO, Java and Eclipse/WebSphere
Introduction to OO, Java and Eclipse/WebSphereIntroduction to OO, Java and Eclipse/WebSphere
Introduction to OO, Java and Eclipse/WebSphereeLink Business Innovations
 
J2 EEE SIDES
J2 EEE  SIDESJ2 EEE  SIDES
J2 EEE SIDESbputhal
 
Jdbc Lecture5
Jdbc Lecture5Jdbc Lecture5
Jdbc Lecture5phanleson
 
Ee java lab assignment 4
Ee java lab assignment 4Ee java lab assignment 4
Ee java lab assignment 4Kuntal Bhowmick
 

What's hot (19)

Arthur Del Prado .Net Portfolio
Arthur Del Prado .Net PortfolioArthur Del Prado .Net Portfolio
Arthur Del Prado .Net Portfolio
 
Spring Web Service, Spring JMS, Eclipse & Maven tutorials
Spring Web Service, Spring JMS, Eclipse & Maven tutorialsSpring Web Service, Spring JMS, Eclipse & Maven tutorials
Spring Web Service, Spring JMS, Eclipse & Maven tutorials
 
Spring andspringboot training
Spring andspringboot trainingSpring andspringboot training
Spring andspringboot training
 
Chapter6 database connectivity
Chapter6 database connectivityChapter6 database connectivity
Chapter6 database connectivity
 
Spring Framework -I
Spring Framework -ISpring Framework -I
Spring Framework -I
 
Portfolio
PortfolioPortfolio
Portfolio
 
TY.BSc.IT Java QB U5
TY.BSc.IT Java QB U5TY.BSc.IT Java QB U5
TY.BSc.IT Java QB U5
 
Overview of JEE Technology
Overview of JEE TechnologyOverview of JEE Technology
Overview of JEE Technology
 
Hibernate I
Hibernate IHibernate I
Hibernate I
 
Transformation of Java Server Pages: A Modern Approach
Transformation of Java Server Pages: A Modern ApproachTransformation of Java Server Pages: A Modern Approach
Transformation of Java Server Pages: A Modern Approach
 
Hibernate notes
Hibernate notesHibernate notes
Hibernate notes
 
TY.BSc.IT Java QB U4
TY.BSc.IT Java QB U4TY.BSc.IT Java QB U4
TY.BSc.IT Java QB U4
 
Introduction to OO, Java and Eclipse/WebSphere
Introduction to OO, Java and Eclipse/WebSphereIntroduction to OO, Java and Eclipse/WebSphere
Introduction to OO, Java and Eclipse/WebSphere
 
J2 EEE SIDES
J2 EEE  SIDESJ2 EEE  SIDES
J2 EEE SIDES
 
Spring Framework-II
Spring Framework-IISpring Framework-II
Spring Framework-II
 
Jdbc Lecture5
Jdbc Lecture5Jdbc Lecture5
Jdbc Lecture5
 
Ee java lab assignment 4
Ee java lab assignment 4Ee java lab assignment 4
Ee java lab assignment 4
 
TY.BSc.IT Java QB U6
TY.BSc.IT Java QB U6TY.BSc.IT Java QB U6
TY.BSc.IT Java QB U6
 
Working with Servlets
Working with ServletsWorking with Servlets
Working with Servlets
 

Similar to Mark Jackson\'s Portfoilo

Software Portfolio - SetFocus
Software Portfolio - SetFocusSoftware Portfolio - SetFocus
Software Portfolio - SetFocusAlexander Vogel
 
Il 09 T3 William Spreitzer
Il 09 T3 William SpreitzerIl 09 T3 William Spreitzer
Il 09 T3 William Spreitzerwspreitzer
 
C# .NET Developer Portfolio
C# .NET Developer PortfolioC# .NET Developer Portfolio
C# .NET Developer Portfoliocummings49
 
Appalanaidu_4.4 Years Exp in DotNet Technology
Appalanaidu_4.4 Years Exp in DotNet TechnologyAppalanaidu_4.4 Years Exp in DotNet Technology
Appalanaidu_4.4 Years Exp in DotNet TechnologyAPPALANAIDU KONDALA
 
Web-Dev Portfolio
Web-Dev PortfolioWeb-Dev Portfolio
Web-Dev Portfolionwbgh
 
Framework Enabling End-Users to Maintain Web Applications (ICICWS2015)
Framework Enabling End-Users to Maintain Web Applications (ICICWS2015)Framework Enabling End-Users to Maintain Web Applications (ICICWS2015)
Framework Enabling End-Users to Maintain Web Applications (ICICWS2015)Masayuki Nii
 
Data Access
Data AccessData Access
Data Accesseclumson
 
Darian Lowe Portfolio
Darian Lowe PortfolioDarian Lowe Portfolio
Darian Lowe Portfoliodarian.lowe
 
Pa 10 n1 louis decroo jr.
Pa 10 n1 louis decroo jr.Pa 10 n1 louis decroo jr.
Pa 10 n1 louis decroo jr.ldecroo
 
Tony Vitabile .Net Portfolio
Tony Vitabile .Net PortfolioTony Vitabile .Net Portfolio
Tony Vitabile .Net Portfoliovitabile
 
Anil_Resume_latest
Anil_Resume_latestAnil_Resume_latest
Anil_Resume_latestanil atyam
 
Final report mobile shop
Final report   mobile shopFinal report   mobile shop
Final report mobile shopViditsingh22
 
Robert Parkin Portfolio
Robert Parkin PortfolioRobert Parkin Portfolio
Robert Parkin Portfoliorsparkin
 
MVC Design Pattern in JavaScript by ADMEC Multimedia Institute
MVC Design Pattern in JavaScript by ADMEC Multimedia InstituteMVC Design Pattern in JavaScript by ADMEC Multimedia Institute
MVC Design Pattern in JavaScript by ADMEC Multimedia InstituteRavi Bhadauria
 

Similar to Mark Jackson\'s Portfoilo (20)

Software Portfolio - SetFocus
Software Portfolio - SetFocusSoftware Portfolio - SetFocus
Software Portfolio - SetFocus
 
Il 09 T3 William Spreitzer
Il 09 T3 William SpreitzerIl 09 T3 William Spreitzer
Il 09 T3 William Spreitzer
 
C# .NET Developer Portfolio
C# .NET Developer PortfolioC# .NET Developer Portfolio
C# .NET Developer Portfolio
 
SetFocus Portfolio
SetFocus PortfolioSetFocus Portfolio
SetFocus Portfolio
 
.NET Portfolio
.NET Portfolio.NET Portfolio
.NET Portfolio
 
Appalanaidu_4.4 Years Exp in DotNet Technology
Appalanaidu_4.4 Years Exp in DotNet TechnologyAppalanaidu_4.4 Years Exp in DotNet Technology
Appalanaidu_4.4 Years Exp in DotNet Technology
 
Web-Dev Portfolio
Web-Dev PortfolioWeb-Dev Portfolio
Web-Dev Portfolio
 
Framework Enabling End-Users to Maintain Web Applications (ICICWS2015)
Framework Enabling End-Users to Maintain Web Applications (ICICWS2015)Framework Enabling End-Users to Maintain Web Applications (ICICWS2015)
Framework Enabling End-Users to Maintain Web Applications (ICICWS2015)
 
Kasi Resume
Kasi ResumeKasi Resume
Kasi Resume
 
Data Access
Data AccessData Access
Data Access
 
JDBeyler
JDBeylerJDBeyler
JDBeyler
 
Darian Lowe Portfolio
Darian Lowe PortfolioDarian Lowe Portfolio
Darian Lowe Portfolio
 
Pa 10 n1 louis decroo jr.
Pa 10 n1 louis decroo jr.Pa 10 n1 louis decroo jr.
Pa 10 n1 louis decroo jr.
 
ASP.NET Lecture 4
ASP.NET Lecture 4ASP.NET Lecture 4
ASP.NET Lecture 4
 
Tony Vitabile .Net Portfolio
Tony Vitabile .Net PortfolioTony Vitabile .Net Portfolio
Tony Vitabile .Net Portfolio
 
Anil_Resume_latest
Anil_Resume_latestAnil_Resume_latest
Anil_Resume_latest
 
Final report mobile shop
Final report   mobile shopFinal report   mobile shop
Final report mobile shop
 
Robert Parkin Portfolio
Robert Parkin PortfolioRobert Parkin Portfolio
Robert Parkin Portfolio
 
new final CV
new final CVnew final CV
new final CV
 
MVC Design Pattern in JavaScript by ADMEC Multimedia Institute
MVC Design Pattern in JavaScript by ADMEC Multimedia InstituteMVC Design Pattern in JavaScript by ADMEC Multimedia Institute
MVC Design Pattern in JavaScript by ADMEC Multimedia Institute
 

Mark Jackson\'s Portfoilo

  • 1. SetFocus .NET Framework Project Objective Build parts of the business tier for a retail company, consisting of two assemblies; Foundation and AppTypes. Summary This project demonstrates fundamental .NET skills and interaction between an n-tiered application. A list of C# / .NET skills used in this project: • Delegates, events • Abstract classes & interfaces • Custom exception/attribute classes • Enumerations • Custom EventArgs classes • Properties • Event logger and collection classes • Custom Enumerators Implementation of • Generic Collections ISerializable, IComparer, IComparable, & • Custom Serializations IList<T> interfaces • Binary & SOAP Formatters Foundation Assembly This assembly contains the foundation interfaces and base classes used throughout the project. Mark Jackson mjackson6@kc.rr.com Page 1 of 17
  • 2. AppTypes Assembly This assembly contains various entity, collection, and exception classes used by the business. Mark Jackson mjackson6@kc.rr.com Page 2 of 17
  • 3. SetFocus Library Phase 1 Project Objective Create a Windows Forms-based front-end application that will provide a librarian with a visual interface through which librarian functions are performed. Requirements • Design and develop a front end application that satisfies the four basic functionalities: Add Adult Member, Add Juvenile Member, Check In a book, Check Out a book. • Develop code that is easily maintainable. • Provide validation for all required fields. • Provide adequate error handling. • Produce a user interface that is intuitive, requiring minimal training for users while minimizing resource utilization. Summary This project demonstrates the use of .NET windows form development techniques. Some of the techniques used include: • User input validation and feedback using the ErrorProvider class. • Data binding to a DataGridView control and manipulation of the control. • Effective error and exception handling. • Use of regular expressions for input validation. • Use of a supplied XML file to populate the selection items in a ComboBox control. • Inheritance from the TextBox control to perform user input validation. • Use of Multiple Document Interface (MDI) forms. Description Menus on the parent MDI form were used to access the Add Adult, Add Juvenile, Check In, and Member Information child MDI forms. The code behind the user interface (MJ.LibraryWinClient) handled screen changes, and contained the logic to perform each operation. The Business Layer (MJ.LibraryBusiness) provides the connection between the UI and the library of data access functions. In this project, all book information, member records, loan records, etc. are all stored on SQL Server 2005. Access to the database occurs through a Data Access Layer, which was provided as a precompiled DLL for the project. The UI does not know how the data is accessed or retrieved. If changes in data access are necessary, the front end does not need to be modified, providing for scalability. Mark Jackson mjackson6@kc.rr.com Page 3 of 17
  • 4. The MJ.LibraryContolLibrary code provides a means for validation and error handling. An abstract class, ValidationTextBox, inherits from the TextBox control and contains an abstract method to perform validation on the text the user entered in the text box. Other classes, specific to the type of data entered, inherit from ValidationTextBox and override the abstract method. Through polymorphism, each of these other classes performs the appropriate input validation. Display Adult Member: Mark Jackson mjackson6@kc.rr.com Page 4 of 17
  • 5. Add Juvenile Member: Check Out Library Item: Mark Jackson mjackson6@kc.rr.com Page 5 of 17
  • 6. Check In Library Item: Mark Jackson mjackson6@kc.rr.com Page 6 of 17
  • 7. SetFocus Library Phase 2 Project Objective Develop code to replace the Data Access and Library Entities assemblies supplied in the Library Phase 1 project. Requirements • Develop Transact-SQL (T-SQL) Stored Procedures to access the library database to perform all library functions. • Generate T-SQL scripts to fully test the Stored Procedures. • Develop code in ADO.NET to call the Stored Procedures for all library functions. • Develop the code for all classes in the Library Entities assembly. • Develop code that is easily maintainable. • Provide adequate error handling. • Use database-programming techniques that provide maximum programming flexibility and control while minimizing resource utilization. • Automatically convert the membership to adult when displaying information for a juvenile member that has reached 18 years of age (optional). • Highlight an overdue library item when display in the DataGridView control (optional). Summary This project demonstrates the use of ADO.NET and T-SQL to access a SQL Server 2005 database. Some of the techniques used include: • Use of Microsoft SQL Server Management Studio to develop Stored Procedures and test scripts. • Data validation in SQL. • Implementing error handling in SQL. • Accessing Stored Procedures through the System.Data.SqlClient namespace. • Retrieve and process result sets returned from Stored Procedures. • Process errors raised by T-SQL in ADO.NET using error numbers and states. • Use Microsoft Visual Studio 2005 to create and utilize strongly typed datasets based on Stored Procedures. • Change the appearance of data displayed in a DataGridView control. Description The goal of this project was to recreate the DLLs provided for the Library Phase 1 project. LibraryEntities contains the various classes and enumerations referenced by the entire project. It contains the AdultMember, JuvenileMember, Member, Item, LibraryException classes as well the ErrorCode enumeration. It also contains the strongly typed ItemsDataSet dataset. The LibraryDataAccess project provides the layer between the Business layer and the database. The UI (user interface) layer makes requests to the LibraryBusiness layer, which in turn makes the request of the Data Access layer. The Data Access layer executes the appropriate SQL Server database Stored Procedures through ADO.NET code. The connection string for the library database is stored at the project level. Mark Jackson mjackson6@kc.rr.com Page 7 of 17
  • 8. The DataAccess and Business layers were not modified except to implement the new functionality. The (partial) AddMember method for Juvenile Members in the Data Access Layer: A T-SQL Stored Procedure for Adding a Juvenile Member: /****** Object: StoredProcedure [dbo].[AddJuvenileMember] Script Date: 06/28/2009 15:11:39 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO create proc [dbo].[AddJuvenileMember] @FirstName varchar(15), -- The new member's first name @MiddleInitial char, -- The new member's middle initial @LastName varchar(15), -- The new member's last name @AdultMemberId smallint, -- The new member's parent's member ID @BirthDate datetime -- The new member's birthdate as -- Procedure to add a new juvenile member. -- Check parameters not allowed to be null. Mark Jackson mjackson6@kc.rr.com Page 8 of 17
  • 9. if @FirstName is null begin -- First name is invalid. raiserror('Invalid value for first name.', 14, 1) return 0 end if @LastName is null begin -- Last name is invalid. raiserror('Invalid value for last name.', 14, 1) return 0 end if @AdultMemberId is null or @AdultMemberId < 1 begin -- Adult member ID is invalid. raiserror('Invalid value for adult member ID.', 14, 2) return 0 end if @BirthDate is null or @BirthDate < dateadd(year, -18, getdate()) begin -- Birthdate is invalid. raiserror('Invalid value for birthdate.', 14, 3) return 0 end if not exists (select * from adult where member_no = @AdultMemberId) begin -- Adult member ID is invalid. raiserror('Adult member does not exist.', 14, 2) return 0 end -- Check if adult membership has expired. if (select expr_date from adult where member_no = @AdultMemberId) < getdate() begin -- Adult member ID is expired. raiserror('Adult member ID is expired.', 14, 4) return 0 end declare @MemberId smallint begin tran begin try -- Insert the new juvenile member into the member table. insert member values(@LastName, @FirstName, @MiddleInitial, null) end try begin catch -- Problem inserting row into member table. raiserror('Add juvenile member failed.', 14, 1) rollback tran return 0 end catch Mark Jackson mjackson6@kc.rr.com Page 9 of 17
  • 10. -- Save the member ID. set @MemberId = scope_identity() begin try -- Insert the new juvenile member into the juvenile table. insert juvenile values(@MemberId, @AdultMemberId, @BirthDate) end try begin catch -- Problem inserting row into adult table. raiserror('Add juvenile member failed.', 14, 1) rollback tran return 0 end catch commit tran return @MemberId GO Mark Jackson mjackson6@kc.rr.com Page 10 of 17
  • 11. SetFocus Library Phase 3 Project Objective Create a web application that supports all the functionality required for Phase 1 and 2 of the Library project. Additional Requirements • When an adult is displayed that has an expired membership, give the librarian the option to renew it. • Use hyperlinks to navigate between pages. • The web application project must use Forms-based authentication and authorization. Only members of the Librarian role must be able to access the web application. Summary This project demonstrates the use of ASP.NET. Some of the techniques used include: • Create and use ASP.NET Master Pages to provide a consistent look across the website. • Use of Membership Roles to restrict access to pages. • Utilizing ViewState and SessionState objects to save data between post backs. • Create a web interface that is intuitive and requires minimal training. • Use various validation controls to validate input before post back. • Data binding to a GridView control and manipulation of the control. Description The Library Business and Data Access layers as well as the Library Entities classes remain unchanged, except to implement the new functionality. Dialog boxes in the Windows form projects were replaced with a single web page, since the layout of the page remained the same. Only the text explaining the user options changed. The QueryString property of the HttpRequest was used to display the new member on the Member Info page after the member was added. It was also used to display messages upon entry to the Member Info page. Mark Jackson mjackson6@kc.rr.com Page 11 of 17
  • 12. The Log In Page: Adding a new Library Item: Mark Jackson mjackson6@kc.rr.com Page 12 of 17
  • 13. The Member Information Page: Mark Jackson mjackson6@kc.rr.com Page 13 of 17
  • 14. The (partial) Page_Load Method for the Member Information Page: Mark Jackson mjackson6@kc.rr.com Page 14 of 17
  • 15. SetFocus Library Phase 4 Project Objective Modify the Library Project to use Web Services. Requirements • Create a Web service that calls into either the business or data layer. • Update the layers in the system to use the service as deemed appropriate. • Make sure the Web service supports the Basic Profile and uses Document/Literal formatting of the Soap messages. • Customize formatting of XML for some of the business types. • Employ WSE 3.0 security using Certificates. Signing, encryption and secure session are required. • Support previous project functionality. Summary This project demonstrates the use of Web Service implementation techniques. Some of the techniques used include: • Customization of XML attributes • Employment of WSE 3.0 security setting • Usage of Certificates for Security, Signing, and Encryption • True N-Tier structures • Use of SoapException objects Description The Business Layer was modified to call the Web Service, which called the Data Access Layer. The Library Entities classes were changed to control XML Serialization. Since Basic Profile Web Services do not natively support overloaded operations, the overloaded methods in the Data Access Layer had to be separated into methods with different names in the Web Service. Since pass by reference behavior is not available natively with Web services, the Data Access Layer’s AddMember methods were changed. Previously the AddMember methods stored the new member’s membership ID number in the Member object whose reference was passed in as a parameter. The methods were changed to return the membership ID number to the Web Service method. The Web Service method returned the value to the Business Layer. The custom LibraryExceptions are thrown in the Data Access Layer and caught in the web methods. The web methods throw SoapExceptions to the Business Layer. The InnerException property of the SoapException is set to a reference of the LibraryException. The GetMember web methods return the base class Member. Because these web methods can return a reference to either the derived AdultMember or JuvenileMember class objects, XmlInclude attributes were used. Mark Jackson mjackson6@kc.rr.com Page 15 of 17
  • 16. The Web Methods of the Web Service: Mark Jackson mjackson6@kc.rr.com Page 16 of 17
  • 17. The GetItem and AddAdultMember WebMethods: Mark Jackson mjackson6@kc.rr.com Page 17 of 17