Difference between revisions of "Quota class"

From Catglobe Wiki
Jump to: navigation, search
(Created page with "{{CGscriptClass_Template |Name=<nowiki>Quota</nowiki> |Description=<nowiki>The questionnaire's quota object.</nowiki> |InheritsFrom=object|Constructors= {{CGscriptConstructors...")
 
 
Line 29: Line 29:
 
{{CGscriptProperties_Template|ReturnType=TypeInformation|Name=<nowiki>TypeInformation</nowiki>|HasGetter=1|Inherited=object|Description=<nowiki>Get information about this class.</nowiki>}}
 
{{CGscriptProperties_Template|ReturnType=TypeInformation|Name=<nowiki>TypeInformation</nowiki>|HasGetter=1|Inherited=object|Description=<nowiki>Get information about this class.</nowiki>}}
 
}}
 
}}
 +
=== <span style="color:#DF8621">'''Examples'''</span> ===
 +
<source lang="javascript">
 +
//create quota for qnaire
 +
Questionnaire qnaire = new Questionnaire (17148177);
 +
Quota quota = new Quota ("Male", qnaire);
 +
quota.Target = 100;
 +
quota.Expression = "Gender == 1";
 +
quota.Description = "xxxxx";
 +
quota.Save();
 +
</source>

Latest revision as of 11:27, 11 May 2022

Quota



The questionnaire's quota object.

Parent class

Inherits from object

Constructors

  • (int id "Quota resource id") - Fetch exists quota
  • (string name "Quota's name", Questionnaire questionnaire "The questionnaire contains this quota") - Create and add new quota to questionnaire object

Methods

  • Empty Save() - Save quota
  • (From object) string ToString() - The string representation of the object.

Properties

  • int Current { get; } - Gets the number of completed resource project questionnaires in the quota
  • string Description { get; set; } - Quota description
  • bool Disabled { get; set; } - Quota disabled or not
  • string Expression { get; set; } - Quota expression
  • int Id { get; } - Quota resource id
  • string Name { get; set; } - Quota name
  • string ObjectTypeName { get; } - The name of the type of object.
  • int OnGoing { get; } - Gets the number of on going resource project questionnaires in the quota
  • int OutsideTarget { get; } - Gets the number of outside target resource project questionnaires in the quota
  • bool PreStratification { get; set; } - Quota pre-stratification
  • int QuestionnaireId { get; } - Resource id of questionnaire belong to
  • int QuotaFull { get; } - Gets the number of quota full resource project questionnaires in the quota
  • int Target { get; set; } - Quota target
  • bool TargetReached { get; } - Gets information about whether or not the target for this quota has been reached
  • (From object) TypeInformation TypeInformation { get; } - Get information about this class.

Examples

	
//create quota for qnaire
Questionnaire qnaire = new Questionnaire (17148177);
Quota quota = new Quota ("Male", qnaire);
quota.Target = 100;
quota.Expression = "Gender == 1";
quota.Description = "xxxxx";
quota.Save();