Tuesday, July 29, 2008

AJAX

Today I finished up the bulletin for next Sunday and worked on the BLL and started the presentation layer for the Open Source Church Management System named Hill CHMS I am working on building for Chapel Hill.

I need to AJAX enable the site before I can go much further. I want admins to be able to start typing in a last name and have a list of choices appear below, with the list getting smaller as more letters are typed. I know this is possible with AJAX, I just don't know how hard it would be to actually do. If I can't do this right away I will settle for a list that populates when a button is hit.

I need to think of this in terms of versions, with version one just working and later versions having more features.

Monday, July 28, 2008

Today's Update

I know no one reads this, or really cares about the Church Management System I am working on at the moment. I suppose it is just my geekishness that makes me want to post all this here.

Today after getting all my other Church work done I worked on the CHMS and did the following"

Created tblContactMethods to hold of all things contact methods.
Created tblMembershipStatuses to hold membership statuses.
Created table adapters for these two tables.

I had forgotten to add these to the original database map, they connect the the people table

Changed tblPeople and re-created its table adapter.

I need to talk to George Retter, who is doing our Jump In - get people involved ministry here at Chapel Hill before I go any further.

Friday, July 25, 2008

More table images

Here are the images from some more tables for the CHMS





Business Logic Layer

Free Open Source Church Management System Business Logic Layer

Much of the basic logic for my BLL's comes from the following tutorials. ASP.NET Data Access Tutorials

Here is the updated code for the Families BLL

Imports Microsoft.VisualBasic
Imports FamiliesTableAdapters

_
Public Class FamiliesBLL

Private _theAdapter As tblFamiliesTableAdapter = Nothing

Protected ReadOnly Property Adapter() As tblFamiliesTableAdapter
Get
If _theAdapter Is Nothing Then
_theAdapter = New tblFamiliesTableAdapter()
End If

Return _theAdapter
End Get
End Property

(System.ComponentModel.DataObjectMethodType.Select, True)> _
Public Function GetFamilies() As Families.tblFamiliesDataTable
Return Adapter.GetFamilies
End Function

(System.ComponentModel.DataObjectMethodType.Select, False)> _
Public Function GetFamilyByID(ByVal FamilyID As Integer) _
As Families.tblFamiliesDataTable
Return Adapter.GetFamilyByID(FamilyID)
End Function

(System.ComponentModel.DataObjectMethodType.Insert, True)> _
Public Function NewFamily( _
ByVal FamilyName As String, ByVal FamilyDescription As String, _
ByVal SalutationID As Integer, ByVal Salutation As String, _
ByVal Address As String, ByVal City As String, ByVal StateID As Integer, ByVal StateName As String, ByVal ZIP As String, _
ByVal HomePhone As String, ByVal FamilyCellPhone As String, ByVal FamilyEmail As String, ByVal ShelbyFamilyID As Integer, _
ByVal ImageID As Integer _
) As Boolean

Dim SiteID As Integer = 1


Dim TBL As New Families.tblFamiliesDataTable
Dim ARow As Families.tblFamiliesRow = TBL.NewtblFamiliesRow()

ARow.FamilyName = FamilyName
ARow.FamilyDescription = FamilyDescription

ARow.SalutationID = SalutationID
ARow.Salutation = Salutation

ARow.Address = Address
ARow.City = City
ARow.StateID = StateID
ARow.StateName = StateName
ARow.ZIP = ZIP

ARow.HomePhone = HomePhone
ARow.FamilyCellPhone = FamilyCellPhone
ARow.FamilyEmail = FamilyEmail

ARow.ShelbyFamilyID = ShelbyFamilyID

ARow.SiteID = SiteID

ARow.Created = Now()
ARow.CreatedBy = HttpContext.Current.User.Identity.Name
ARow.LastEdited = Now()
ARow.EditedBy = HttpContext.Current.User.Identity.Name

TBL.AddtblFamiliesRow(ARow)
Dim rowsAffected As Integer = Adapter.Update(TBL)

Return rowsAffected = 1
End Function

(System.ComponentModel.DataObjectMethodType.Update, True)> _
Public Function UpdateFamily(ByVal FamilyID As Integer, _
ByVal FamilyName As String, ByVal FamilyDescription As String, _
ByVal SalutationID As Integer, ByVal Salutation As String, _
ByVal Address As String, ByVal City As String, ByVal StateID As Integer, ByVal StateName As String, ByVal ZIP As String, _
ByVal HomePhone As String, ByVal FamilyCellPhone As String, ByVal FamilyEmail As String, _
ByVal ImageID As Integer _
) As Boolean

Dim TBL As Families.tblFamiliesDataTable = _
Adapter.GetFamilyByID(FamilyID)

If TBL.Count = 0 Then
Return False
End If

Dim ARow As Families.tblFamiliesRow = TBL(0)

ARow.FamilyName = FamilyName
ARow.FamilyDescription = FamilyDescription

ARow.SalutationID = SalutationID
ARow.Salutation = Salutation

ARow.Address = Address
ARow.City = City
ARow.StateID = StateID
ARow.StateName = StateName
ARow.ZIP = ZIP

ARow.HomePhone = HomePhone
ARow.FamilyCellPhone = FamilyCellPhone
ARow.FamilyEmail = FamilyEmail

