/// <summary>
        /// delete question will receive question from UI and send it to database to delete
        /// and return 0 if delete operation is succeeded.
        /// </summary>
        public static int DeleteQustion(Qustion Question)
        {
            try
            {
                switch (Question.TypeOfQuestion)
                {
                case TypeOfQuestion.Slider:
                    int ResultOfDeleteSlider = DataBaseConnections.DeleteSlider(Question);
                    return(ResultOfDeleteSlider);

                case TypeOfQuestion.Smily:
                    int ResultOfDeleteSmile = DataBaseConnections.DeleteSmile(Question);
                    return(ResultOfDeleteSmile);

                case TypeOfQuestion.Stars:
                    int ResultOfDeleteStar = DataBaseConnections.DeleteStar(Question);
                    return(ResultOfDeleteStar);

                default:
                    return(GenralVariables.ErrorInManger);
                }
            }
            catch (Exception ex)
            {
                GenralVariables.Errors.Log(ex.Message);
                return(GenralVariables.ErrorInMangerDelete);
            }
        }
Esempio n. 2
0
 public static int DeleteQustion(Qustions Question)
 {
     try
     {
         if (Question is Slider)
         {
             return(DataBaseConnections.DeleteSlider(Question));
         }
         else if (Question is Smiles)
         {
             return(DataBaseConnections.DeleteSmile(Question));
         }
         else
         {
             return(DataBaseConnections.DeleteStar(Question));
         }
     }
     catch (Exception ex)
     {
         StaticObjects.Erros.Log(ex);
         StaticObjects.SuccOfFail = 0;
         return(0);
     }
 }