Example #1
0
        public override DataSet Clone()
        {
            SurveyEntryQuotaData data = (SurveyEntryQuotaData)base.Clone();

            data.InitVars();
            return(data);
        }
 /// <summary>
 /// Updates or creates if it doesnt exists 
 /// quota settings for the survey
 /// </summary>
 public void UpdateQuotaSettings(SurveyEntryQuotaData surveyQuota)
 {
     SurveyFactory.Create().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>
 /// 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);
 }
 /// <summary>
 /// Updates or creates if it doesnt exists 
 /// quota settings for the survey
 /// </summary>
 public void UpdateQuotaSettings(SurveyEntryQuotaData surveyQuota)
 {
     SqlConnection dbConnection = new SqlConnection(DbConnection.NewDbConnectionString);
     SqlCommand updateQuota = new SqlCommand("vts_spSurveyEntryQuotaUpdate", dbConnection);
     updateQuota.CommandType = CommandType.StoredProcedure;
     updateQuota.Parameters.Add(new SqlParameter("@SurveyId", SqlDbType.Int, 4, "SurveyId"));
     updateQuota.Parameters.Add(new SqlParameter("@MaxReachedMessage", SqlDbType.NVarChar, 4000, "MaxReachedMessage"));
     updateQuota.Parameters.Add(new SqlParameter("@MaxEntries", SqlDbType.Int, 4, "MaxEntries"));
    DbConnection.db.UpdateDataSet(surveyQuota, "SurveyEntryQuotas", updateQuota, new SqlCommand(), updateQuota, UpdateBehavior.Transactional);
 }
 /// <summary>
 /// Retrieves the quota of the survey
 /// </summary>
 public SurveyEntryQuotaData GetQuotaSettings(int surveyId)
 {
     SurveyEntryQuotaData entryQuota = new SurveyEntryQuotaData();
    DbConnection.db.LoadDataSet("vts_spSurveyEntryQuotaGetDetails", entryQuota, new string[] { "SurveyEntryQuotas" }, new SqlParameter("@SurveyId", surveyId).SqlValue);
     return entryQuota;
 }
 public SurveyEntryQuotasRowChangeEvent(SurveyEntryQuotaData.SurveyEntryQuotasRow row, DataRowAction action)
 {
     this.eventRow = row;
     this.eventAction = action;
 }
 public void RemoveSurveyEntryQuotasRow(SurveyEntryQuotaData.SurveyEntryQuotasRow row)
 {
     base.Rows.Remove(row);
 }
 public void AddSurveyEntryQuotasRow(SurveyEntryQuotaData.SurveyEntryQuotasRow row)
 {
     base.Rows.Add(row);
 }