Showing posts with label Church Management System. Show all posts
Showing posts with label Church Management System. Show all posts

Wednesday, March 17, 2010

Changing a column display name in vb when using dynamicdata

I am working on a completely new version of the Church Management System I started building back when I was working at CHF. Since this is a new project I thought I would use it to learn a new technology. I am building this site using Asp.net Dynamic Data.

One problem I ran into was how to change the column display name since my database uses column names with underscores for spaces and I want an actual space between parts of the column name when using the app. To do this you need to use the Display Name attribute in your meta class. Unfortunately this attribute only works on a full property and not on a simple object like other System.ComponentModel attributes seem to. So in my Meta Data class I created a dummy property with the same name as the actual property I want to change the display name for.

<DisplayName("Address Type")> _
Public Property Address_Type() As String
'These are not actually used, they are just required to make this into
'a true property which is required for the DisplayName Attribute.
Get
Return ""
End Get
Set(ByVal value As String)
End Set
End Property


Here is the entire class for you to look at:

Imports Microsoft.VisualBasic
Imports System.Web.DynamicData
Imports System.ComponentModel
Imports System.ComponentModel.DataAnnotations

<MetadataType(GetType(CHMS_Address_TypeMetaData))> _
Partial Public Class CHMS_Address_Type


End Class

<TableName("Address Types")> _
Public Class CHMS_Address_TypeMetaData

<DisplayName("Address Type")> _
Public Property Address_Type() As String
'These are not actually used, they are just required to make this into
'a true property which is required for the DisplayName Attribute.
Get
Return ""
End Get
Set(ByVal value As String)
End Set
End Property

'Columns I want hidden
<ScaffoldColumn(False)> _
Public Church_ID As Object

<ScaffoldColumn(False)> _
Public Created As Object

<ScaffoldColumn(False)> _
Public Created_By As Object

<ScaffoldColumn(False)> _
Public Last_Edited As Object

<ScaffoldColumn(False)> _
Public Last_Edited_By As Object

<ScaffoldColumn(False)> _
Public IsDeleted As Object

End Class

Tuesday, February 3, 2009

Back to work on the CHMS

I have been (frantically) working on the online Church Management System for Chapel Hill again.
I decided to move this to a DotNetNuke back end so I had to move all the database tables and rebuild the Datasets and Business Logic Layer. We are doing an in-house photo directory at church and I REALLY want to be able to use this for the registration. The opportunity to get buy-in is just too great to pass up.

I just imported the families and individuals tables information from our Shelby database. So I am more or less back to where I was before sans groups.

Tuesday, January 6, 2009

Avoid Shelby v5.08000 etc

Don't update your Shelby systems software from the v5.07000 version to the .08000 version using the current end of the year update. There is a bug in the update and you will have to uninstall Shelby and re-install after getting the older version from support.

That is what I did today, uninstall and re-install the Shelby Systems Church management system after doing a end of the year update last night.

