Library Application
Upcoming SlideShare
Loading in...5
×

Like this? Share it with your network

Share
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads

Views

Total Views
641
On Slideshare
639
From Embeds
2
Number of Embeds
1

Actions

Shares
Downloads
15
Comments
0
Likes
0

Embeds 2

http://www.linkedin.com 2

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

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