12/5/2011 8:02 AM
In many ways the ComponentOne Scheduler LightSwitch Extension validates the brilliance and promise of Visual Studio LightSwitch. This LightSwitch Extension allows a non-programmer the ability to create complex highly customizable applications, which combine and orchestrate several data sources.
ComponentOne allowed me to preview several Beta versions of the groundbreaking control. The control is due to be released 12/14/2011, so this preview is very close to the final product. When the control is released you can obtain it at http://www.componentone.com. The expected list price is to be $295.00.
In this preview, we will create an application that allows a Doctor’s office to schedule Patients, Doctors and Examination Rooms. We will create a fully functioning application with no code.
This preview will cover much the same functionality described in the article: Databinding A Complex Multi-Table Silverlight Control In LightSwitch: ComponentOne Scheduler that covered the pure Silverlight control that this Control Extension is based on. In that article, a LightSwitch program creator would be required to create Silverlight code, in this article, no programing is needed, only configuration.
The Requirements Of The Sample Application
Let us assume that a Doctor’s office has a database of Patients, Doctors, and Examination Rooms. The office desires the following:
- When a Patient calls to schedule an appointment, the Staff is able to easily see the availability of each Doctor and to schedule the appointment.
- Each morning, a print out of each Doctor’s appointments can be given to the Doctor.
- Each morning, a print out of the schedule for each Examination Room, can be posted on it’s door.
Note: by simply using LightSwitch, we automatically enable the ability to have a single database that can be easily accessed from any location by multiple Staff members.
The Application (Before)
It actually takes only 3-4 minutes to create three tables and three screens that would comprise the existing application:
Notice the tables are not associated. The ComponentOne Scheduler Control will automatically handle any associations. This reduces the required skills to implement the control.
It also allows you to easily consume data from what could be otherwise unrelated data sources. It is easy to create a WCF RIA Service or use a provider that connects to QuickBooks or some other source to get the current Patient list.
The Screens are simple List and Details Screens created using the Screen Template.
The first step is to install and enable the ComponentOne Scheduler LightSwitch Extension.
The next step is to create an Entity (table) to hold the data for the Extension.
Note that the Properties field will hold a lot of information so it’s Maximum Length property should be cleared (to allow for unlimited text).
Installing the ComponentOne Scheduler LightSwitch Extension provides a Screen Template that allows you to simply select it, and bind it to the table you created.
The Screen will be created.
We click on the Scheduler Control, in the object tree to set it’s properties.
We click on the Appointment group panel to set the mapping between the control and the Appointments table.
This is where the magic happens and why I consider this control ground breaking. A large amount of “intent and decision” is handled using this design pattern. This is further illustrated when we associate the Doctors, Patients, and Examination Rooms later.
At this point, we can run the application and we have a fully functioning Scheduler Control.
The only thing missing is the integration with the Doctors, Patients, and Examination Rooms.
Integrating Additional Entities (Tables)
We return to the Screen designer and select Add Data Item.
We add the Patients collection.
The Patients collection will appear in the View Model on the left-hand side of the Screen.
Add it to the Object Tree on the right-hand side of the Screen.
It will initially be added as a Data Grid.
Use the arrow selector to change it to a C1Contacts control.
Click on the C1ContactsPlaceholder that appears, to set the Properties to map the control to the Patients table.
When we run the application, we can now add Contacts that come from the Patients table.
We repeat the same process to associate the Doctors with the Categories, and the Examination Rooms with the Resources.
Colors And Grouping
We can add a Color field to each Entity…
Specify a Choice List.
This allows us to specify a Color.
This will control the background color when using grouping.
You can also control colors using the Label.
Many grouping types are available, and all calendars can be imported, exported, and printed.
Note: The printing was a personal request during the Beta process. The limitation is that it only prints what is visible on the screen. I assured the team that this was a minor limitation and it was better than no print button at all . You can export the calendars to an .ical file and print then with another program such as Microsoft Outlook.
How The ComponentOne Scheduler Control Extension ‘Raises The Bar’
- The control works in the normal flow of LightSwitch because it allows you to bind each control to a normal LightSwitch collection, and then indicate the mapping between your collection and the important fields the control needs.
- The control automatically handles a ton of “dirty little details” such as relating a resource to an appointment and updating the proper field when the end-user uses the control.
- Rather than requiring the LightSwitch application designer to make a lot of careful decisions, the control uses the LightSwitch grouping control API to allow the LightSwitch application designer to indicate their intent (“I want to bind and configure the Contacts for the Scheduler”).
- The control allows all properties to be set, even when the application is running using the Screen debug mode.
I would like to thank everyone at ComponentOne, especially Dan Beall, John Juback, Greg Lutz, Rich Dudley, and Bernardo Castilho.
7 comment(s) so far...
By isgo on
12/7/2011 2:43 PM
it is really interesting to see how many option do one have in order to customize and at the same time take the most of these specific feature. It definitively changes one's view in regards to calendars and appointments creations...
By Jason on
12/8/2011 9:33 PM
This is a really good example, wish you can do some samples with telerik controls
By dionne on
12/12/2011 8:57 AM
Very nice! I did have a question about the appointment screen. I see that there is a subject, body, start and end date. If I have more fields in my table can I add them to the screen for the user to fill in or is the limited by the extension?
By Michael Washington on
12/21/2011 8:28 AM
@dionne - There is no way that I know of but you should also ask on the ComponentOne site.
By Sid on
12/27/2011 6:32 PM
Is it possible to add/replace the appt label description text and color? The standard description may not be applicable to all cases.
By Michael Washington on
12/27/2011 6:34 PM
@Sid - You should ask on the ComponentOne site.
By Cristian on
5/11/2013 4:47 AM
Hi I Have download a Trial Version but Visual studio dont' see mi installation