Mdf methods
Adding material definitions
In this step we will add some material definition.
In our demo the ULP material and LRP material have an int property: Octane
The ISA-95 model has Material Classes and Material Definitions. We suppose that
"91 Octane Unleaded Petrol" is a Material Definition (a row of the material
master).
1private void addMaterials()
2{
3 Ulp.Add("U91", "91 Octane Unleaded Petrol", 91);
4 Ulp.Add("U93", "93 Octane Unleaded Petrol", 93);
5 Ulp.Add("U95", "95 Octane Unleaded Petrol", 95);
6
7 Lrp.Add("L93", "93 Octane Petrol", 93);
8 Lrp.Add("L87", "87 Octane Petrol", 87);
9 Lrp.Add("L97", "97 Octane Petrol", 97);
10}
Other standard methods
All Mdf business entites classes have a lot of standard methods. In example Count,
Compute and Exist:
1private void callSomeMethods()
2{
3 if (!Ulp.Exist("U91"))
4 {
5 Ulp.Add("U91", "91 Octane Unleaded Petrol", 91);
6 }
7
8 int count = UlpLot.Count("MaterialDefinitionID = 'U91'");
9
10 if (count > 100)
11 {
12 doSomeAction();
13 }
14}
All methods are integrated with SQL Server 2005/2008 to speed up the system performance
and limitate the data flow between storage layer and business layer.