Closed spiet002 closed 9 years ago
add usp param and give back
Travel notes can be inserted through 1 of 3 stored procedures
DECLARE @return_value int, @FamilyID int
EXEC @return_value = [dbo].[usp_InsertNewFamilyWebScreen] @FamilyLastName = N'Clubber', @Address_Line1 = N'12 Silverthorne Dr', @ApartmentNum = NULL, @CityName = N'Leadville', @StateAbbr = N'CO', @ZipCode = N'80461', @Year_Built = '1999', @Owner_id = NULL, @is_Owner_Occupied = 1, @is_Residential = 1, @has_Peeling_Chipping_Paint = 1, @is_Rental = 0, @Language = 1, @NumSmokers = 4, @Pets = 2, @Frequently_Wash_Pets = 0, @Petsinandout = 1, @FamilyNotes = N'Family notes', @PropertyNotes = N'property notes', @Travel_Notes = N'traveled to costa rica', @Travel_Start_Date = N'20050209', @Travel_End_Date = N'20050215', @DEBUG = 1, @FamilyID = @FamilyID OUTPUT -- @FamilyID is the id of the newly inserted family SELECT @FamilyID as N'@FamilyID' -- @return_value is the exit code SELECT 'Return Value' = @return_value
GO
Using the usp_insertFamily stored procedure USE [LCCHPDev] GO
DECLARE @return_value int, @FID int
EXEC @return_value = [dbo].[usp_InsertFamily] @LastName = N'Clubber', @NumberofSmokers = 4, @PrimaryLanguageID = 1, @Notes = N'Family notes', @New_Travel_Notes = N'traveled to costa rica', @Travel_Start_Date = N'20050209', @Travel_End_Date = N'20050215', @Pets = 2, @inandout = 1, @PrimaryPropertyID = 11358, @FrequentlyWashPets = 0, @FID = @FamilyID OUTPUT -- @FID is the id of the newly inserted family SELECT @FamilyID as N'@FamilyID' -- @return_value is the exit code SELECT 'Return Value' = @return_value
GO
or directly using the usp_InsertTravelNotes sp
USE [LCCHPDev] GO
DECLARE @return_value int, @TravelNotesID int
EXEC @return_value = [dbo].[usp_InsertTravelNotes] @Family_ID = 2811 @Travel_Notes = N'traveled to costa rica', @Start_Date = N'20050209', @End_Date = N'20050215', @InsertedNotesID= @TravelNotesID OUTPUT -- @InsertedNotesID is the id of the newly inserted notes SELECT @InsertedNotesID as N'@TravelNotesID' -- @return_value is the exit code SELECT 'Return Value' = @return_value
two questions:
why is travel notes associated with a family not a person? original db screens had person and that seems to make sense. Was there a change ?
Also, why are the notes one to many values with mapping tables? For editing, that means we need a datagrid for each note "history"; unless the notes are not editable. A single field for each notes type would be easier to deal with if we're allowing editing of notes.
Cornelia indicated that the travel notes are more relevant for their information at the family level. We confirmed this during the meeting on the 25th with Colleen and Cornelia. That is how LCCHP wants to implement it initially.
about a month ago i pulled all the notes columns from each table (i.e. person, property, family, travel, hobby . . . ) and put them in their own respective tables. Using this approach supports more notes (good and bad). I agree with your assessment and have no intention of providing a means to edit historic notes. I feel once a note is in there, it should remain as such for historical tracking. If they want to change something, they can add a new note with updated information.
see notes on #103, travel will remain in the addclient web page.
add Travel notes