public Survey Create(Survey survey) { ESurvey eSurvey = ESurvey(survey); eSurvey = _iDSurvey.Create(eSurvey); return(Survey(eSurvey)); }
public Survey Create(int createdBy, Survey survey) { ESurvey eSurvey = ESurvey(survey); eSurvey.CreatedDate = DateTime.Now; eSurvey.CreatedBy = createdBy; eSurvey = _iDSurvey.Create(eSurvey); return(Survey(eSurvey)); }
private Survey Survey(ESurvey eSurvey) { Survey returnSurvey = new Survey { SurveyId = eSurvey.SurveyId, SurveyName = eSurvey.SurveyName, //Comments=eSurvey.Comments, //Rate = eSurvey.Rate }; return(returnSurvey); }
private ESurvey ESurvey(Survey survey) { ESurvey returnESurvey = new ESurvey { SurveyId = survey.SurveyId, SurveyName = survey.SurveyName, //Comments=survey.Comments, //Rate = survey.Rate }; return(returnESurvey); }
private Survey Survey(ESurvey eSurvey) { return(new Survey { CreatedBy = eSurvey.CreatedBy, SurveyId = eSurvey.SurveyId, UpdatedBy = eSurvey.UpdatedBy, SurveyName = eSurvey.SurveyName, Questions = eSurvey.Questions?.Select(b => new Question { QuestionId = b.QuestionId, Description = b.Description, }).ToList() ?? new List <Question>() }); }
protected override void Seed(Context context) { ESurvey eSurvey = new ESurvey() { CreatedDate = DateTime.Now, CreatedBy = 0, SurveyName = "Default Survey" }; eSurvey = context.Survey.Add(eSurvey); context.SaveChanges(); if (eSurvey.SurveyId != 0) { List <EQuestion> eQuestions = new List <EQuestion>() { new EQuestion { CreatedDate = DateTime.Now, CreatedBy = 0, SurveyId = eSurvey.SurveyId, Description = "Was the Service Desk analyst helpful in diagnosing the cause of your problem/issue?", Name = "Diagnostic" }, new EQuestion { CreatedDate = DateTime.Now, CreatedBy = 0, SurveyId = eSurvey.SurveyId, Description = "Was the Service Desk analyst able to resolve your problem/issue (N/A if call was transferred, escalated to Tier 2)?", Name = "Resolution" }, new EQuestion { CreatedDate = DateTime.Now, CreatedBy = 0, SurveyId = eSurvey.SurveyId, Description = "How satisfied were you with the delivery of the resolution of your problem/issue?", Name = "Satisfaction" }, new EQuestion { CreatedDate = DateTime.Now, CreatedBy = 0, SurveyId = eSurvey.SurveyId, Description = "Was the Service Desk analyst courteous, friendly and accommodating?", Name = "Courteousness" }, new EQuestion { CreatedDate = DateTime.Now, CreatedBy = 0, SurveyId = eSurvey.SurveyId, Description = "How would you rate your overall level of satisfaction with the Service Desk team?", Name = "Overall Satisfaction" }, }; context.Question.AddRange(eQuestions); context.SaveChanges(); } }
public Survey Read(int surveyId) { ESurvey eSurvey = _iDSurvey.Read <ESurvey>(a => a.SurveyId == surveyId); return(Survey(eSurvey)); }
public Survey Read(int surveyId) { ESurvey eSurvey = _iDSurvey.Read(surveyId); return(Survey(eSurvey)); }