Esempio n. 1
0
 void clockPicker_Validation(object sender, DevExpress.Web.ValidationEventArgs e)
 {
     try
     {
         ConverteSelectedTimeToUtcAndUpdateControlsValue();
     }
     catch (Exception ex)
     {
         e.ErrorText = ex.Message;
         e.IsValid   = false;
     }
 }
Esempio n. 2
0
 void TralusDateTimeControlPersian_Validation(object sender, DevExpress.Web.ValidationEventArgs e)
 {
     try
     {
         ConvertePersianDateToDateTime();
     }
     catch (Exception ex)
     {
         e.ErrorText = ex.Message;
         e.IsValid   = false;
     }
 }
Esempio n. 3
0
        /// <summary>
        /// This method validates the news entry type options
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void NewsEntryTypeOption_Validation(object sender, DevExpress.Web.ValidationEventArgs e)
        {
            //Get the entry type
            int?entryType = (ddEntryType.Value == null ? (int?)null : Convert.ToInt32(ddEntryType.Value));

            //Perform validation
            if (entryType.HasValue)
            {
                if (entryType.Value == (int)Utilities.NewsTypeFKs.PROGRAM_WIDE)
                {
                    int?programFK = (ddProgram.Value == null ? (int?)null : Convert.ToInt32(ddProgram.Value));

                    if (programFK.HasValue == false)
                    {
                        e.IsValid   = false;
                        e.ErrorText = "Required!";
                    }
                }
                else if (entryType.Value == (int)Utilities.NewsTypeFKs.HUB_WIDE)
                {
                    int?hubFK = (ddHub.Value == null ? (int?)null : Convert.ToInt32(ddHub.Value));

                    if (hubFK.HasValue == false)
                    {
                        e.IsValid   = false;
                        e.ErrorText = "Required!";
                    }
                }
                else if (entryType.Value == (int)Utilities.NewsTypeFKs.STATE_WIDE)
                {
                    int?stateFK = (ddState.Value == null ? (int?)null : Convert.ToInt32(ddState.Value));

                    if (stateFK.HasValue == false)
                    {
                        e.IsValid   = false;
                        e.ErrorText = "Required!";
                    }
                }
                else if (entryType.Value == (int)Utilities.NewsTypeFKs.COHORT_WIDE)
                {
                    int?cohortFK = (ddCohort.Value == null ? (int?)null : Convert.ToInt32(ddCohort.Value));

                    if (cohortFK.HasValue == false)
                    {
                        e.IsValid   = false;
                        e.ErrorText = "Required!";
                    }
                }
            }
        }
Esempio n. 4
0
 void TralusDateTimeControlGregorian_Validation(object sender, DevExpress.Web.ValidationEventArgs e)
 {
     if (SelectedCalendar.GetType() != typeof(PersianCalendar))
     {
         try
         {
             ConverteSelectedTimeToUtcAndUpdateControlsValue();
         }
         catch (Exception ex)
         {
             e.ErrorText = ex.Message;
             e.IsValid   = false;
         }
     }
 }
Esempio n. 5
0
 /// <summary>
 /// This method fires when the validation for the txtTotalScore DevExpress
 /// Bootstrap TextBox fires and it validates that control's value
 /// </summary>
 /// <param name="sender">The txtTotalScore TextBox</param>
 /// <param name="e">ValidationEventArgs</param>
 protected void txtTotalScore_Validation(object sender, DevExpress.Web.ValidationEventArgs e)
 {
     //Perform validation
     if (txtTotalScore.Value == null)
     {
         //The total score is required
         e.IsValid   = false;
         e.ErrorText = "Total Score is required!";
     }
     else
     {
         //Validate against the max score
         if (currentScoreASQSE.MaxScore > 0)
         {
             if (Convert.ToInt32(txtTotalScore.Text) > currentScoreASQSE.MaxScore)
             {
                 e.IsValid   = false;
                 e.ErrorText = "Total Score cannot be greater than the max score of " + currentScoreASQSE.MaxScore + "!";
             }
         }
     }
 }