David Sandor

Build succeeded.

Netduino: Day 2 - uBlox LEA-5H-0-009 GS407 GPS Receiver

clock August 5, 2011 16:38 by author dsandor

So I decided to jump in to serial communication.  Why not?  I have a ublox LEA-5H-0-009 GPS Receiver and a GS407 break out board from sparkfun.com. I connected the red (3.3v) and the black (gnd) from the GPS to the netduino.  There is a TXO and RXI pin and a GPIO pin on the GPS break out board (BOB).  I admit, I had to google a lot.. I mean a LOT to figure this one out.  Eventually I found a great article from blog.bobcravens.com with 99.9999% of the solution.

2011-08-05 15.35.28

I learned a lot about serial communication from reading Bob’s article.  In summary, what I learned is that I can use D0 and D1 on my netduino as a serial port COM1.  D0 is COM1 IN or RX and D1 is COM1 OUT or TX.  The last piece of the puzzle was the GPIO pin on the GPS.  Clueless me had no idea what to do with the GPIO pin.  After reading his blog, it seems that is used to turn on and off the power.

Here are a few better views of the connections.  Ignore the IC chip and the three axis sensor on the project board.

2011-08-05 15.35.38

2011-08-05 15.35.28

When I first connected the device I was getting nothing from it because the TX and RX were flipped.  Then, I started getting bytes from the serial port but they were poorly formatted and I could not convert them to UTF.  This caused errors when using the System.Text.UTF8Encoding.UTF8.GetChars(buffer); code.  As it turns out the baud rate needed to be 9600 and I had it at 4800.  After that fix I was set and I was getting NEMA messages.

$GPRMC,,V,,,,,,,,,,N*53
$GPVTG,,,,,,,,,N*30
$GPGGA,,,,,,0,00,99.99,,,,,,*48
$GPGSA,A,1,,,,,,,,,,,,,99.99,99.99,99.99*3
0
$GPGSV,1,1,00*79
$GPGLL,,,,,,V,N*64
$GPRMC,,V,,,,,,,,,,N*53
$GPVTG,,,
,,,,,,N*30
$GPGGA,,,,,,0,00,99.99,,,,,,*48
$GPGSA,A,1,,,,,,,,,,,,,99.99,99.99,99.99*30
$GPGSV,1
,1,00*79
$GPGLL,,,,,,V,N*64

It does not look like it is picking up a signal yet but that is my next step.  Get the messages decoded and get the device to lock on a few satellites.

Here is the code I used which I got from Bob’s post and tweaked a bit as I was running into issues decoding the bytes because of the baud rate issue.

        public static void Main()
        {
         SerialPort serialPort = new SerialPort("COM1", 9600, Parity.None, 8, StopBits.One);
         serialPort.Open();
         // pin D2 off = gps module turned on
         OutputPort powerPin = new OutputPort(Pins.GPIO_PIN_D2, false);
         char[] str = null;
         while (true)
         {
             int bytesToRead = serialPort.BytesToRead;
             if (bytesToRead > 0)
             {
                 // get the waiting data
                 byte[] buffer = new byte[bytesToRead];
                 serialPort.Read(buffer, 0, buffer.Length);
                 // print out our received data
                 try
                 {
                     str = System.Text.UTF8Encoding.UTF8.GetChars(buffer);
                 }
                 catch { }
                 if ( str != null )
                    Debug.Print(new String(str));
             }
             Thread.Sleep(100); // wait a bit so we get a few bytes at a time...
         }
        }
    }


Excellent network storage server for only $322.

clock July 28, 2011 09:31 by author dsandor

I have used products from Buffalo, Netgear, and some no-name network attached storage for my home network and they all pretty much work poorly.  The big drawback to those devices are the network port, cpu, and the software that is installed on them (OS).  While most devices these days advertise a 1,000 MB/s (Gigabit) network interface they never achieve that rate or even come close to that.  With all the of the previously mentioned devices, I could download files from my internet connection quicker than from my local network device.

Enter the HP Micro Server.  This device has a real processor and room for 4 2TB hard drives (someone mentioned that you can up that to 3TB but I have not verified that yet).  Since this is a real server you can expand the RAM in the device and the network interface actually works at 1 Gigabit. 

There is no operating system on the device, so you are not paying for an OS you do not want or need.  Install Windows, Linux, or FreeNAS on the device and you are up and running.  You can even use an SSD or USB thumb drive to boot the OS which makes the device rock solid.  Below is a link to the HP Micro Server on Amazon. 



Solved: Add new configuration to Visual Studio 2010 project and code will no longer compile.

clock May 24, 2011 11:17 by author dsandor

Scenario

Create a new configuration in Visual Studio and select ‘copy’ from an existing working configuration.  The new configuration will not compile now.

image

As it turns out, Visual Studio 2010 (even with SP1) does not copy the Conditional compilation symbols.

image

Adding in my conditional compilation symbols allows the project to compile now.



MVVM / WPF DelegateCommand class snippet.

clock May 19, 2011 17:16 by author dsandor

Here is the snippet I am currently using to implement a basic DelegateCommand class.

CODE:

    public class DelegateCommand : ICommand
    {
        private Action _executeMethod;
        public DelegateCommand(Action executeMethod)
        {
            _executeMethod = executeMethod;
        }
        public bool CanExecute(object parameter)
        {
            return true;
        }
        public event EventHandler CanExecuteChanged;
        public void Execute(object parameter)
        {
            _executeMethod.Invoke();
        }
    }

