/* NOTE: Any changes you make to this CFC will be written over if you regenerate the application.*/
component persistent="true"{
property name="id" ormtype="integer" type="numeric" fieldtype="id" generator="native";
property name="fieldname" type="string";
property name="cropID" ormtype="integer" type="numeric";
property name="year" ormtype="integer" type="numeric";
property name="expectedYield" type="string";
property name="requiredN" type="string";
property name="requiredP" type="string";
property name="RequiredK" type="string";
property name="UreaMT" type="string";
property name="PotashMT" type="string";
property name="MapMT" type="string";
property name="UreaLB" type="string";
property name="potashLB" type="string";
property name="MapLB" type="string";
property name="FertCost" type="string";
property name="SeedCost" type="string";
property name="HerbicideCost" type="string";
property name="DryingCost" type="string";
property name="OtherCost" type="string";
property name="cropprice" type="string";
property name="BranchID" ormtype="integer" type="numeric";
property name="acres" type="string";
property name="growerName" type="string";
/**
* @hint A initialization routine, runs when object is created.
*/
remote userdata function init() {
return This;
}
/**
* @hint Nullifies blank or zero id's. Useful for dealing with objects coming back from remoting.
*/
public void function nullifyZeroID() {
if (getid() eq 0 OR getid() eq ""){
setid(JavaCast("Null", ""));
}
}
/**
* @hint Populates the content of the object from a form structure.
*/
public userdata function populate(required struct formStruct ) {
if (StructKeyExists(arguments.formstruct, "id") AND arguments.formstruct.id gt 0){
var item = EntityLoad("userdata", arguments.formstruct.id, true);
if (not isNull(item)){
This = item;
}
else{
This.setid(arguments.formstruct.id);
}
}
if (StructKeyExists(arguments.formstruct, "fieldname")){
This.setfieldname(arguments.formstruct.fieldname);
}
if (StructKeyExists(arguments.formstruct, "cropID")){
This.setcropID(arguments.formstruct.cropID);
}
if (StructKeyExists(arguments.formstruct, "year")){
This.setyear(arguments.formstruct.year);
}
if (StructKeyExists(arguments.formstruct, "expectedYield")){
This.setexpectedYield(arguments.formstruct.expectedYield);
}
if (StructKeyExists(arguments.formstruct, "requiredN")){
This.setrequiredN(arguments.formstruct.requiredN);
}
if (StructKeyExists(arguments.formstruct, "requiredP")){
This.setrequiredP(arguments.formstruct.requiredP);
}
if (StructKeyExists(arguments.formstruct, "RequiredK")){
This.setRequiredK(arguments.formstruct.RequiredK);
}
if (StructKeyExists(arguments.formstruct, "UreaMT")){
This.setUreaMT(arguments.formstruct.UreaMT);
}
if (StructKeyExists(arguments.formstruct, "PotashMT")){
This.setPotashMT(arguments.formstruct.PotashMT);
}
if (StructKeyExists(arguments.formstruct, "MapMT")){
This.setMapMT(arguments.formstruct.MapMT);
}
if (StructKeyExists(arguments.formstruct, "UreaLB")){
This.setUreaLB(arguments.formstruct.UreaLB);
}
if (StructKeyExists(arguments.formstruct, "potashLB")){
This.setpotashLB(arguments.formstruct.potashLB);
}
if (StructKeyExists(arguments.formstruct, "MapLB")){
This.setMapLB(arguments.formstruct.MapLB);
}
if (StructKeyExists(arguments.formstruct, "FertCost")){
This.setFertCost(arguments.formstruct.FertCost);
}
if (StructKeyExists(arguments.formstruct, "SeedCost")){
This.setSeedCost(arguments.formstruct.SeedCost);
}
if (StructKeyExists(arguments.formstruct, "HerbicideCost")){
This.setHerbicideCost(arguments.formstruct.HerbicideCost);
}
if (StructKeyExists(arguments.formstruct, "DryingCost")){
This.setDryingCost(arguments.formstruct.DryingCost);
}
if (StructKeyExists(arguments.formstruct, "OtherCost")){
This.setOtherCost(arguments.formstruct.OtherCost);
}
if (StructKeyExists(arguments.formstruct, "CropPrice")){
This.setCropPrice(arguments.formstruct.CropPrice);
}
if (StructKeyExists(arguments.formstruct, "BranchID")){
This.setBranchID(arguments.formstruct.BranchID);
}
if (StructKeyExists(arguments.formstruct, "acres")){
This.setacres(arguments.formstruct.acres);
}
if (StructKeyExists(arguments.formstruct, "growerName")){
This.setgrowerName(arguments.formstruct.growerName);
}
return This;
}
}