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/02 17:03] 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 187: | Line 188: | ||
</ | </ | ||
- | === Attendance | + | === Registration |
<code sql> | <code sql> | ||
/ | / | ||
Line 197: | Line 198: | ||
/* | /* | ||
/ | / | ||
- | CREATE TABLE ATTENDANCE | + | CREATE TABLE REGISTRATION |
ATTENDEERECID | ATTENDEERECID | ||
WORKSHOPRECID | WORKSHOPRECID | ||
Line 207: | 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 | + | 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 227: | Line 279: | ||
ALTER TABLE ATTENDANCE | ALTER TABLE ATTENDANCE | ||
ADD CONSTRAINT PK_ATTENDANCE | ADD CONSTRAINT PK_ATTENDANCE | ||
- | PRIMARY KEY (ATTENDEERECID, | + | PRIMARY KEY (ATTENDEERECID, |
/ | / | ||
Line 239: | 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 332: | ||
== Entity Relationship Diagram == | == Entity Relationship Diagram == | ||
+ | {{: | ||
+ | |||
+ | == Relation Scheme Diagram == | ||
+ | {{: | ||
+ | |||
+ | == DataSet == | ||
+ | |||
+ | Add a [[swdev: | ||
+ | |||
+ | Create a dataset object to have access to the underlying data tables. | ||
+ | |||
+ | <code csharp> | ||
+ | public partial class MainWindow : Window | ||
+ | { | ||
+ | public MainWindow() | ||
+ | { | ||
+ | InitializeComponent(); | ||
+ | |||
+ | // construct dataset | ||
+ | datasetWorkshopDB ds = new datasetWorkshopDB(); | ||
+ | |||
+ | // use a table adapter to populate the Attendee datatable using ATTENDEE table | ||
+ | datasetWorkshopDBTableAdapters.ATTENDEETableAdapter adaptAttendee = new datasetWorkshopDBTableAdapters.ATTENDEETableAdapter(); | ||
+ | adaptAttendee.Fill(ds.ATTENDEE); | ||
+ | |||
+ | 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 | ||
+ | this.DataContext = ds.ATTENDEE.DefaultView; | ||
+ | } | ||
+ | } | ||
+ | </ |