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; this.questionDAL.AddQuestion(question); this.textAnswerDAL = new TextAnswerDAL(); this.textAnswer = new text_answers(); this.textAnswer.User_name = userName; this.textAnswer.Question_id = question.Id; this.textAnswer.Answer = TextAnswerText; }
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 = 2; this.questionDAL.AddQuestion(question); this.optionChoicesDAL = new OptionChoicesDAL(); this.optionChoice = new option_choices(); this.optionChoice.Question_id = question.Id; this.optionChoice.Option_choices_name = OptionChoiceName; }
public void TestInit() { surveyDbContext = Database.GetConnection(); userDAL = new UserDAL(); user = new users(); user.User_name = userName; user.User_password = password; }
public static surveysdbEntities1 GetConnection() { if (surveyDBcontext == null) { surveyDBcontext = new surveysdbEntities1(); } return(surveyDBcontext); }
public void TestInit() { surveydb = Database.GetConnection(); surveyDal = new SurveyDAL(); userDAL = new UserDAL(); user = new users(); user.User_name = userName; user.User_password = password; survey = new surveys(); survey.Name = surveyName; survey.users = user; SurveyCode = HelperDAL.GenerateRandomSurveyCode(); survey.Survey_code = SurveyCode; }