Quota class
From Catglobe Wiki
More actions
Quota
The questionnaire's quota object.
Parent class
Inherits from Array
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
- (string name "Name of the quota", int target "Target count for the quota", string expression "CGScript expression for the quota") - Create new quota in the current questionnaire context
- (string name "Name of the quota", int target "Target count for the quota", string expression "CGScript expression for the quota", int questionnaire resource id "The questionnaire resource id") - Create new quota in a specific questionnaire
Methods
Properties
- number Average { get; } - Average of the objects in the Array object. Can only use if all the elements are of type Number
- 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
- number Max { get; } - Largest of all the objects in the Array object. Can only use if all the elements are of type Number
- number Min { get; } - Smallest of all the objects in the Array object. Can only use if all the elements are of type Number
- 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
- number Sum { get; } - Sum of all the objects in the Array object. Can only use if all the elements are of type Number
- int Target { get; set; } - Quota target
- bool TargetReached { get; } - Gets information about whether or not the target for this quota has been reached
- TypeInformation TypeInformation { get; } - Get information about this class.
Static Methods
- Empty Quota_deleteAllQuotas() - Deletes all quotas from the current Questionnaire context
- Empty Quota_deleteAllQuotas(int? Quota questionnaire resource id "The questionnaire resource id") - Deletes all quotas from the specified Questionnaire
- Empty Quota_deleteQuota(string Quota name "Name of the quota") - Deletes the quota with the given name from the current Questionnaire context
- Empty Quota_deleteQuota(string Quota name "Name of the quota", int? Quota questionnaire resource id "The questionnaire resource id") - Deletes the quota with the given name from the specified Questionnaire
- Array of Quota Quota_getAllQuotas() - Returns all quotas for the current Questionnaire context
- Array of Quota Quota_getAllQuotas(int? Quota questionnaire resource id "The questionnaire resource id") - Returns all quotas for the specified Questionnaire
- Quota Quota_getQuotaByName(string Quota name "Name of the quota") - Returns the quota with the given name in the current Questionnaire context
- Quota Quota_getQuotaByName(string Quota name "Name of the quota", int? Quota questionnaire resource id "The questionnaire resource id") - Returns the quota with the given name in the specified Questionnaire
- Array of Quota Quota_getQuotasByNameLike(string Quota name "Name pattern to search for") - Returns quotas whose names contain the given string in the current Questionnaire context
- Array of Quota Quota_getQuotasByNameLike(string Quota name "Name pattern to search for", int? Quota questionnaire resource id "The questionnaire resource id") - Returns quotas whose names contain the given string in the specified Questionnaire
- Quota Quota_new(string Quota name "Name of the quota", int Quota target "Target count for the quota", string Quota expression "CGScript expression for the quota") - Creates a new quota object for the current questionnaire context
- Quota Quota_new(string Quota name "Name of the quota", int Quota target "Target count for the quota", string Quota expression "CGScript expression for the quota", int? Quota questionnaire resource id "The questionnaire resource id") - Creates a new quota object for the specified Questionnaire
- Empty Quota_save(Quota Quota "The quota to save") - Saves the quota object
- bool Quota_targetReached() - Returns true if any quota has reached its target
- bool Quota_targetReached(string Quota name "Name of the quota to check") - Returns true if the named quota has reached its target
- bool Quota_targetReached(int Quota questionnaire resource id "The questionnaire resource id") - Returns true if any quota in the specified questionnaire has reached its target
- bool Quota_targetReached(string Quota name "Name of the quota to check", int Quota questionnaire resource id "The questionnaire resource id") - Returns true if the named quota in the specified questionnaire has reached its target
- Empty Quota_updateAllQuotas() - Updates all quotas for the current Questionnaire context
- int Quota_updateAllQuotasForAllQASs() - Updates all quotas for all QASs in the current Questionnaire context
- int Quota_updateAllQuotasForAllQASs(int? Quota questionnaire resource id "The questionnaire resource id") - Updates all quotas for all QASs in the specified Questionnaire
- Empty Quota_updateQuota(string Quota name "Name of the quota") - Updates the specified quota
- int Quota_updateQuotaForAllQASs(string Quota name "Name of the quota") - Updates the specified quota for all QASs in the current Questionnaire context
- int Quota_updateQuotaForAllQASs(string Quota name "Name of the quota", int? Quota questionnaire resource id "The questionnaire resource id") - Updates the specified quota for all QASs in the specified Questionnaire
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();