Custom Class Generator (CCG)

MES c# code generator

An useful Visual Studio .NET 2008 addin help you to write huge lines of code. With this addin Mdf create for you SQL Server tables and c# code. You have to configurate your custom class:

  • Equipments
  • Materials
  • Material lots
  • Material sublots
  • Handling units
  • Personnel
  • Orders and order items (not ISA 95)

and the CCG create for you the storage layer on SQL server and a business entities layer on VS.NET 2008.

In example you have the Tank equipment class with the Volume property. After you run the CCG you can write some code like this:

1public decimal GetTankHalfVolume(string tankID)
2{
3    // Create tank business entity loading tank data
4    Tank tank = new Tank(tankID);
5    
6    // Return tank volume
7    return tank.Volume * 0.5;
8}
9
10public void SetTankVolume(string tankID)
11{
12    // Ask the measure to PLC
13    decimal measure = ...;
14    
15    // Convert measure to volume
16    decimal volume = measure * ...;
17    
18    // Create tank business entity loading tank data
19    Tank tank = new Tank(tankID);
20
21    // Set tank volume
22    tank.Volume = volume;
23    
24    // Save value
25    tank.Save();
26}

Using partial class

CCG create a c# partial class so you can create in your own file your class extension. In example you can add some Tank methods to increase and decrease the volume adding some business rule like alarm on threshold.