ARow.LastEdited = Now()
ARow.EditedBy = HttpContext.Current.User.Identity.Name

Dim rowsAffected As Integer = Adapter.Update(ARow)

Return rowsAffected = 1
End Function

(System.ComponentModel.DataObjectMethodType.Delete, True)> _
Public Function DeleteFamily(ByVal FamilyID As Integer) As Boolean

Dim TBL As Families.tblFamiliesDataTable = _
Adapter.GetFamilyByID(FamilyID)

If TBL.Count = 0 Then
Return False
End If

Dim ARow As Families.tblFamiliesRow = TBL(0)

ARow.LastEdited = Now()
ARow.EditedBy = HttpContext.Current.User.Identity.Name

ARow.Deleted = True
ARow.DateDeleted = Now()
ARow.DeletedBy = HttpContext.Current.User.Identity.Name

Dim rowsAffected As Integer = Adapter.Update(ARow)

Return rowsAffected = 1
End Function

(System.ComponentModel.DataObjectMethodType.Delete, False)> _
Public Function DeleteCompletly(ByVal FamilyID As Integer) As Boolean
Dim rowsAffected As Integer = Adapter.Delete(FamilyID)

Return rowsAffected = 1
End Function

End Class

Wednesday, July 23, 2008

Today's Update for the Church Management System

Today's Update for the Church Management System

Today I created table adapters for most of the tables in the church management system, and also made images of the tables for documentation.


Here are some of the images of tables in the system.







Sunday, July 20, 2008

Today's Updates to the Church Management System

I think I will call the CHMS "Hill Church Management System", at least for now.

I need to eventually re-do some of my existing code base to make it faster, and eliminate any copyrighted code so I can distribute this system.

Today I:
Created tblGroup positions to hold info on the various positions people can hold in A group, such as leader, facilitator, member, former member.

Created tblGroupTypes to hold info about the various possible group types. There are a lot of these Whole Church, Commitee, Small Group, Wednesday Night at the Hill, Children's Sunday School, Adult Sunday School, etc...

Created tblLocations to hold locations used by the Calendar and to denote where groups meet.

Created tblLocationMapping so that I can have locations that map back to multiple other locations for purposes of seeing if a room is busy. For instance, the basement at Chapel Hill might be listed as a location "Lower Level" but would actually comprise many smaller locations that would be busy whenever the entire basement is busy.

Created tblEvents to hold information about events for the calendar.

Worked on this from 4:30 - 5:15

Friday, July 18, 2008

Requirements for Open Source Church Management System

Requirements for Open Source Church Management System

The new CHMS must:
• Allow staff to view and edit information for individuals, families, groups, small groups, ministries, calendars, individual spiritual gifts and abilities.
• Allow ministry and small group leaders to login and communicate with people in their small group; create events for their ministry, etc.
• Allow people to sign up for a login, and edit / enter their own information, plus allow them to indicate interests in different ministries.
• Have a process for tracking and managing tasks/processes (i.e. a new visitor process: who follows up with them, when etc...)

Change Log for Open Source Church Management System

Change Log for Open Source Church Management

7/15/08
Created tblFamilies Table, Table Adapter, and Business Logic Layer

It took 40 minutes to create all three of these. There are around 20 tables in the current design leading to 13.333 etc hours of work if every table takes 40 minutes. This still leaves the pages to actually put data into these tables.

7/17/08
Created tblPeople and PeopleInFamily tables, also edited tblFamilies to add some fields, including ShelbyFamilyID to be used to import date from Shelby.

Deleted PeopleInFamily table, Added FamilyID and FamilyPosition fields to tblPeople and removed a few fields duplicated from tblFamily. I am designing as I build this.

Created tblStates, found a list of US states with postal abbreviations and imported this data into tblStates.

Created tblFamilyPositions, I have had to re-consider what data goes in this table. I don’t really like what using Head of Household says about hierarchy in families, but only having husband and wife does not work for single people who live alone.
Created tblImages, to reference images used by the program.

Created tblGroups to hold information about all kinds of groups.

Open Source Church Management System

With the current financial situation at Chapel Hill I don't think they are going to be willing to shell out $3000 for CCB any time soon. However, I do think the pastor see the value in going to a web based Church Management System that is one centralized place where we store all our information, that can be accessed from anywhere.

So, given the opportunity and the need, I have started working on building a Church Management System "in house" using asp.net and Visual Basic. The plan is to post this to the Microsoft Open Source system so other churches can use it.

I am going to be posting my logic, progress, change logs, etc... here just because.

Enjoy!

Sunday, July 13, 2008

The Human Brain is Amazing

I don't think Chapel Hill is going to shell out for CCB so I am looking into building our own web based Church Management System from scratch.

Yesterday's planning issue had to do with the calendar part of this system. I want small group leaders to be able to add events for their group to the calendar, which can then be approved later by an Admin if they require a room here at Church.

One of the features of the scheduler should be a warning if someone is going to overbook a room. So I was trying to figure out the best way to tell if two events are taking place at the same time. Here is where the human brain amazes me. We can just tell intuitively if two events overlap without really thinking about how we know.

I ended up deciding to test to see if two events do NOT overlap and deciding that they must overlap if they do not NOT overlap. This may seem complicated but there are four different ways events can overlap and only two ways they can NOT overlap.