public void TestInit()
 {
     surveydb           = Database.GetConnection();
     surveyDal          = new SurveyDAL();
     userDAL            = new UserDAL();
     questionDAL        = new QuestionDAL();
     user               = new users();
     user.User_name     = userName;
     user.User_password = password;
     HelperDAL.AddUser(user);
     survey      = new surveys();
     survey.Name = surveyName;
     //survey.users = user;
     survey.User_name   = userName;
     SurveyCode         = HelperDAL.GenerateRandomSurveyCode();
     survey.Survey_code = SurveyCode;
     HelperDAL.AddSurvey(survey);
     question = new questions();
     question.Question_name = questionName;
     question.Surveys_id    = survey.Id;
     question.Input_type_id = 1;
     HelperDAL.AddQuestion(question);
     this.inputTypesDAL = new InputTypesDAL();
     this.inputTypes    = new input_types();
 }
示例#2
0
        public string GetInputTypeName(questions question)
        {
            input_types inputType = surveyDBcontext.input_types.Where(x => x.Id == question.Input_type_id).FirstOrDefault();

            return(inputType.Input_type_name);
        }