Snippet file:

<?xml version="1.0" encoding="utf-8" ?>
<CodeSnippets  xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
	<CodeSnippet Format="1.0.0">
		<Header>
			<Title>delegate command</Title>
			<Shortcut>delcom</Shortcut>
			<Description>Creates basic delegate command class for MVVM / WPF.</Description>
			<Author>DevSQL, LLC (David Sandor)</Author>
			<SnippetTypes>
				<SnippetType>Expansion</SnippetType>
			</SnippetTypes>
		</Header>
		<Snippet>
			<Declarations>
				<Literal>
					<ID>namespace</ID>
					<ToolTip>Namespace</ToolTip>
					<Default>ViewModel</Default>
				</Literal>
			</Declarations>
			<Code Language="csharp"><![CDATA[
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Input;
namespace $namespace$
{
    public class DelegateCommand : ICommand
    {
        private Action _executeMethod;
        public DelegateCommand(Action executeMethod)
        {
            _executeMethod = executeMethod;
        }
        public bool CanExecute(object parameter)
        {
            return true;
        }
        public event EventHandler CanExecuteChanged;
        public void Execute(object parameter)
        {
            _executeMethod.Invoke();
        }
    }
}
$end$]]>
			</Code>
		</Snippet>
	</CodeSnippet>
</CodeSnippets>



Remote Internet Label Printing for Microsoft Dynamics Ax

clock May 18, 2011 15:27 by author dsandor

Business Problem

Remote warehouses are not directly connected to the central office and thus are not connected to the ERP System (Microsoft Dynamics Ax 2009).  Employees at remote warehouses need to perform inventory transactions on iTouch devices and some of these transactions require a label to be printed on a Zebra label printer.  Label printing typically involves a centralized print server that formats and streams the print job to a Windows Print Queue.  Remote printing using a Microsoft Print Queue is not feasible across the internet.

Solution

The solution to this problem was to build  a simple Windows Service which self hosts a WCF service.  The Windows Service has the ability to function as both a server and a client.  The service can poll other services for print jobs, if the print job is local the job is sent to a local label printer, if the job is remote it is queued for a remote server to poll (via WCF Services).  Print jobs are archived which allows a user to load the Status Monitor application and reprint a label.

PrintConfig

Users can reprint labels using the above status screen.

PrintConfig2

User’s can configure the print server, start and stop the service, and update the application using the configuration screen.

This software is written in .NET 4.0 using WPF/XAML as the UI.  The application implements the Model-View-ViewModel MVVM pattern.  The Windows Service is written in .NET 4.0 and self hosts a WCF Service.  Remote printing is implemented using WCF with client/server X.509 certificates for security.



Microsoft Dynamics Ax 2009 Repairs Module in Silverlight 4

clock May 17, 2011 13:46 by author dsandor

Business Problem

Microsoft Dynamics Ax 2009 has a gap in functionality with regard to order management for repair orders.  MDSi has several equipment repair and configuration labs on site.  Customer equipment can be staged and configured or physically repaired and reconditioned.  While Microsoft Dynamics Ax 2009 does provide some of the functionality required to perform in-house repairs, it falls short in supporting the expanded workflow of a repair lab.  Repair orders needed to be tracked, labor costs tracked, and part/item inventory locations need to be updated in Ax to reflect where the parts are located based on workflow transactions.  For example, if a repair technician brings a part to his/her workstation and marks the repair line as in process, Ax needs to be updated to reflect the inventory has been transferred to the repair technicians ‘bin location’.

Solution

The solution was to fill the gap with a Silverlight 4.0 line of business application that will provide a simple user interface that allows warehouse workers and technicians to simply change the status of a repair line.  The application will perform the necessary inventory movement journal transactions to move the part from staging bins to in process and finally to complete warehouse bins.  If a part is successfully repaired a sales order is generated to allow for the invoicing of the repair.  If the repair cannot be completed, a disposal order is created.

AllRepairs

All repair orders show in the main view.  Users can filter or group using the data grid.  From this view the user can also view the repair lines of a repair order and edit the details of a repair order.

RepairOrderDetails

Creating or editing a repair order is accomplished through the screen above.

RepairOrderDetailEdit

Editing the details of a repair line displays a modal view.

PostPickingList

Warehouse personnel can pick the repair lines that are awaiting staging.  The above view shows all the repair lines that were picked by user dsandor.  From here, the user can print repair labels for the items and post the items.  When the user posts the items it indicates to the repair technicians that there are parts in the ‘inbound’ repair staging bin location.  Technicians will retrieve the items from the staging location and indicate the part is now ‘in repair’ which transfers the part in Ax to the tech’s bin location.

This project was developed in Silverlight 4.0 and C#.  It leverages WCF Services and SQL Server 2008 R2 T-SQL Stored Procedures to query data from Microsoft Dynamics Ax 2009.  Create, Update, and Delete operations are performed by interfacing with the .NET Business Connector for Dynamics Ax.  The application uses the MVVM design pattern and was developed in little over one week.



Sharepoint Services Dashboard with 43 WebParts

clock May 16, 2011 11:14 by author dsandor

Business Problem

Casino Operators need to have concise real-time views of their operations.  A different classification of user needs to be able to view data in a different manner.  The existing application did not provide any data visualization tools to quickly show how the data is currently changing.

Solution

