Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
workshopdb:database [2010/11/03 09:14] smayr |
workshopdb:database [2010/11/04 14:11] (current) smayr |
||
---|---|---|---|
Line 3: | Line 3: | ||
* Attendee | * Attendee | ||
* Workshop | * Workshop | ||
+ | * Registration | ||
* Attendance | * Attendance | ||
* Version | * Version | ||
Line 21: | Line 22: | ||
RECID INTEGER NOT NULL, | RECID INTEGER NOT NULL, | ||
ID | ID | ||
- | FirstName | ||
LastName | LastName | ||
+ | FirstName | ||
Address1 | Address1 | ||
Line 28: | Line 29: | ||
Address3 | Address3 | ||
City | City | ||
- | | + | |
Country | Country | ||
PostalCode | PostalCode | ||
- | | + | |
- | | + | |
- | | + | |
Fax VARCHAR(20), | Fax VARCHAR(20), | ||
Email VARCHAR(50), | Email VARCHAR(50), | ||
Website | Website | ||
- | Salutation | + | Salutation |
Occupation | Occupation | ||
| | ||
Line 52: | Line 53: | ||
ProfessionalOrg2Number VARCHAR(30), | ProfessionalOrg2Number VARCHAR(30), | ||
ProfessionalOrg3 | ProfessionalOrg3 | ||
- | | + | |
| | ||
AccountNumber VARCHAR(30), | AccountNumber VARCHAR(30), | ||
Line 124: | Line 125: | ||
Address3 | Address3 | ||
City | City | ||
- | | + | |
Country | Country | ||
PostalCode | PostalCode | ||
- | | + | |
- | | + | |
- | | + | |
Fax VARCHAR(20), | Fax VARCHAR(20), | ||
Email VARCHAR(50), | Email VARCHAR(50), | ||
Line 140: | Line 141: | ||
Instructions | Instructions | ||
HotelAccommodations BLOB SUB_TYPE 1 SEGMENT SIZE 2048, | HotelAccommodations BLOB SUB_TYPE 1 SEGMENT SIZE 2048, | ||
+ | | ||
RecModifiedBy | RecModifiedBy | ||
RecModifiedDateTime TIMESTAMP | RecModifiedDateTime TIMESTAMP | ||
Line 186: | Line 188: | ||
</ | </ | ||
- | === Attendance | + | === Registration |
<code sql> | <code sql> | ||
/ | / | ||
Line 196: | Line 198: | ||
/* | /* | ||
/ | / | ||
- | CREATE TABLE ATTENDANCE | + | CREATE TABLE REGISTRATION |
ATTENDEERECID | ATTENDEERECID | ||
WORKSHOPRECID | WORKSHOPRECID | ||
Line 206: | Line 208: | ||
PaymentAmountPaid | PaymentAmountPaid | ||
ExpediteCertificates SMALLINT default 0, | ExpediteCertificates SMALLINT default 0, | ||
- | EventCheckIn1 | ||
- | EventCheckOut1 | ||
- | EventCheckIn2 | ||
- | EventCheckOut2 | ||
- | EventCheckIn3 | ||
- | EventCheckOut3 | ||
TotalReceptionGuests SMALLINT default 0, | TotalReceptionGuests SMALLINT default 0, | ||
TotalAudiometersToCalibrate SMALLINT default 0, | TotalAudiometersToCalibrate SMALLINT default 0, | ||
PacketNumber | PacketNumber | ||
- | | + | |
Notes BLOB SUB_TYPE 1 SEGMENT SIZE 2048, | Notes BLOB SUB_TYPE 1 SEGMENT SIZE 2048, | ||
+ | RecModifiedBy | ||
+ | RecModifiedDateTime | ||
+ | ); | ||
+ | |||
+ | / | ||
+ | /* Primary Keys */ | ||
+ | / | ||
+ | ALTER TABLE REGISTRATION | ||
+ | ADD CONSTRAINT PK_REGISTRATION | ||
+ | PRIMARY KEY (ATTENDEERECID, | ||
+ | |||
+ | / | ||
+ | /* Foreign Keys */ | ||
+ | / | ||
+ | ALTER TABLE REGISTRATION | ||
+ | ADD CONSTRAINT FK_REGISTRATION_ATTENDEE | ||
+ | FOREIGN KEY (ATTENDEERECID) | ||
+ | REFERENCES ATTENDEE (RECID) | ||
+ | ON DELETE CASCADE ON UPDATE CASCADE; | ||
+ | |||
+ | ALTER TABLE REGISTRATION | ||
+ | ADD CONSTRAINT FK_REGISTRATION_WORKSHOP | ||
+ | FOREIGN KEY (WORKSHOPRECID) | ||
+ | REFERENCES WORKSHOP (RECID) | ||
+ | ON DELETE CASCADE ON UPDATE CASCADE; | ||
+ | | ||
+ | | ||
+ | / | ||
+ | /* Triggers | ||
+ | / | ||
+ | SET TERM ^ ; | ||
+ | |||
+ | / | ||
+ | /* Triggers for tables | ||
+ | / | ||
+ | |||
+ | / | ||
+ | /* | ||
+ | / | ||
+ | </ | ||
+ | |||
+ | === Attendance === | ||
+ | <code sql> | ||
+ | / | ||
+ | /* | ||
+ | / | ||
+ | SET NAMES NONE; | ||
+ | |||
+ | / | ||
+ | /* | ||
+ | / | ||
+ | CREATE TABLE ATTENDANCE ( | ||
+ | ATTENDEERECID | ||
+ | WORKSHOPRECID | ||
+ | EventDate | ||
+ | EventCheckIn | ||
+ | EventCheckOut | ||
RecModifiedBy | RecModifiedBy | ||
RecModifiedDateTime | RecModifiedDateTime | ||
Line 226: | Line 279: | ||
ALTER TABLE ATTENDANCE | ALTER TABLE ATTENDANCE | ||
ADD CONSTRAINT PK_ATTENDANCE | ADD CONSTRAINT PK_ATTENDANCE | ||
- | PRIMARY KEY (ATTENDEERECID, | + | PRIMARY KEY (ATTENDEERECID, |
/ | / | ||
Line 238: | Line 291: | ||
ALTER TABLE ATTENDANCE | ALTER TABLE ATTENDANCE | ||
- | ADD CONSTRAINT | + | ADD CONSTRAINT |
FOREIGN KEY (WORKSHOPRECID) | FOREIGN KEY (WORKSHOPRECID) | ||
REFERENCES WORKSHOP (RECID) | REFERENCES WORKSHOP (RECID) | ||
ON DELETE CASCADE ON UPDATE CASCADE; | ON DELETE CASCADE ON UPDATE CASCADE; | ||
- | + | | |
- | + | ||
/ | / | ||
/* Triggers | /* Triggers | ||
Line 280: | Line 333: | ||
== Entity Relationship Diagram == | == Entity Relationship Diagram == | ||
{{: | {{: | ||
+ | |||
+ | == Relation Scheme Diagram == | ||
+ | {{: | ||
== DataSet == | == DataSet == | ||
- | Create a dataset to have access to the underlying data tables. | + | Add a [[swdev: |
+ | |||
+ | Create a dataset | ||
<code csharp> | <code csharp> | ||
Line 296: | Line 354: | ||
// use a table adapter to populate the Attendee datatable using ATTENDEE table | // use a table adapter to populate the Attendee datatable using ATTENDEE table | ||
- | datasetWorkshopDBTableAdapters.ATTENDEETableAdapter | + | datasetWorkshopDBTableAdapters.ATTENDEETableAdapter |
- | | + | |
+ | |||
+ | datasetWorkshopDBTableAdapters.WORKSHOPTableAdapter adaptWorkshop = new datasetWorkshopDBTableAdapters.WORKSHOPTableAdapter(); | ||
+ | adaptWorkshop.Fill(ds.WORKSHOP); | ||
+ | |||
+ | datasetWorkshopDBTableAdapters.REGISTRATIONTableAdapter adaptRegistration = new datasetWorkshopDBTableAdapters.REGISTRATIONTableAdapter(); | ||
+ | adaptRegistration.Fill(ds.REGISTRATION); | ||
+ | |||
+ | datasetWorkshopDBTableAdapters.ATTENDANCETableAdapter adaptAttendance = new datasetWorkshopDBTableAdapters.ATTENDANCETableAdapter(); | ||
+ | adaptAttendance.Fill(ds.ATTENDANCE); | ||
// use the Attendee datatable as the DataContext for the Window | // use the Attendee datatable as the DataContext for the Window |