You are here:   Blog
Register   |  Login

LightSwitch News

Dec 5

Written by: Michael Washington
12/5/2011 8:02 AM  RssIcon

image_thumb43

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)

image_thumb

It actually takes only 3-4 minutes to create three tables and three screens that would comprise the existing application:

image_thumb4

image_thumb5

image_thumb6

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.

image_thumb16

image_thumb8

The Screens are simple List and Details Screens created using the Screen Template.

The Application

image_thumb111

The first step is to install and enable the ComponentOne Scheduler LightSwitch Extension.

image_thumb131

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).

image_thumb15

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.

image_thumb19

The Screen will be created.

image_thumb211

We click on the Scheduler Control, in the object tree to set it’s properties.

image_thumb25

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.

image_thumb2

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)

image_thumb14

We return to the Screen designer and select Add Data Item.

image_thumb151

We add the Patients collection.

image_thumb11

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.

image_thumb13

It will initially be added as a Data Grid.

Use the arrow selector to change it to a C1Contacts control.

image_thumb18

Click on the C1ContactsPlaceholder that appears, to set the Properties to map the control to the Patients table.

image_thumb21

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

image_thumb251

We can add a Color field to each Entity

image_thumb26

image_thumb29

Specify a Choice List.

image_thumb32

This allows us to specify a Color.

image_thumb34

This will control the background color when using grouping.

image_thumb37

You can also control colors using the Label.

image_thumb40

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 Smile. 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.

Special Thanks

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...


Gravatar

Re: A Groundbreaking Control - ComponentOne Scheduler LightSwitch Extension

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 isgo on   12/7/2011 2:43 PM
Gravatar

Re: A Groundbreaking Control - ComponentOne Scheduler LightSwitch Extension

This is a really good example, wish you can do some samples with telerik controls

By Jason on   12/8/2011 9:33 PM
Gravatar

Re: A Groundbreaking Control - ComponentOne Scheduler LightSwitch Extension

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 dionne on   12/12/2011 8:57 AM
Gravatar

Re: A Groundbreaking Control - ComponentOne Scheduler LightSwitch Extension

@dionne - There is no way that I know of but you should also ask on the ComponentOne site.

By Michael Washington on   12/21/2011 8:28 AM
Gravatar

Re: A Groundbreaking Control - ComponentOne Scheduler LightSwitch Extension

Is it possible to add/replace the appt label description text and color? The standard description may not be applicable to all cases.

Thanks

By Sid on   12/27/2011 6:32 PM
Gravatar

Re: A Groundbreaking Control - ComponentOne Scheduler LightSwitch Extension

@Sid - You should ask on the ComponentOne site.

By Michael Washington on   12/27/2011 6:34 PM
Gravatar

Re: A Groundbreaking Control - ComponentOne Scheduler LightSwitch Extension

Hi I Have download a Trial Version but Visual studio dont' see mi installation

By Cristian on   5/11/2013 4:47 AM

Your name:
Gravatar Preview
Your email:
(Optional) Email used only to show Gravatar.
Your website:
Title:
Comment:
Security Code
CAPTCHA image
Enter the code shown above in the box below
Add Comment   Cancel 

Microsoft Visual Studio is a registered trademark of Microsoft Corporation / LightSwitch is a registered trademark of Microsoft Corporation