C#Portfolio

575 views
521 views

Published on

Jeriel Mikell C# Portfolio

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
575
On SlideShare
0
From Embeds
0
Number of Embeds
19
Actions
Shares
0
Downloads
3
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

C#Portfolio

  1. 1. SetFocus.Net Project Portfolio<br />Jeriel Mikell<br />773-995-5418<br />mailto:jeriel.mikell@yahoo.com<br />
  2. 2. Table of Content<br />Introduction / Summary 3<br />Projects: <br />Project 1 FrameWork Business Project 5<br />FrameWork Code Snippets 6,7<br />Phase 2 Library Project 10<br />Windows Front End <br />Validation 11 - 15 <br />Phase 3 Library Project 16<br />Create DataAccess Tiers<br />Phase 4 Library Project 28 <br />Integrate into a Web Project <br />Phase 5 Library Project 44<br />Integrate into a Web Service<br />
  3. 3. .NET Projects Overviewpage 2<br />Summary <br />Project 1 .NET Framework Foundation <br />Build parts of the business tier for a retail company, consisting of two assemblies; Foundation and AppTypes. The Foundation class library contains various interfaces and base classes. The AppTypes class library contains various entity, collection, and exception classes used by the various business processes. <br />Project 2 Library Phase 1 <br />Given an ADO.NET data access library to a SQL database that contains Library books, adult and juvenile members, develop an intuitive Windows Forms user interface that requires minimal training. Development of business tier software that isolates the ADO.NET code from the user interface is also required to add members, check books in and out of the database. Additional requirements include validation of all input parameters including regular expression validators, exception handling minimizing resource utilization. <br />Project 3 Library Phase 2 <br />Using the UI developed in Library Phase 1 project, the requirement here is to convert the ADO.NET data access tier to use LinqToSQL to develop object models and abstract away data provider code and modify the business tier software as required to interface with this new data access tier. Develop code that is easily maintainable and provides adequate error handling. <br />
  4. 4. .NET Projects Overviewcont. <br />.NET Framework Projects Overview <br />Project 4 Library Phase 3 <br />Convert the user interface of the Library Phase 2 project to a Web application preserving all of the Windows Forms functionality. Specific requirements include the use of AJAX controls for book check in and implementing a secure login for the librarian to access to the library functions using forms based authorization and authentication. Additional functionality includes the ability to add books or another copy of an existing book to the database, automatically convert juvenile members to adult members when they turn 18, and allow the option to renew a membership that has expired. <br />Project 5 Library Phase 4 <br />Allow Interoperability of the Library project with other systems by implementing Windows <br />Communication Foundation (WCF) Web Services called from the web based user interface that provides a secure communication mechanism to the library business layer. Authorization and authentication of the transport channel shall be provided using ASP.NET membership and role permissions. <br />Project 6 Test Management Application <br />
  5. 5. FrameWork ProjectProject 1<br />The FrameWork project features parts of the business tier for a retail company, consisting of two assemblies; Foundation and AppTypes. The Foundation class library contains various interfaces and base classes. The AppTypes class library contains various entity, collection, and exception classes used by the various business processes. <br />
  6. 6. FrameWork Interface<br />
  7. 7. Partial FrameWork Code SnippetsDefine the Supplier classApplication Type<br />/// <summary><br />/ Supplier Class<br /> [DeveloperInfoAttribute( "JerielMikell", "Programmer", "11072009")]<br /> [CustomDescriptionAttribute("Supplier Class")]<br /> [Serializable]<br /> public sealed class Supplier : Contact<br /> {<br /> //Fields<br />/// <summary><br />/// HomePage<br />/// </summary><br /> public string _homePage;<br />/// <summary><br />/// SupplierType type<br />/// <br />/// </summary><br /> public SupplierTypes _type;<br /> //Properties<br /> /// <summary><br /> /// public property HomePage<br /> /// </summary><br /> public string HomePage<br /> {<br /> get<br /> { return _homePage; }<br /> set<br /> {<br /> if (value.Length < 5 || value.Length > 50)<br /> throw new InvalidOperationException("HomePage must be between 5 and 50 characters" + _homePage);<br /> else<br /> _homePage = value;<br /> }<br />
  8. 8. Supplier Typecont.<br /> /// <summary><br /> /// Supplier Types can not be null /automatic property for Type<br /> /// </summary><br /> public SupplierTypes Type <br /> {<br /> get { return _type; }<br /> set<br /> {<br /> if (_type == 0)<br /> throw new InvalidOperationException(_type +"Supplier Type must not be Empty" );<br /> else<br /> _type = value;<br /> }<br /> } <br /> /// <summary><br /> /// defalultconstuctor<br /> /// </summary><br /> public Supplier()<br /> { }<br /> //overload constructor<br />
  9. 9. Supplier Typecont<br />/// <summary><br />/// Overloaded constructor<br />/// </summary><br />/// <param name="id"></param><br />/// <param name="companyname"></param><br />/// <param name="contactname"></param><br />/// <param name="contacttitle"></param><br />/// <param name="address"></param><br />/// <param name="city"></param><br />/// <param name="region"></param><br />/// <param name="postalcode"></param><br />/// <param name="country"></param><br />/// <param name="phone"></param><br />/// <param name="fax"></param><br />/// <param name="_homepage"></param><br />/// <param name="_type"></param><br /> public Supplier(int id, string companyname, string contactname, string contacttitle, string address, string city, string region, <br /> string postalcode, string country, string phone, string fax, string _homepage, SupplierTypes _type)<br /> : base(id, companyname, contactname,contacttitle,address,city,region,postalcode,country,phone,fax)<br /> { <br />this.HomePage = _homepage;<br />this.Type = _type;<br /> this.id = id;<br />this.companyName = companyname;<br />this.contactName = contactname;<br />this.contactTitle = contacttitle;<br />this.Address = address;<br />this.City = city;<br />this.Region = region;<br />this.PostalCode = postalcode;<br />this.Country = country;<br />this.Phone = phone;<br />this.Fax = fax;<br /> }<br />
  10. 10. Supplier structure<br /> //DataAccess constructor<br /> // [DeveloperInfoAttribute("JerielMikell" ,"Programmer","11072009")]<br /> [CustomDescription("DataAccessctor")]<br /> public Supplier(DataAccess.SupplierStructmyStruct)<br /> { <br /> this.ID = myStruct.ID;<br />this.CompanyName = myStruct.CompanyName;<br />this.ContactName = myStruct.ContactName;<br />this.ContactTitle = myStruct.ContactTitle;<br />this.Address = myStruct.Address;<br />this.City = myStruct.City;<br />this.Region = myStruct.Region;<br />this.PostalCode = myStruct.PostalCode;<br />this.Country = myStruct.Country;<br />this.Phone = myStruct.Phone;<br />this.Fax = myStruct.Fax;<br /> // finish assigning all properties<br /> }<br />
  11. 11. Library Project Phase 2<br />LWindows Front-End Application <br />Requirements <br />Design and develop a front end application that satisfies the four basic functionalities: Add Adult, Add Juvenile, Check In a book, Check Out a book. <br />Develop code that is easily maintainable. <br />Provide validation for all required fields (see details below). <br />Provide adequate error handling. <br />Produce a user interface that is intuitive, requiring minimal training for users while minimizing resource utilization. <br />Provisions <br />Database scripts are provided in order to create the Library database (see APPENDIX A). <br />An interface that specifies the methods supported by the Data Access tier used for all database access and a class that implements the interface are provided. Classes that represent various “business entities” (e.g., an AdultMember class) are also provided. Detailed information appears in Appendix B. <br />A reference implementation that illustrates one possible solution for this project is provided. The reference implementation is not intended as a model to be emulated in your solution; rather, it serves only to illustrate how you might implement your solution, rather than how you must implement your solution. If you wish to use the reference implementation as a basis for how your implementation will appear and function, you are free to do so, but you are not obligated to replicate the appearance of the reference implementation. <br />A database has been created to support the principal functions of a lending library’s day-to-day operations: adding new members (adult and juvenile) and checking books in and out. An assembly has been created that contains classes and interfaces that provide access to the database for these functions. What is needed is a Windows Forms-based front-end application that will provide a librarian with a visual interface through which he or she may perform the desired functions<br />
  12. 12. Shared members within the Library Project<br />
  13. 13. Front end validation<br />If a value is entered into the middle initial field, that field must be validated to ensure that the value entered is a single alphabetic character. <br />If a value is entered into the phone number field, that field must be validated to ensure that the value conforms to the format (XXX)XXX-XXXX, where X is a digit from 0 through 9. Note there is no space after the right parenthesis; the field in the database for the phone number is thirteen characters long, so including a space at this point would cause the phone number to be truncated. <br />The adult member ID field must be validated to ensure that it contains only a numeric value in the range 1 through 32767 inclusive. <br />The birthday field must be validated to ensure that it contains a value in the format MM/DD/YYYY and that the value parses to a date that is no more than eighteen years prior to the current date. <br />When a member ID is entered to perform a member lookup, that field must be validated according to the same rule specified for the adult member ID field above. <br />For the ISBN and copy number fields used in the check-in and check-out operations, these fields must be validated to ensure that only numeric values are entered. For the copy number field, the value must be in the range 1 through 32767 inclusive. <br />Suggested Project Techniques :<br />Use menus instead of buttons to free screen space, when appropriate. <br />Use combo boxes (drop-down lists) and list boxes instead of free-form textboxes for data entry whenever possible. <br />Avoid overuse of message boxes and other modal communications to the user. Use other display techniques such as a status bar or a label. <br />Use standard naming conventions to provide code readability. <br />Make use of collections to produce concise code. <br />While calls into the data access class’s methods by the presentation tier (i.e., by the code in your Form’s event handlers) are permitted, you might want to consider creating a middle tier for mediating between your presentation tier and the data access tier. Using a middle tier can simplify the code in your presentation tier considerably. <br />
  14. 14. Validation cont.<br />Enrolling Members <br />To become a library member, an individual must provide his or her mailing address and, optionally, his or her phone number. A librarian then issues the individual a numbered, machine-readable card. This card is good for one year from the date of issue. <br />Juveniles are considered to be individuals under the age of eighteen. A juvenile can be a member of the library, but must have an adult member sign for them when they join. The juvenile’s address and phone number information is that of the sponsoring adult member, and the juvenile’s card is valid only until the sponsoring adult member's card expires. The only information that the library keeps on a juvenile member is his or her name, sponsoring adult member card number, and his or her date of birth. <br />Checking Out Books <br />Books are checked out for 14 days. Members are allowed to have at most four books checked out at a time. Members bring books to the front desk after they locate the ones that they want to check out. A librarian then enters the card number from the member's card. A screen displays information about the member's account, such as name, address, phone number, and the card's expiration date. Ideally, cards that have expired will be highlighted. The screen also displays information about a member's outstanding loans, including title, checkout date, and due date. <br />If a member's account is in order (i.e., the card is not expired and fewer than four books are on loan to the member currently), a librarian checks out the books. Librarians check out books by entering the ISBN and copy number of the item, both of which appear in a label on the book’s spine. The ISBN, copy number, title, and author information then appear on the computer screen so that the librarian may verify that the database entry corresponds to the item being checked out. The librarian then can elect to check the book out or to cancel the check-out operation. <br />Occasionally, books are accidentally re-shelved before librarians check them in. If a librarian tries to check out a book that the database lists as already checked out, the librarian should be alerted and be given the opportunity to check the book in before proceeding with the check-out operation. <br />Checking In Books <br />When a book is returned to the library, a librarian checks it in by entering the ISBN and copy number that appears on the book’s spine. The ISBN, copy number, title, and author information then appear on the computer screen, as well as the card number and name of the member to whom the book is checked out, and the book's due date. The librarian can then elect to check the book in or to cancel the check-in operation. <br />
  15. 15. Validation cont.<br />Data Validation <br />To enroll an adult member, the required fields are: <br />First name <br />Last name <br />Street <br />City <br />State <br />Zipcode<br />Middle initial and phone number are optional fields. <br />To enroll a juvenile member, the required fields are: <br />First name <br />Last name <br />Adult member ID <br />Birthday <br />Middle initial is an optional field. <br />First name and last name fields must be validated to ensure that the values contained in these fields are alphabetic only and that the first character of each of these fields is uppercase. <br />The Zipcode field must be validated to ensure that only a five-digit (XXXXX) or a nine-digit (XXXXX-XXXX) value is entered. <br />
  16. 16. Validationcont.<br />Value entered is a single alphabetic character. <br />If a value is entered into the phone number field, that field must be validated to ensure that the value conforms to the format (XXX)XXX-XXXX, where X is a digit from 0 through 9. Note there is no space after the right parenthesis; the field in the database for the phone number is thirteen characters long, so including a space at this point would cause the phone number to be truncated. <br />The adult member ID field must be validated to ensure that it contains only a numeric value in the range 1 through 32767 inclusive. <br />The birthday field must be validated to ensure that it contains a value in the format MM/DD/YYYY and that the value parses to a date that is no more than eighteen years prior to the current date. <br />When a member ID is entered to perform a member lookup, that field must be validated according to the same rule specified for the adult member ID field above. <br />
  17. 17. Validation cont.<br />For the ISBN and copy number fields used in the check-in and check-out operations, these fields must be validated to ensure that only numeric values are entered. For the copy number field, the value must be in the range 1 through 32767 inclusive. <br />Suggested Project Techniques :<br />Use menus instead of buttons to free screen space, when appropriate. <br />Use combo boxes (drop-down lists) and list boxes instead of free-form textboxes for data entry whenever possible. <br />Avoid overuse of message boxes and other modal communications to the user. Use other display techniques such as a status bar or a label. <br />Use standard naming conventions to provide code readability. <br />Make use of collections to produce concise code. <br />While calls into the data access class’s methods by the presentation tier (i.e., by the code in your Form’s event handlers) are permitted, you might want to consider creating a middle tier for mediating between your presentation tier and the data access tier. Using a middle tier can simplify the code in your presentation tier considerably. <br />
  18. 18. Library Project Phase3<br />Project Phase 3 consist of building the DataAccess and Business Tiers. Preserving the use of the Stored Procedures, validation and ease of access among other features created in the previous project, like members card has expired.<br />
  19. 19. Add Adult stored procedure<br />/* Methods that can be used in the try catch blocks<br />Function Description <br />ERROR_NUMBER() Returns the number of the error <br />ERROR_SEVERITY() Returns the severity <br />ERROR_STATE() Returns the error state number <br />ERROR_PROCEDURE() Returns the name of the stored procedure or trigger where the error occurred <br />ERROR_LINE() Returns the line number inside the routine that caused the error <br />ERROR_MESSAGE() Returns the complete text of the error message. The text includes the values supplied for any substitutable parameters, such as lengths, object names, or times <br />*/<br />USE library<br />GO<br /> /*Drop the Procedure before creating it if it exists.*/<br />IF OBJECT_ID ('usp_AddAdultMember') IS NOT NULL<br /> DROP PROCEDURE usp_AddAdultMember;<br />GO<br /> /*Create the Procedure*/<br />CREATE PROCEDURE usp_AddAdultMember<br /> @nlastnamevarchar(15),@nfirstnamevarchar(15),@nmiddleinitial char(1),<br /> @nstreetvarchar(15),@ncityvarchar(15),@nstate char(2),<br /> @nzip char(10),@nphoneno char(13), @nexpirationDateDateTime,<br /> @adultmemberidsmallint OUTPUT<br />AS<br />BEGIN<br /> BEGIN TRY<br />--IF EXISTS SELECT (@noutput_Adultmemberid )<br /> --IF EXISTS (SELECT * FROM member WHERE member_no = @adultmemberid)<br /> -- RETURN -1<br />
  20. 20. Add Adult stored procedure cont<br /> /*Validation Testing*/<br /> /*Test each field for null or out of Range values*/<br /> IF (@nfirstname IS NULL)<br /> RETURN -1; <br /> IF (@nlastname IS NULL)<br /> RETURN -1;<br /> IF (@nstreet IS NULL)<br /> RETURN -1;<br /> /*Validation Testing*/<br /> /*Test each field for null vaues */<br /> IF (@ncity IS NULL)<br /> RETURN -2;<br /> /*Validation Testing*/<br /> /*Test each field for null values*/<br /> IF (@nstate IS NULL)<br /> RETURN -3;<br /> /*Validation Testing*/<br /> /*Test each field for null vaues*/<br /> IF (@nzip IS NULL)<br /> RETURN -4;<br /> /*Validation Testing*/<br /> /*Test each field for null or out of Range values*/<br /> IF (@nexpirationDate IS NULL)<br /> RETURN -5<br />
  21. 21. Add Adult stored procedurecont.<br />--Need to insert values into the Member table as well as the Adult table<br />--memeberno in the member table is IDentity column<br /> BEGIN TRANSACTION<br /> INSERT INTO member(lastname,firstname,middleinitial)<br /> VALUES (@nlastname,@nfirstname,@nmiddleinitial);<br /> IF (@@ERROR <> 0)<br /> BEGIN<br /> ROLLBACK<br /> RETURN -10;<br /> END<br /> Set @adultmemberid = scope_identity();<br /> INSERT INTO adult(member_no,street,city,[state],zip,phone_no,expr_date)<br /> VALUES (@adultmemberid,@nstreet,@ncity,@nstate,@nzip,@nphoneno,@nexpirationDate)<br /> IF (@@ERROR <> 0)<br /> BEGIN<br /> ROLLBACK ; <br /> RETURN -11;<br /> END<br /> COMMIT TRANSACTION;<br /> RETURN @adultmemberid; <br /> END TRY <br /> BEGIN CATCH<br /> IF @@TRANCOUNT > 0<br /> ROLLBACK <br /> DECLARE @ErrMsgnvarchar(4000), @ErrSeverityint<br /> SELECT @ErrMsg = ERROR_MESSAGE(),<br /> @ErrSeverity = ERROR_SEVERITY()<br /> RAISERROR(@ErrMsg, @ErrSeverity, 1)<br /> END CATCH;<br />END<br />GO<br />--END TRANSACTION<br />--END TRAN AddAdultMemberTrans<br />--<br />
  22. 22. Adult Member being added<br />
  23. 23. Add Adult membership interface<br />
  24. 24. Addition completed<br />
  25. 25. Juvenile member being added with adult member on file<br />
  26. 26. Book check in<br />
  27. 27. Book being checked in<br />
  28. 28. Display shows members book limit reachedMaximum of four books<br />
  29. 29. Successful check out for member with less than four books checked out.<br />
  30. 30. Project Phase 4Web Application<br />Web Application<br />
  31. 31. Summary<br />The Web Application utilizes Http binding and MasterPage and ContentPages as the structure for the application. The Interface has changed but preserves the functionality as the previous projects. The application uses custom user controls hyperlinks to navigate to each page, continues to provide validation and error handling. The project also features AJAX processing. Extra processing was added in the web application to automatically update a juvenile who's eighteenth birthday has just past or is current and that the member is still active or the members card has not expired. Also extra processing has been added to highlight overdue books. Books that have exceeded the return date. Other features included; Security for Librarians and authorized users of the system, search feature to find members by member number.<br />
  32. 32. Login screen<br />
  33. 33. Main Menu<br />
  34. 34. Add Adult dialog <br />
  35. 35. Adult member being added<br />
  36. 36. Adult member added<br />
  37. 37. Shows book overdue<br />
  38. 38. AJAX Update Panel at work<br />
  39. 39. Book added to library<br />
  40. 40. Limit reached and button disabled<br />
  41. 41. Highlight “ alert” to Books overdue<br />
  42. 42. Highlight “alert” -Members card has expiredcheckout button disabledOption to renew card!<br />
  43. 43. Updating Member’s card with AJAX processing<br />
  44. 44. Members card updated / Check out button enabled<br />
  45. 45. Juvenile search<br />
  46. 46. Juvenile and sponsoring adult<br />
  47. 47. Project Phase 5WCFWeb Service<br />WCF web service project uses the same Web application Windows Client interface and processing as project 4 , but adds attributes for the web service contracts and data contract objects and methods in the DataAccess Layer of the project. Uses fault exception and LibraryExceptions. The service was first hosted in a console application and later migrated to a windows application to be hosted in Internet Information Services(IIS). <br />
  48. 48. Web Service<br />
  49. 49. ConsoleHost/WebService<br />
  50. 50. WCF Test Client returns items for member number<br />
  51. 51. End Portfolio<br />

×