Introduction
What does your application/extension do? What business problem does it solve?
The Health and Safety Management System is an application that is used to help organizations better manage and mitigate health and safety statistics and KPIs. The solution is designed to empower users with the tools to capture and report on finely grained health and safety performance metrics.
Workplace safety is serving an ever increasing role with many organizations. Companies are now being held accountable to, not just their own internal stakeholders such as employees and shareholders, but also other external stakeholders such as customers, vendors, and suppliers. Whether it is for internal corporate health and safety KPI measurements, or just for general best practices, organizations are putting more and more visibility into health and safety.
Also, companies are now commonly asking for health and safety accountability from their partners, often before engaging in a relationship. For example, large companies in the energy industries make it a prerequisite that the vendors they engage must have a sound health and safety program business processes in place. Often these relationships include contractual oblications which require the vendor to provide regular health and safety reporting; especially when performing work on a customer work site.
The Health and Safety Management System has been designed to provide an organization with the means to capture and report on key health and safety metrics. The key value propositions for the Health and Safety Management System include;
- Granular health and safety information gathering, such as;
- Observations - capturing data that identifies health and safety threats and opportunities,
- Near Miss Incidents - incidents that occur and do not result in an injury or time loss, And
- Injury and Time Loss Incidents - managing details about injuries and time loss.
- Flexible and intuitive user configurable reporting, including;
- Several "canned" and built-in reports that can be optionally printed or exported to various formats such as Excel or PDF.
- Powerful OLAP analytics that are highly customizable.
- Flexible user defined querying that can optionally be saved, reloaded, printed, or exported.
- Highly configurable, and is easily customizable for each customer.
- Can be quickly integrated with existing organization systems; such as legacy customer or human resources ERP systems.
- Can be deployed to either the desktop, web, or the cloud.
How many screens and entities does this application have?
Currently, the Health and Safety Management System has;
- 19 screens that provide standard data entry interfaces as well as for various administration tasks such as lookup or reference tables, reporting and analytics, and security, And
- 23 entities (tables).
Did LightSwitch save your business money? How?
LightSwitch provided the means to build the solution very quickly. The quality of the solution matches that of an enterprise class solution that would have taken a great deal of more time and effort to create using other, more common, technologies.
Getting to market quickly is key, as is the quality of the offering. With LightSwitch, a solution can be created using technologies and proven software development best practices. The quality of the solution is something that is automatically applied when using LightSwitch. Enabling the scenarios and requirements was easy using the template based tasks.
Would this application still be built if you didn’t have LightSwitch? If yes, with what?
The solution concept was already on-the-table well before any consideration was being made regarding the technology to use for it. Consideration was made for using one or more technologies, including; ASP.Net MVC, HTML5/JSON, SQL Server, and WCF.
Again, as mentioned earlier, LightSwitch makes for a much faster turnaround in delivery time. Using relatively traditional development technologies would result in much more time before delivering on requirements.
How many users does this application support?
As many as us required. There are no known constraints to suggest that the solution could not be deployed in a large enterprise.
How long did this application take to actually build using LightSwitch?
As of the time of this writing, the solution took only a few days to build. It is estimated that the actual total hours of effort would be 18.
Does this application use any LightSwitch extensions? If so, which ones? Did you write any of these extensions yourself? If so, is it available to the public? Where?
The Health and Safety Management System uses a number of extensions and custom controls. These include:
A key success factor of the development of this solution is to utilize existing extensions and tools whenever possible. The goal was to deliver on requirements as quickly as possible. Using existing tools offered the opportunity to enable scenarios without having to "reinvent the wheel".
How did LightSwitch make your developer life better? Was it faster to build compared to other options you considered?
LightSwitch made a remarkable impact on the developer experience when using LightSwitch for this solution. The investment in effort and time was considerably less than what it would have taken using the other considered technologies.
Links, Screenshots, Videos
Links
Screenshot(s)
The Health and Safety Management Home Page
New Observation entry
Injury and Time Loss
An example report
Some very flexible data mining features...
...with visualizations!
Intuitive user defined queries that can be saved and loaded for later use.
Code and Techniques
As far as coding and techniques go, there here are a few useful tidbits that can be appied to your own LightSwitch projects...
Images and Icons
Applying images and icons to the application added some UX appeal to the overall feel of the application. The process used to add images to headers of each of the screens in the application included;
- Creating appropriately sized .png images for screen header image.
- Opening the Solution Explorer File View.
- Add the image as an Embedded Resource in the Resources folder of the Client project.
- Added an image control to the screen element tree. The element is a SilverLight Image control, so that the element would be borderless...
- A class named MyImageHelper was created in the UserCode folder of the Client project (open Solution Explorer in File View).
using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.IO;
using System.Reflection;
using System.Windows.Media.Imaging;
namespace LightSwitchApplication
{
public class MyImageHelper
{
public static byte[] GetImageByName(string fileName)
{
Assembly currentAssembly = Assembly.GetExecutingAssembly();
Stream stream = currentAssembly.GetManifestResourceStream("LightSwitchApplication.Resources." + fileName);
return GetStreamAsByteArray(stream);
}
public static BitmapImage GetBitmapImageByName(string fileName)
{
Assembly currentAssembly = Assembly.GetExecutingAssembly();
Stream stream = currentAssembly.GetManifestResourceStream("LightSwitchApplication.Resources." + fileName);
return GetBitmapImage(GetStreamAsByteArray(stream));
}
private static byte[] GetStreamAsByteArray(System.IO.Stream stream)
{
if (stream != null)
{
int streamLength = Convert.ToInt32(stream.Length);
byte[] fileData = new byte[streamLength];
stream.Read(fileData, 0, streamLength);
stream.Close();
return fileData;
}
else
{
return null;
}
}
private static BitmapImage GetBitmapImage(byte[] bytes)
{
using (MemoryStream ms = new MemoryStream(bytes))
{
var bi = new BitmapImage();
bi.SetSource(ms);
return bi;
}
}
}
}
- Then back in the home page screen, code was implemented to retrieve and use the image on the screen...
partial void AllIncidents_InitializeDataWorkspace(List<IDataService> saveChangesTo)
{
IContentItemProxy logo = this.FindControl("HomeHeaderLogo");
logo.ControlAvailable += new EventHandler<ControlAvailableEventArgs>(HomeHeaderLogo_ControlAvailable);
}
void HomeHeaderLogo_ControlAvailable(object sender, ControlAvailableEventArgs e)
{
var img = e.Control as Image;
if (img != null)
img.Source = MyImageHelper.GetBitmapImageByName("HealthAndSafetyLogo.png");
}
- ...the image is applied when the application opens the screen...
Other Techniques
A couple of other techniques applied to this solution include:
Hope you all find this helpful and useful. Cheers!
Post a link to this contest entry on our Facebook wall and let people know they should rate this submission! And don’t forget to follow us on Twitter for contest updates! Good luck!