Build 43 different data visualization web parts for SharePoint Portal Server and allow each user to customize their dashboard.  The web application leveraged Windows SharePoint Services, ASP.NET, and WebServices to power the dashboard.  Business Analysis was performed which included interviewing Casino Operators, Customer Service Operators, and Casino Managers in an effort to include useful data visualization elements for each classification of user.

Below is a screenshot of the final output.  This project was completed in 2005.

Dashboard_Latest_4_2006

Below is an example of the wireframe that the business analysis produced in order to green light the project.

Dashboard_PreDesign



Resume: David Sandor, MCSD, MCSE, MCTS, MCP (Atlanta, GA)

clock May 11, 2011 10:59 by author dsandor

Summary

  • Over 15 years of programming and enterprise-level application development experience.
  • 10 years of experience with the Microsoft .NET Framework and C#.
  • Extensive involvement and management of all stages of the application development lifecycle including requirements gathering, architecture and modeling,  design, development and implementation.
  • Advocate for Agile development and usage of 37 signals Getting Real development concepts.
  • Completed all projects worked in the last 10 years.

Certifications

  • MCPD: [Charter Member] Web Developer 4 (ASP.NET 4.0, Visual Studio 2010, .NET 4.0)
  • MCPD: [Charter Member] Windows Developer 4 (WPF .NET 4.0, Winforms 4.0, .NET 4.0)
  • MCTS: [Charter Member] .NET Framework 4.0 Web Applications
  • MCTS: [Charter Member] .NET Framework 4.0 Windows Communication Foundation
  • MCTS: [Charter Member] .NET Framework 4.0 Data Access with ADO.NET
  • MCTS: [Charter Member] .NET Framework 4.0 Windows Applications (WPF / Winforms)
  • MCTS: [Charter Member] SQL Server 2008 Implementation and Maintenance
  • MCTS: .NET Framework 2.0 Distributed Applications
  • MCSE ( TCP/IP, Internet Information Server, Networking, Server 4.0, Workstation 4.0 )
  • MCSD ( Windows Operating Systems Architecture I & II, Visual Basic 5.0, Visual Basic 6.0, Microsoft
    Access, Visual Interdev 1.0, Front Page 2000 )
  • MCTS: Distributed (Microsoft Certified Technical Specialist: Distributed Applications)
  • MCT (Microsoft Certified Trainer)
  • C# Certification, Java 1, JavaScript
  • Linux Administration, Internet Security, Network Security

Publications

Microsoft: Unable to disclose title.
12/2005 - Windows Forms .NET 2.0, ASP.NET, Enterprise Development
07/2006 - Windows Mobile 6 .NET Developer
10/2007 - Workflow Foundation (.NET 3.0)
11/2007 - ADO.NET 3.0 / 3.5 (LINQ/MARS/XML)
07/2008 - ASP.NET 3.5
07/2008 - Windows Forms .NET 3.5
07/2008 - ADO.NET 3.5 (Entity Framework, LINQ)
03/2010 - .NET 4.0 Windows Presentation Foundation (WPF)

Generics and Predicates: Real World Examples
The .NET Framework 2.0 has introduced the concept of Generics and the use of predicates. This article should shed some light on the concept of predicates and give you some examples of using predicates in the real world.

Publication: Microsoft Developer Network Academic Alliance 10/2007

Dynamically setting properties of a class from a Database
In this short example I will demonstrate a powerful feature of Reflection that will allow you to dynamically set the values of a class. By setting the properties of a class dynamically, you can create a simple method that allows your class to be constructed and pre-populated from a database.

Publication: Microsoft Developer Network Academic Alliance, C-SharpCorner 05/2003

Writing an ActiveX Control with .NET
Software developers have used ActiveX controls on their web pages to add advanced functionality to the web experience. In this example, I will walk you through creating an ActiveX control that will show a simple user interface and accept input from a web page.

Publication: Microsoft Developer Network Academic Alliance, C-SharpCorner 03/2003

Events Made Easy: Lesson 1
The ability to fire an event is core to most Windows development projects. Events are useful for updating a user interface with changed data, or causing a piece of code to run after another piece of code has completed. .NET has brought us a powerful model for programming events. In this lesson we will write a small application that will show an example of an event.

Publication: Microsoft Developer Network Academic Alliance, C-SharpCorner 01/2003

Events Made Easy: Lesson 2 - A Little Advanced
In the previous lesson we created an event and consumed it. In doing so you probably noticed that our code would have been a little better if we could have determined whether or not the file actually existed. We could then provide more information to the user and make our code a bit more useful.

Publication: Microsoft Developer Network Academic Alliance, C-SharpCorner 01/2003

Open Source Contributions

Mono Project
http://mono-project.com/
Mono is an Open Source implementation of the .NET CLR. Mono is a free multi platform version of the .NET runtime and compilers written by .NET enthusiasts. I contributed to some of the Data Entity portions of the System.Data namespace. My contribution to mono was key to the success of an application I was involved in which required a .NET application to work on non-Microsoft operating systems such as Linux, Solaris, and a few non-traditional flavors.

.NetTiers
http://nettiers.com/
.NetTiers is a set of code generation templates that implement data layer and business entities while conforming to best practices and patters from well known and well respected subject matter experts like Martin Fowler. I began using .NetTiers in 2004 and really liked the conformance to patterns and practices. After using the product for some time I began contributing out of necessity and practicality.

FileHelpers
http://filehelpers.com/
FileHelpers is a high speed .NET Library that can be used to import/export/transform flat files from one format to another. This library is incredibly fast and can handle any input format and convert a file into any other format easily. I used this library at RBS Lynk to assist in transforming ISAM and COBOL formatted flat files that were well over 1GB in size into a MS SQL Server bulk import file in less than 90 seconds.

