/// <summary> /// Method called once an addin has been added to a survey /// Can be used to set default values, settings for the addin /// </summary> public void InitOnSurveyAddition() { SurveyEntryQuotaData surveyQuota = new SurveyEntryQuotaData(); SurveyEntryQuotaData.SurveyEntryQuotasRow row = surveyQuota.SurveyEntryQuotas.NewSurveyEntryQuotasRow(); row.SurveyId = this.SurveyId; row.MaxEntries = 0x3e8; row.EntryCount = 0; row.MaxReachedMessage = ResourceManager.GetString("QuotaReachedMessage", this.LanguageCode); surveyQuota.SurveyEntryQuotas.AddSurveyEntryQuotasRow(row); new Survey().UpdateQuotaSettings(surveyQuota); }
protected virtual void OnUpdateClick(object sender, EventArgs e) { if (Information.IsNumeric(this._maxEntryTextBox.Text)) { SurveyEntryQuotaData surveyQuota = new SurveyEntryQuotaData(); SurveyEntryQuotaData.SurveyEntryQuotasRow row = surveyQuota.SurveyEntryQuotas.NewSurveyEntryQuotasRow(); row.SurveyId = this.SurveyId; row.MaxEntries = int.Parse(this._maxEntryTextBox.Text); row.MaxReachedMessage = this._maxReachedMessage.Text; surveyQuota.SurveyEntryQuotas.AddSurveyEntryQuotasRow(row); new Survey().UpdateQuotaSettings(surveyQuota); } }
/// <summary> /// Updates or creates if it doesnt exists /// quota settings for the survey /// </summary> public void UpdateQuotaSettings(SurveyEntryQuotaData surveyQuota) { SurveyFactory.Create().UpdateQuotaSettings(surveyQuota); }