As all my loyal readers will already know (that's a joke as I think there are probably 2 of you) I am not at all a fan of Shelby Church management system. This just makes it worse. I am a programmer and have created programs and updates that had errors in them, we all do no matter how much we test. However, I don't continue to encourage people to install my software KNOWING there is an issue and it may completely fry their install. That is just bad business practice. Granted most people will be doing an update from an 8000 version to a later 08000 version which should work fine, but for those of us like me who were still using an earlier 07000 version at least warn us not to install the 08000 version. Come on.

Saturday, December 13, 2008

Arena

eJOn Edmiston posted a great response to a little rant I put in his comments wondering why Arena was not open sourced. Here is a link to his post http://churchcrosstalk.typepad.com/jonedmiston/2008/12/why-ccv-didnt-release-what-is-now-arena-as-open-source.html

And you should really check out his blog in general http://churchcrosstalk.typepad.com/jonedmiston/


I have re-posted a comment I made in response to that post below, and hi-lighted the part about creating a "competing" open source church management solution.


Thank You so much for the response.

I did not realize when I posted the "rant" on the comment that your church was the one who created Arena.

Given the continuing support you would have felt compelled to provide your decision makes a lot of sense. It is just frusterating to be the IT guy at a church of 500 looking for a new church management system and realize there is no way we could ever afford the best system out there, the one with all the features we could REALLY use and\or want. Honestly even for a "small" church no other system really comes close to matching the features of Arena so good job. And thanks for deciding not to just keep the project in house but to share it with the world.

All that being said if there are people reading this who would like to join me in creating an open source church management system for the rest of us, probably based off a Dot Net Nuke backend, please let me know.

Thursday, September 18, 2008

Image Upload Web Service in VB.NET

Image Upload Web Service in VB.NET


We are going to be doing and in house pictorial directory here at Chapel Hill this fall. I want this directory to be integrated with our website and allow us to view the directory pictures online.

The process as I envision it would include a family taking some time out of their Sunday or Wednesday night to have a picture taken. The photographer would take a family picture as well as individual pictures and transfer these to a computer. It would be ideal if the pictures transfered as they were being taken. We would then have a piece of software that would allow us to look up the info we have for this family, update it if needed, and upload pictures for the family and for each family member.

This software will need to re-size the images down from the hi-quality images taken by the camera to something that is a web appropriate size, upload the image, and update the family / individual profile to indicate which image belongs to them.

In order to do this, I needed a way to upload an image to a website using a VB program. I decided I would use a web service to do this and through some Google research I was able to put together a web service to do this.

Here is the code I used for the web service with a web form to test it out.
When I have finished the vb program I will post that code.

First the web service
-----------------------------------------------
Public Function UploadImage(ByVal imgdata() As Byte, ByVal FileName As String) As Integer
'Find the path on the server of our apps images folder
Dim FilePath As String = Server.MapPath("images")

'strip the path and .jpg etc out of our filename
Dim i As Integer = InStrRev(FileName, "\")
FileName = Mid(FileName, i)
Dim j As Integer = InStr(FileName, ".") - 1
Dim k As Integer = Len(FileName)
FileName = Mid(FileName, 1, j)

'Create a memory stream to hold the image data
Dim MS As New System.IO.MemoryStream(imgdata)

'Convert the memory stream to a bitmap image
Dim BM As New System.Drawing.Bitmap(Image.FromStream(MS))

'Convert the bitmap to a png and save it in our images folder
BM.Save(FilePath & FileName & ".png", Imaging.ImageFormat.Png)

'eventually we will create a database entry for this image and return the image ID
Return 1
End Function

---------------------------------------------------

Now the VB code for the web form
------------------------------------------------
Imports System.IO
Partial Class _Default
Inherits System.Web.UI.Page

Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim ws As New localhost.ImageUpload
Dim fs As Stream = FileUpload1.PostedFile.InputStream
Dim img(fs.Length) As Byte
fs.Read(img, 0, Convert.ToInt32(fs.Length))

ws.UploadImage(img, FileUpload1.PostedFile.FileName)
End Sub
End Class

---------------------------------------------------------

I hope someone finds this useful.

Monday, August 4, 2008

Importing Data From Shelby Systems

Today I did most of the Spark, caught up on email, and did the following work on the new CHMS:

Worked on Creating the Ability to Import People and Families from Shelby, this included creating Data Access and BLL layers for the needed Shelby tables, and new methods in several of the BLL Classes along with some Data Access methods to go with them.

Fortunately, Shelby stored its data in a SQL Server database as well, so I was able to shutdown SQL server on our Server computer, make copies of the database files, re-start SQL server, bring the copied files to my computer, and attach them to my local SQL Server Express edition. Thus I can work with the Shelby database without having to connect to the actuall database on the server, and thus risk data, or kick other people out.

I may eventually work on a way to move updated data back and forth, but for now, getting data out of Shelby and into the new system is enough of a challenge.

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.