Work History

Microsoft Corporation - Contractor (via Studio B), Redmond, WA
March 2010
Author / Subject Matter Expert

  • .NET 4.0
  • Windows Presentation Foundation (WPF)

Microsoft Corporation - Contractor (via Studio B), Redmond, WA
July 2008 - August 2008
Author / Subject Matter Expert

  • .NET 3.5 ASP.NET
  • .NET 3.5 Windows Forms
  • ADO.NET 3.5 / Entity Framework
  • LINQ

Microsoft Corporation - Contractor (via Studio B), Redmond, WA
October 2007
Subject Matter Expert

  • .NET 3.5 Windows Workflow Foundation (C# / WF)

Management Data Systems International, Cumming, GA
October 2007 - Present
Software Architect / Lead Software Developer

  • Microsoft Axapta 2009 (Dynamics AX)
  • Integration with Business Connector & X++ Customizations
  • SharePoint Portal Server Development
  • WPF, WCF, WF development
  • MS SQL Server 2008 & 2005 Automation, Data Warehousing, BI (SSAS & SSRS)
  • Built a Windows Mobile application for Barcode Scanners*
    Windows Mobile,  and iOS iTouch code bases
  • Customized and Integrated with Microsoft Solomon IV and Microsoft Dynamics AX (Axapta) for inventory automation.
  • Provided integration points via SOA based WCF / Web Services.
  • Provided an Enterprise Disaster Recovery plan and architecture for Global Availability
  • Silverlight 3.0 and 4.0 based Line of Business Applications that provided Sales Forecasting, heads-up data visualization for salespeople.
  • WPF based RFID Inventory Management* and asset automation software deployed to remote logistics facilities around the US.  Global map with GIS features to visualize facility status and drill into outages.

* See project portfolio for more details on these projects.

Royal Bank of Scotland, Atlanta, GA
July 2007 - October 2007 (Contract)
Software Engineer

  • SharePoint Portal Server Development
  • WPF development and WF development
  • MS SQL Server 2005 Automation, Data Warehousing, BI
  • Enterprise IT Automation: Built network inventory and monitoring solution with .NET 3.0. Using WMI, ADSI, SNMP and other network management tools for display in a SharePoint portal server using ASP.NET and a SQL 2005 backend.
  • Automated data loading processes into data warehouses with trillions of records.
  • Trimmed data load times from 7+ hours to less than 10 minutes.
  • Advised senior management on Enterprise Application Integration Architecture

The Software Factory, Alpharetta, GA
Feb 2007 - July 2007 (Consultant)
Principal Consultant

  • SharePoint Portal Server development in .NET
  • WPF Development in C# 3.0
  • Windows Workflow Foundation (WF) development for a complex decision matrix
  • Grid based distributed Software Architecture in .NET (Provisional Patent)
  • MS SQL Server 2005 Data Architecture, Data Modeling, Stored Procedure Design
  • Continuous Integration, MS Build Automation, Unit Testing, Code Generation

Microsoft Corporation - Contractor (Direct), Redmond, WA
July 2006
Subject Matter Expert (SME) / Contributing Author

  • Contributing author for a .NET 2.0 related project
  • Microsoft Learning
  • Windows Mobile 6 Application Development

Microsoft Corporation - Contractor (Direct), Redmond, WA
December 2005 - January 2006
Lead Author

  • Lead Author for a .NET 2.0 related project
  • Windows Forms & ASP.NET 2.0
  • Distributed Application / Enterprise Application Development

RealTime Gaming, Atlanta, GA
2005 - 2007
Software Engineer

  • Converted legacy systems from ASP 3.0 to .NET 2.0
  • Architected and Coded a web portal with 43 unique pluggable web part displaying real time financials.
  • Assisted conversion from SQL Server 2000 to SQL Server 2005.
  • Pioneering advanced caching techniques for high traffic transaction systems.

Digital Evolution (SOA), Alpharetta, GA
2004 - 2005
Senior Software Architect

  • Assisted optimizations of SQL Server 2000 database that handles over 11 million rows per day.
  • Polished and bug fixed a .NET 1.1 application that runs on a headless web service proxy appliance.

Shop ‘n Check (Chek) International, Norcross, GA
2005
Senior Software Architect

  • Developed modules with .NET 2.0 to integrate into archaic application.
  • Re-Architected a componentized survey application.
  • Coded an online web-based image upload and manipulation application.  Provided advanced cropping and rotation functionality to novice web users.

Scientific Games International, Alpharetta, GA
2003 - 2004
Senior Software Architect

  • Author and Architect of a Lottery transaction, inventory and financials management system.
  • Authored code generation scripts that produced > 750,000 lines of code that represented 98% of the data layer. If schema changes were made during the project we simply regenerated our data layer to account for the schema changes without breaking object code.
  • First of its kind technology leap in the Lottery industry. Technology touted as the latest and greatest software achievement for our customer, reported by our customer.
    Six-Nines uptime hardware architecture featuring a Web Application Farm, a Web service Farm, and redundant SQL Server Cluster’s using MSCS.
  • Architected a ground up object based application development interface for rapid redeployment and redesign. Fully documented object model using MSDN style API documentation.

MCI WorldCom, Atlanta, GA
1998 - 2003
Enterprise Architect

  • Designed and single-handedly built a software deployment application using pre-web services technology and ASP 3.0 (SQL Server, Active Directory, ADO, ASP 3.0, VB5&6). System replaced Microsoft SMS server in the enterprise and deploys software to 230,000+ machines and mission critical servers globally.
  • Built web based software license enforcement application that managed all software licensing across 230,000+ computers world-wide.
  • Maintained and managed employee database of active and terminated employees for all of domestic WorldCom ~ 500,000 records. Database automatically recalculated employee lineage and organizational hierarchy using DTS jobs that ran at night.

Previous employment history is available upon request.

Mastered Development Technologies

Languages
C# 1.0 - 4.0, VB 4 - 6, VB.NET 1.0 - 3.0, C, C++, JAVA, X++ (Dynamics Ax 2009), Javascript, VB Script, T-SQL, Objective-C

Technologies
XAML, XML, HTML, Silverlight 1.0 - 4.0, WPF, WCF, WebServices, SOAP, WinForms, ASP.NET, XCode / iOS (iPhone, iTouch, iPad), Dynamics AX 2009

Development Tools
Visual Studio (All - 2010), Team Foundation Server (2005, 2008, 2010), Subversion, CVS, SQL Server Management Studio, SoapUI, Microsoft Expression Blend (3.0 - 4.0), Adobe PhotoShop, Adobe Illustrator

SDLC and Patterns
Agile, Waterfall, Model View Controller (MVC), Model View ViewModel (MVVM)



iTouch Dynamics Ax 2009 inventory management application

clock May 10, 2011 13:39 by author dsandor

Business Problem

Mobile laser scanning applications for Microsoft Dynamics Ax 2009 are complicated, over-engineered, and down right ugly.  Many applications exist and are very configurable but provide a very poor user experience which in turn slows down the end user and makes the data gathering more error prone.

Solution

After evaluating several tools to provide Cycle Count, Purchase Order Receiving, Inventory Transfers, and Miscellaneous Receiving we decided it would be best to take a 37signals approach to Get Real with our application.  We provided our warehouse team a set of tools that allowed them to accomplish their job in a simple and user friendly manner.  In addition, we minimized our cost per mobile barcode scanner.  By using a $200 iTouch as the brains and a $499 Linea Laser Barcode cradle we dropped our $3,000 mobile scanning hardware to $699.

The user interface is built using Novell’s MonoTouch and is written in C#.  The XCode tools were also used for some screen layout.  No Objective-C was used on this project.  The iTouch applications make WCF calls to interact with Dynamics Ax 2009.  The WCF Services are written in C# 4.0 and employ the .NET Business Connector to interact with the ERP system’s data.  An Ax project that uses X++, Forms, Classes, and Schema Additions is used to provide a succinct API to the WCF Services.

Screenshot 2011.02.01 17.02.54
PO Search Screen

Screenshot 2011.02.01 17.02.46
PO Details Screen



RFID Client for Spares Management

clock May 10, 2011 11:01 by author dsandor

Business Problem

Large companies have lots of facilities which need spare part inventory on hand.  Facility operators may not reorder parts in a timely fashion which can lead to a local shortage of equipment.  Some facilities may hoard equipment creating a local surplus of equipment.  Both extremes are costly to a company.

Solution

Provide a simple to use touch screen computer that detects when a part is leaving or entering the spare parts room.  Upon detection of the part the touch screen computer displays a ‘tag’ with information about the part.  The facility user can touch the tag on the screen and note the use of the part.  When parts come in for replenishment the facility user can notate the put away location of the part.  When are part is used inventory levels at MDSi are updated.  If the minimum stocking level is reached a reorder is automatically generated and shipped to the facility to keep the stocking level true.

Components

RFID Client (Touch screen workstation)
This is the device with which the facility users interact.

image

The client is built with Microsoft .NET Framework 4.0 and uses Windows Presentation Foundation (WPF) to present the UX.  The client leverages the Model-View-ViewModel (MVVM) architectural pattern and is written in C#.  Communication to the home office is provided via WCF services.

image

RFID Tags are read via a Motorola XR-450 tag reader.  This reader was selected because it has a built in Windows CE operating system that allows us to write Mobile Embedded .NET applications to interact with the reader and with our WCF Services.  The RFID Client Workstation has a Windows Service written in C# and .NET 4.0 which continually polls the XR-450 reader for new tags.  The service exposes a .NET Remoting service which is consumed locally by the client UI.  Multicast events are thrown and the client system can respond to new tags accordingly.


RFID WCF Services
All RFID Clients communicate to a set of centralized web servers in an NLB farm.  The WCF Services provide a data exchange layer which provides caching by leveraging the AppFabric Cache feature of Windows Server 2008 R2.  Data is stored in a SQL 2008 R2 Cluster and the data is organized through Microsoft Dynamics AX 2009.  X++ and Business Connector code was created to interface through the ERP system and pass through all of the business rules configured in the Dyanmics Ax system.  In addition to using the .NET Business Connector and custom Dynamics Ax projects to manage the data, ADO.NET, Linq and C# is used in the creation of these services.

RFID Management Display
A Network Operation Center (NOC) application was created to provide real-time node (RFID Touch Screen Client) availability data.  This data is organized on a map and allows an operator to drill in to a workstation and remotely manage the system.

image

RFID Warehouse Printing
Tools were created to interface with the Microsoft Dynamics Ax 2009 ERP system which allow a warehouse employee to print RFID labels for items being shipped out for replenishment.  This system interfaces with the Zebra RZ 400 RFID Printer.  This application was created using WPF, WCF, MVVM.

image

RFID On-Site Inventory and Auditing Tool
This application allows a warehouse specialist to audit a sparing facility.  This application is written using WPF and .NET 4.0.  The application consumes the same WCF services provided for the RFID Client to connect to the ERP system.  The application allows a specialist to print labels via a wireless Zebra RP4T RFID Label printer.  Using this application a project coordinator can determine what inventory is needed on site and what can be returned for general usage to the Distribution Center (DC).  This allows for a quick and efficient auditing process.  The warehouse specialist does not need to know anything about the product, just scan the serial number and the application tells the specialist the disposition of the part based on the Min/Max settings in the ERP system.

image

RFID Node Creation Tool
The Node Creation Tool allows a support engineer to provision a remote RFID Touch Screen Client from a central location.  A support engineer can provision all of the standard configuration settings for Development, Test, and Production from the single tool.  This application was created with WPF, C#, WCF, MVVM.

image

RFID Online Spares Management Web Application
A Silverlight application was created to provide scaled down functionality for locations that do not have the RFID Touch Screen client installed.  Some locations need the ability to consume, count and audit their inventory without an RFID client.  In this case a laser barcode scanner is used to scan the RFID barcode.  This application was written in Silverlight 4.0, uses WCF Services, and employs the MVVM architectural pattern.

image



Enable .config file build configuration transformations in non-web based applications.

clock April 28, 2011 11:05 by author dsandor

So Web Application projects have this great new feature that allows you to use an XML Transform file to merge settings into your Web.Config file based on the build configuration.  For example, if you have a Release build configuration you might want your connectionString section to point to a production server instead of your development server.  See this link for more information on Web Config Transforms.

This is a really cool feature and it is possible to use this with non-web application projects.  You can configure your project file to support this very easily.  You do need to insert some XML into your csproj file but it is really lightweight.

First, Add an App.config file to your project if you do not already have one.

Next, close Visual Studio and open your *.csproj file in notepad.

Go to the very end of the file and insert the UsingTask and Target sections directly above the </Project> closing tag. 

  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
       Other similar extension points exist, see Microsoft.Common.targets.
  <Target Name="BeforeBuild">
  </Target>
  <Target Name="AfterBuild">
  </Target>
  -->
    <UsingTask TaskName="TransformXml" AssemblyFile="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.Tasks.dll" />
  <Target Name="AfterCompile" Condition="exists('app.$(Configuration).config')">
    <!-- Generate transformed app config in the intermediate directory -->
    <TransformXml Source="app.config" Destination="$(IntermediateOutputPath)$(TargetFileName).config" Transform="app.$(Configuration).config" />
    <!-- Force build process to use the transformed configuration file from now on. -->
    <ItemGroup>
      <AppConfigWithTargetPath Remove="app.config" />
      <AppConfigWithTargetPath Include="$(IntermediateOutputPath)$(TargetFileName).config">
        <TargetPath>$(TargetFileName).config</TargetPath>
      </AppConfigWithTargetPath>
    </ItemGroup>
  </Target>
</Project>

 

Now find the section that has your App.config file include.  It will likely be in a <None /> tag.  Replace that tag with the following code. (Include a App.CONFIGURATION.config file for each build configuration you use.

    <Content Include="App.config">
      <SubType>Designer</SubType>
    </Content>
    <Content Include="App.Test.config">
      <DependentUpon>App.config</DependentUpon>
    </Content>
    <Content Include="App.Release.config">
      <DependentUpon>App.config</DependentUpon>
    </Content>

Save your csproj file and open it up in Visual Studio again.

image

Now when you build your solution/project the XML Transforms in your App.CONFIGURATION.config file will be merged at build time.



Left-click context menu for WPF

clock April 28, 2011 08:52 by author dsandor

I had to build a small configuration screen for an over-the-internet printing solution for Microsoft Dynamics Ax.  The application has an image that I want the user to click with either the left or right mouse button to open the context menu.  This menu allows the user to start or stop the print engine service.

image

Left or right clicking opens the context menu.

image

Here is the XAML for the Image with Context Menu.

<Image Source="/WarehouseManagement.Service.PrintEngineUI;component/Images/service.png" Height="24" Margin="6,0,0,0"
       Name="ibtnServiceController" MouseLeftButtonUp="ibtnServiceController_MouseLeftButtonUp">
    <Image.ContextMenu>
        <ContextMenu Name="cmServiceController">
            <MenuItem Header="Start" Name="miStart" Click="miStart_Click" />
            <MenuItem Header="Stop" Name="miStop" Click="miStop_Click" />
        </ContextMenu>
    </Image.ContextMenu>
</Image>

Note: MVVM Commanding is not used here for simplicity of this post.
In this XAML snippet I named the Image and consumed the MouseLeftButtonUp event on the Image.  I also added the context menu to the Image control and named the ContextMenu.

The code behind looks like this:

private void ibtnServiceController_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
{
    cmServiceController.PlacementTarget = (UIElement)sender;
    cmServiceController.IsOpen = true;
}

In this code, PlacementTarget indicates the UIElement that the context menu will pop out from.  In this case we just use the Image element itself as passed in to the event handler via the sender argument.

Next, you simply set IsOpen to true and the context menu will be displayed over the PlacementTarget.



Asynchronous Programming for C# / Visual Studio Async CTP

clock October 29, 2010 18:15 by author dsandor

Download and more reference material here:

http://msdn.microsoft.com/en-us/vstudio/async.aspx

Great crash course article from Alexandra Rusina here:

http://blogs.msdn.com/b/csharpfaq/archive/2010/10/28/async.aspx

Executive summary:

Basically you get two new powerful C# language keywords, await and async.  Instead of having to write callback methods for multithreaded code, you can now decorate a method signature with async and call the method with await. You write the code as if it were a synchronous block of code and let the runtime perform the heavy lifting.  Very cool and really streamlined.  I wonder what debugging will look like. 



FIX: Motorola Droid X and Android 2.2 Exchange PIN code lock.

clock September 23, 2010 02:32 by author dsandor

This is not my fix, but it works and I added pretty pictures :D

Original Solution Thread

Step 1: Login to Outlook Web Client and click Options.

owa-options

 

Step 2: Click Mobile Devices on the left menu.

owa-mobile1

Step 3: Choose your phone in the list on the right by clicking it and then click the Remove Device from List link.

owa-mobile2

This process was non-destructive and worked like a champ.  I could not get in to the options that were disabled by remote administrator and my phone still syncs with exchange.



Two MVVM snippets I use a lot: ViewModelBase and ModelBase

clock September 5, 2010 18:03 by author dsandor

I use these two snippets a lot for WPF and Silverlight development.  I decided to post them on the blog so that I have them available to me whenever and wherever.  I always seem to be searching through older projects for this code.

vmb

This snippet creates the ViewModelBase that I use almost everywhere.  It simply implements INotifyPropertyChanged and works in both WPF and Silverlight.  I use this for my ViewModels so that the properties on the VM are observable for databinding.  I use this in conjunction with my propsn snippet that creates a property with SafeNotify calls in the setter.

mb

This snippet is used to create the ModelBase.  Again, this is a WPF / Silverlight compatible class.  I link my model such that it compiles for WPF and Silverlight so that I can share my model between my WCF and my UI.  This class gives me INotifyPropertyChanged, SafeNotify, and a ToString implementation that uses reflection to dump a shallow representation of the class.

Hope this code helps someone.



Make Visual Studio 2010 even better with Productivity Tools

clock August 7, 2010 06:38 by author dsandor

If you have not installed the latest version of the Visual Studio Productivity Power Tools (The LATEST release that is), you are missing out on some killer functionality.

Download them here:
http://visualstudiogallery.msdn.microsoft.com/en-us/d0d33361-18e2-46c0-8ff2-4adea1e34fef

There is now a Solution Navigator:

image

Advanced object information when hovering over an object or method with your cursor:

image

image

image

Cool new color coded gradient backed tabs:

image

Pinning of tabs is still supported:

image

 

Check out more info on the Visual Studio Blog
http://blogs.msdn.com/b/visualstudio/archive/2010/07/20/solution-navigator-blog-post.aspx

Download the latest version of the Productivity Power Tools
http://visualstudiogallery.msdn.microsoft.com/en-us/d0d33361-18e2-46c0-8ff2-4adea1e34fef



Upgraded certification: MCPD – Windows 4 & Web 4

clock July 24, 2010 19:08 by author dsandor

So I took all my .NET 4.0 exams:

70-515 TS: Microsoft .NET Framework 4, Web Applications Development

70-519 Pro: Designing and Developing Web Applications Using Microsoft .NET Framework 4.0

70-518 Pro: Designing and Developing Windows Applications Using Microsoft .NET Framework 4.0

70-516 TS: Microsoft .NET Framework 4, Accessing Data with ADO.NET

70-513 TS: Microsoft .NET Framework 4, Windows Communication Foundation Development

70-511 TS: Microsoft .NET Framework 4, Windows Applications Development

This added the following certifications to my transcript:

MCPD(rgb)_1371_1372

MCTS(rgb)_1269_1374_1369_1373_514



70-515: TS Web Applications Development with Microsoft .NET Framework 4 (PASSED)

clock July 21, 2010 22:16 by author dsandor

So when I signed up for my week of testing to take all the .NET 4 Beta exams the 70-515 was booked solid.  Apparently you web dudes out there ate it up.  So I had to wait for it to go to production in order to take it.  Shelled out my $125 and passed it.

That makes 6 for 6 and a full house of .NET 4 Certs. 

MCPD: Web 4

MCPD: Windows 4

(If they bring back Enterprise)

MCPD: Enterprise 4



Solved: Objects are not fully deserializing when using DataContractSerializer in Silverlight.

clock July 7, 2010 02:53 by author dsandor

http://msdn.microsoft.com/en-us/library/system.runtime.serialization.datacontractserializer_members.aspx

So as it turns out, your XML stream must have the XML Nodes in Alphabetical Order when trying to deserialize XML data into an object.  Very wierd.



Silverlight Hover Button – XAML Style implementation with code that is dynamic and skinnable.

clock July 6, 2010 04:52 by author dsandor

So I needed to create a hover button.  The idea is that when the mouse rolls over the button the image will flip between a normal and ‘over’ version of the button image.  This is the same thing as old school image rollover code we have all used before.  There is an image that you use for a button in the ‘normal’ or ‘off’ state and when the mouse rolls over the image the picture changes to the ‘over’ or ‘on’ state.

It is pretty easy to do this statically.  Edit the button style, slap a couple of images in the ControlTemplate and tie that to the Normal and MouseOver visual states and you are done.

But what if you want to be able to use that same style for all your buttons and you want to be able to databind the Normal and MouseOver images?

This was pretty easy with a trick here or there.

First, we need to create a HoverButton class that inherits from the standard Button.  We need to do this because we need 2 new properties for our Normal and Over image url’s.

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;
 
namespace MySLApplication.Local
{
    public class HoverButton : Button
    {
 
 
        public string NormalImageUrl
        {
            get { return (string)GetValue(NormalImageUrlProperty); }
            set { SetValue(NormalImageUrlProperty, value); }
        }
 
        public static readonly DependencyProperty NormalImageUrlProperty =
            DependencyProperty.Register("NormalImageUrl", typeof(string), typeof(HoverButton), 
            new PropertyMetadata(""));
 
 
 
        public string MouseOverImageUrl
        {
            get { return (string)GetValue(MouseOverImageUrlProperty); }
            set { SetValue(MouseOverImageUrlProperty, value); }
        }
 
        public static readonly DependencyProperty MouseOverImageUrlProperty =
            DependencyProperty.Register("MouseOverImageUrl", typeof(string), typeof(HoverButton), 
            new PropertyMetadata(""));
 
 
 
    }
}

This is the button you will place on your design surface instead of the regular button.  This one gives us NormalImageUrl and the MouseOverImageUrl.  These properties we will set to the URL for the images we want to use for our normal state and mouse over state.

Next is the Style (see the zip file at the bottom of this post for the actual code).  Since the Style is so big, I will describe the important pieces to you.

First, your XAML that contains this style code needs to have a namespace reference to the HoverButton’s namespace.  I named mine local so you will see my TargetType set to local:HoverButton.

xmlns:local="clr-namespace:MySLApplication.Local"

So the style starts out like this:

<Style x:Key="HoverButtonStyle" TargetType="local:HoverButton">
            <Setter Property="Background" Value="#FF1F3B53"/>
            <Setter Property="Foreground" Value="#FF000000"/>
            <Setter Property="Padding" Value="3"/>
            <Setter Property="BorderThickness" Value="0"/>
            <Setter Property="Height" Value="36" />
            <Setter Property="Width" Value="118" />
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="local:HoverButton">
                        <Grid>
                            <VisualStateManager.VisualStateGroups>
                                <VisualStateGroup x:Name="CommonStates">

Note the TargetType in both instances is pointed to the local namespace and the HoverButton class name.  The real magic occurs in the ControlTemplate portion of the code.  Here there are several Visual States defined.  We are concered with two of them (feel free to extend this to the others also): Normal and MouseOver.

You will notice in each of the two Visual States we are concerned with there is a storyboard.  The StroryBoard executes when the visual state is entered.  So for example, when the button starts out it is in the Normal state.  When the control is rendered the Normal visual state causes the storyboard defined here to execute:

 

<VisualState x:Name="Normal">
    <Storyboard>
        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" 
        Storyboard.TargetName="OverImage">
            <DiscreteObjectKeyFrame KeyTime="0">
                <DiscreteObjectKeyFrame.Value>
                    <Visibility>Collapsed</Visibility>
                </DiscreteObjectKeyFrame.Value>
            </DiscreteObjectKeyFrame>
        </ObjectAnimationUsingKeyFrames>
        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" 
        Storyboard.TargetName="NormalImage">
            <DiscreteObjectKeyFrame KeyTime="0">
                <DiscreteObjectKeyFrame.Value>
                    <Visibility>Visible</Visibility>
                </DiscreteObjectKeyFrame.Value>
            </DiscreteObjectKeyFrame>
        </ObjectAnimationUsingKeyFrames>
    </Storyboard>
</VisualState>

What happens here is that the StoryBoard sets the OverImage’s Visibility property to Collapsed and the NormalImage’s Visibility property to Visible. 

Before confusion sets in, scroll down to the bottom of the style.  You will see the two images we just discussed.

<ContentPresenter x:Name="contentPresenter" ContentTemplate="{TemplateBinding ContentTemplate}" 
   Content="{TemplateBinding Content}" 
   HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" 
   Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
<Image x:Name="NormalImage" DataContext="{TemplateBinding NormalImageUrl}" Source="{Binding}" />
<Image x:Name="OverImage" DataContext="{TemplateBinding MouseOverImageUrl}" Source="{Binding}" />

The two images defined inside the button’s visual surface are the actual images you will see at runtime.  Notice that we had to set the DataContext of the Image control to the property NormalImageUrl and MouseOverImageUrl and THEN set the Source property to {Binding}.  You need this little trick in order to allow databinding to convert the string based URL to an ImageSource.

So now we are good to go.  We can use our HoverButton like this:

<local:HoverButton Content="" Height="36" HorizontalAlignment="Left" 
    Margin="508,558,0,0" x:Name="btnSpin" VerticalAlignment="Top" Width="118" 
    Click="btnSpin_Click" Style="{StaticResource HoverButtonStyle}"
    NormalImageUrl="http://yourdomain.com/Normal.png"
    MouseOverImageUrl="http://yourdomain.com/Over.png"/>

So now you can specify the Normal and MouseOver images for your button.  The same style can be used for all these hover buttons, just specify the 2 images and you are set. 

 

Download File - HoverButtonSource

 

 

 

 

 

 



About the author

David Sandor is a Software Architect working in Chicago, IL.  My development focuses around the Microsoft Stack including Azure, AppFabric, Silverlight, WPF, .NET Framework, and various mobile devices including iOS (iPhone/iTouch), Android, Windows Mobile and Windows Phone 7.

Month List

Sign in