Library Application

663 views

Published on

Published in: Business
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

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

No notes for slide

Library Application

  1. 1. .NET Portfolio<br />Jason Reilly<br />jasonzreilly@gmail.com<br />(863)202-5228<br />
  2. 2. Library Application<br />Goal: Create an n-tier library application for a librarian to use for day to day activities.<br />Specifications: users must have the ability to…<br />Look up member info by their member ID<br />Check in/out books to members (up to 4 books allowed out at a time)<br />Add new adult and juvenile members<br />Add new items to the database and new copies to existing ISBNs.<br />
  3. 3. Member Information<br /><ul><li> Members are searched by their member numbers.
  4. 4. All the member’s information is displayed and the user can choose to check in/out books directly to the user from here.
  5. 5. Validation takes place on the member number, ISBN, and Copy# to ensure valid numbers are entered.</li></li></ul><li>Extra Functionality<br />Automatically converts juveniles to adults on lookup when they reach 18 and alerts the librarian that the conversion took place.<br />Items currently past due are highlighted in yellow when the member’s information is displayed.<br />
  6. 6. Sample Code: Windows Layer<br />/// &lt;summary&gt;<br />/// constructor takes in an object of type AdultMember and fills<br />/// the text boxes accordingly<br />/// &lt;/summary&gt;<br />public MemberInfo(AdultMembermyMember)<br />{<br />InitializeComponent();<br />this.myMember = myMember;<br />this.txtMemberId.Tag = new PatternAndMessage(@&quot;d{1,5}$&quot;, &quot;Please input a proper numeric value up to 5 digits long&quot;);<br />txtMemberId.Text = myMember.MemberID.ToString();<br />SetInfoToForm(myMember);<br />}<br />
  7. 7. Add Adult/Juvenile<br /><ul><li> Each box in these windows is validated to ensure data integrity and prevent crashes
  8. 8. Once each box is validated correctly, the member will be added and the new member is opened automatically in a member information window to begin check in/out.</li></li></ul><li>Sample Code: Data Access Layer<br />public void AddMember(JR.LibDataEntities.AdultMember am)<br />{ <br /> using (SqlConnection con = new SqlConnection(Properties.Settings.Default.LibraryConnectionString))<br />{<br />SqlCommandcmd = con.CreateCommand();<br />cmd.CommandType = CommandType.StoredProcedure;<br />cmd.CommandText = &quot;usp_AddAdult&quot;;<br />cmd.Parameters.AddWithValue(&quot;@lastname&quot;, am.LastName);<br />cmd.Parameters.AddWithValue(&quot;@firstname&quot;, am.FirstName);<br />cmd.Parameters.AddWithValue(&quot;@middleinitial&quot;, am.MiddleInitial);<br />cmd.Parameters.AddWithValue(&quot;@street&quot;, am.Street);<br />cmd.Parameters.AddWithValue(&quot;@city&quot;, am.City);<br />cmd.Parameters.AddWithValue(&quot;@state&quot;, am.State);<br />cmd.Parameters.AddWithValue(&quot;@zip&quot;, am.ZipCode);<br />cmd.Parameters.AddWithValue(&quot;@phone_no&quot;, am.PhoneNumber);<br />SqlParameterprm = new SqlParameter(&quot;@member_no&quot;, SqlDbType.SmallInt);<br />prm.Direction = ParameterDirection.Output;<br />cmd.Parameters.Add(prm);<br /> try<br /> {<br />con.Open();<br />cmd.ExecuteNonQuery();<br />am.MemberID = (short)cmd.Parameters[&quot;@member_no&quot;].Value;<br /> }<br /> catch (SqlExceptionsqlEx)<br /> {<br /> throw new LibraryException(sqlEx.Message);<br /> }<br /> catch (Exception)<br /> {<br /> throw new LibraryException(LibErrorCode.AddAdultFailed);<br /> }<br />}<br />}<br />public void AddMember(JuvenileMemberjm)<br />{<br /> using (SqlConnection con = new SqlConnection(Properties.Settings.Default.LibraryConnectionString))<br /> {<br />SqlCommandcmd = con.CreateCommand();<br />cmd.CommandType = CommandType.StoredProcedure;<br />cmd.CommandText = &quot;usp_AddJuvenile&quot;;<br />cmd.Parameters.AddWithValue(&quot;@lastname&quot;, jm.LastName);<br />cmd.Parameters.AddWithValue(&quot;@firstname&quot;, jm.FirstName);<br />cmd.Parameters.AddWithValue(&quot;@middleinitial&quot;, jm.MiddleInitial);<br />cmd.Parameters.AddWithValue(&quot;@adult_member_no&quot;, jm.AdultMemberID);<br />cmd.Parameters.AddWithValue(&quot;@birth_date&quot;, jm.BirthDate);<br />SqlParameterprm = new SqlParameter(&quot;@member_no&quot;, SqlDbType.SmallInt);<br />prm.Direction = ParameterDirection.Output;<br />cmd.Parameters.Add(prm);<br /> try<br /> {<br />con.Open();<br />cmd.ExecuteNonQuery();<br />jm.MemberID = (short)cmd.Parameters[&quot;@member_no&quot;].Value;<br /> }<br /> catch (SqlExceptionsqlEx)<br /> {<br /> throw new LibraryException(sqlEx.Message);<br /> }<br /> catch (Exception)<br /> {<br /> throw new LibraryException(LibErrorCode.AddJuvenileFailed);<br /> }<br />}<br />}<br />
  9. 9. Library Web Site<br />Goal: Create a web site version Library Application created.<br />Added Functionality:<br />Librarian functions must be limited to users under an administrator role.<br />Librarians must be able to add new items and item copies to the database.<br />
  10. 10. Login<br />Only users under the admin role will be granted access to the Librarian Functions.<br />
  11. 11. Member Services<br /><ul><li> Members are searched by their member numbers.
  12. 12. All the member’s information is displayed and the user can choose to check in/out books directly to the user from here.
  13. 13. Validation takes place on the member number, ISBN, and Copy# to ensure valid numbers are entered.
  14. 14. To check in a book, all the user has to do is select the book in the data grid view and click the check in button.</li></li></ul><li>Add Members<br /><ul><li> Each box on this page is validated to ensure data integrity and prevent crashes
  15. 15. Once each box is validated correctly, the member will be added and the new ID is supplied.</li></li></ul><li>Add Item<br /><ul><li> When adding an item with an ISBN that does not exist, the user is given the option to create a new item with that ISBN.
  16. 16. When adding an item to an existing ISBN, the user is given the option to create an additional copy to that ISBN.</li>

×