public void CreateAnsweredSurvey(AnsweredSurvey answeredsurvey)
 {
     db.AnsweredSurveys.Add(answeredsurvey);
     db.SaveChanges();
 }
Пример #2
0
        public int AnsweredSurvey_Create(int accountid, int surveyid, int playerid)
        {
            try
            {
                IAnsweredSurveyRepository answeredsurveyrep = new EntityAnsweredSurveyRepository();

                AnsweredSurvey answeredsurvey = new AnsweredSurvey();
                answeredsurvey.AccountID = accountid;
                answeredsurvey.SurveyID = surveyid;
                answeredsurvey.PlayerID = playerid;
                answeredsurvey.CreatedDateTime = DateTime.UtcNow;

                answeredsurveyrep.CreateAnsweredSurvey(answeredsurvey);

                return answeredsurvey.AnsweredSurveyID;
            }
            catch { return 0; }
        }