Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. /* NOTE: Any changes you make to this CFC will be written over if you regenerate the application.*/
  2. component persistent="true"{
  3.  
  4.     property name="id" ormtype="integer" type="numeric" fieldtype="id" generator="native";
  5.     property name="fieldname" type="string";
  6.     property name="cropID" ormtype="integer" type="numeric";
  7.     property name="year" ormtype="integer" type="numeric";
  8.     property name="expectedYield" type="string";
  9.     property name="requiredN" type="string";
  10.     property name="requiredP" type="string";
  11.     property name="RequiredK" type="string";
  12.     property name="UreaMT" type="string";
  13.     property name="PotashMT" type="string";
  14.     property name="MapMT" type="string";
  15.     property name="UreaLB" type="string";
  16.     property name="potashLB" type="string";
  17.     property name="MapLB" type="string";
  18.     property name="FertCost" type="string";
  19.     property name="SeedCost" type="string";
  20.     property name="HerbicideCost" type="string";
  21.     property name="DryingCost" type="string";
  22.     property name="OtherCost" type="string";
  23.     property name="cropprice" type="string";
  24.     property name="BranchID" ormtype="integer" type="numeric";
  25.     property name="acres" type="string";
  26.     property name="growerName" type="string";
  27.  
  28.     /**
  29.     * @hint A initialization routine, runs when object is created.
  30.     */
  31.     remote userdata function init() {
  32.         return This;
  33.     }
  34.  
  35.     /**
  36.     * @hint Nullifies blank or zero id's.  Useful for dealing with objects coming back from remoting.
  37.     */
  38.     public void function nullifyZeroID() {
  39.         if (getid() eq 0 OR getid() eq ""){
  40.             setid(JavaCast("Null", ""));
  41.         }
  42.     }
  43.  
  44.     /**
  45.     * @hint Populates the content of the object from a form structure.
  46.     */
  47.     public userdata function populate(required struct formStruct ) {
  48.         if (StructKeyExists(arguments.formstruct, "id") AND arguments.formstruct.id gt 0){
  49.  
  50.             var item = EntityLoad("userdata", arguments.formstruct.id, true);
  51.  
  52.             if (not isNull(item)){
  53.                 This = item;
  54.             }
  55.             else{
  56.                 This.setid(arguments.formstruct.id);
  57.             }
  58.         }
  59.  
  60.         if (StructKeyExists(arguments.formstruct, "fieldname")){
  61.             This.setfieldname(arguments.formstruct.fieldname);
  62.         }
  63.  
  64.         if (StructKeyExists(arguments.formstruct, "cropID")){
  65.             This.setcropID(arguments.formstruct.cropID);
  66.         }
  67.  
  68.         if (StructKeyExists(arguments.formstruct, "year")){
  69.             This.setyear(arguments.formstruct.year);
  70.         }
  71.  
  72.         if (StructKeyExists(arguments.formstruct, "expectedYield")){
  73.             This.setexpectedYield(arguments.formstruct.expectedYield);
  74.         }
  75.  
  76.         if (StructKeyExists(arguments.formstruct, "requiredN")){
  77.             This.setrequiredN(arguments.formstruct.requiredN);
  78.         }
  79.  
  80.         if (StructKeyExists(arguments.formstruct, "requiredP")){
  81.             This.setrequiredP(arguments.formstruct.requiredP);
  82.         }
  83.  
  84.         if (StructKeyExists(arguments.formstruct, "RequiredK")){
  85.             This.setRequiredK(arguments.formstruct.RequiredK);
  86.         }
  87.  
  88.         if (StructKeyExists(arguments.formstruct, "UreaMT")){
  89.             This.setUreaMT(arguments.formstruct.UreaMT);
  90.         }
  91.  
  92.         if (StructKeyExists(arguments.formstruct, "PotashMT")){
  93.             This.setPotashMT(arguments.formstruct.PotashMT);
  94.         }
  95.  
  96.         if (StructKeyExists(arguments.formstruct, "MapMT")){
  97.             This.setMapMT(arguments.formstruct.MapMT);
  98.         }
  99.  
  100.         if (StructKeyExists(arguments.formstruct, "UreaLB")){
  101.             This.setUreaLB(arguments.formstruct.UreaLB);
  102.         }
  103.  
  104.         if (StructKeyExists(arguments.formstruct, "potashLB")){
  105.             This.setpotashLB(arguments.formstruct.potashLB);
  106.         }
  107.  
  108.         if (StructKeyExists(arguments.formstruct, "MapLB")){
  109.             This.setMapLB(arguments.formstruct.MapLB);
  110.         }
  111.  
  112.         if (StructKeyExists(arguments.formstruct, "FertCost")){
  113.             This.setFertCost(arguments.formstruct.FertCost);
  114.         }
  115.  
  116.         if (StructKeyExists(arguments.formstruct, "SeedCost")){
  117.             This.setSeedCost(arguments.formstruct.SeedCost);
  118.         }
  119.  
  120.         if (StructKeyExists(arguments.formstruct, "HerbicideCost")){
  121.             This.setHerbicideCost(arguments.formstruct.HerbicideCost);
  122.         }
  123.  
  124.         if (StructKeyExists(arguments.formstruct, "DryingCost")){
  125.             This.setDryingCost(arguments.formstruct.DryingCost);
  126.         }
  127.  
  128.         if (StructKeyExists(arguments.formstruct, "OtherCost")){
  129.             This.setOtherCost(arguments.formstruct.OtherCost);
  130.         }
  131.  
  132.         if (StructKeyExists(arguments.formstruct, "CropPrice")){
  133.             This.setCropPrice(arguments.formstruct.CropPrice);
  134.         }
  135.  
  136.         if (StructKeyExists(arguments.formstruct, "BranchID")){
  137.             This.setBranchID(arguments.formstruct.BranchID);
  138.         }
  139.  
  140.         if (StructKeyExists(arguments.formstruct, "acres")){
  141.             This.setacres(arguments.formstruct.acres);
  142.         }
  143.  
  144.         if (StructKeyExists(arguments.formstruct, "growerName")){
  145.             This.setgrowerName(arguments.formstruct.growerName);
  146.         }
  147.  
  148.         return This;
  149.     }
  150. }
  151.