/// <summary>
        /// Edit question will receive new data for edit from UI and send it to database
        /// and delete 0 if succeeded
        /// </summary>
        public static int EditQustion(Qustion Question)
        {
            try
            {
                switch (Question.TypeOfQuestion)
                {
                case TypeOfQuestion.Slider:
                    int ResultOfEditSlider = DataBaseConnections.EditSlider(Question);
                    return(ResultOfEditSlider);

                case TypeOfQuestion.Smily:
                    int ResultOfEditSmile = DataBaseConnections.EditSmile(Question);
                    return(ResultOfEditSmile);

                case TypeOfQuestion.Stars:
                    int ResultOfStar = DataBaseConnections.EditStar(Question);
                    return(ResultOfStar);

                default:
                    return(GenralVariables.ErrorInManger);
                }
            }
            catch (Exception ex)
            {
                GenralVariables.Errors.Log(ex.Message);
                return(GenralVariables.ErrorInMangerEdit);
            }
        }
Esempio n. 2
0
 public static Qustions EditQustion(Qustions Question)
 {
     try
     {
         if (Question is Slider)
         {
             return(DataBaseConnections.EditSlider(Question));
         }
         else if (Question is Smiles)
         {
             return(DataBaseConnections.EditSmile(Question));
         }
         else
         {
             return(DataBaseConnections.EditStar(Question));
         }
     }
     catch (Exception ex)
     {
         StaticObjects.Erros.Log(ex);
         StaticObjects.SuccOfFail = 0;
         return(null);
     }
 }