forked from MDCPS/DamageAssessment_Backend
Multi Language support
This commit is contained in:
@ -24,8 +24,6 @@ namespace DamageAssesment.Api.Questions.Providers
|
||||
SeedData();
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void SeedData()
|
||||
{
|
||||
|
||||
@ -44,15 +42,9 @@ namespace DamageAssesment.Api.Questions.Providers
|
||||
}
|
||||
if (!questionDbContext.Questions.Any())
|
||||
{
|
||||
<<<<<<< HEAD
|
||||
questionDbContext.Questions.Add(new Db.Question() { Id = 1, QuestionTypeId = 2, SurveyId = 1, QuestionNumber = 1, IsRequired = true, Comment = false, Key = true, QuestionGroup = "group1", CategoryId = 1 });
|
||||
questionDbContext.Questions.Add(new Db.Question() { Id = 2, QuestionTypeId = 1, SurveyId = 1, QuestionNumber = 2, IsRequired = false, Comment = true, Key = false, QuestionGroup = "group1", CategoryId = 1 });
|
||||
questionDbContext.Questions.Add(new Db.Question() { Id = 3, QuestionTypeId = 1, SurveyId = 1, QuestionNumber = 3, IsRequired = true, Comment = false, Key = true, QuestionGroup = "group1", CategoryId = 2 });
|
||||
=======
|
||||
questionDbContext.Questions.Add(new Db.Question() { Id = 1, QuestionTypeId = 2, SurveyId = 1, QuestionNumber = 1, IsRequired = true, Comment = false, Key = true, CategoryId=1 });
|
||||
questionDbContext.Questions.Add(new Db.Question() { Id = 2, QuestionTypeId = 1, SurveyId = 1, QuestionNumber = 2, IsRequired = false, Comment = true, Key = false, CategoryId = 1 });
|
||||
questionDbContext.Questions.Add(new Db.Question() { Id = 3, QuestionTypeId = 1, SurveyId = 1, QuestionNumber = 3, IsRequired = true, Comment = false, Key = true, CategoryId = 2 });
|
||||
>>>>>>> cf3a04891b7b50d0a02ac9c8b9a78ccb9436c35c
|
||||
questionDbContext.SaveChanges();
|
||||
}
|
||||
if (!questionDbContext.QuestionTypes.Any())
|
||||
@ -65,22 +57,13 @@ namespace DamageAssesment.Api.Questions.Providers
|
||||
|
||||
if (!questionDbContext.QuestionCategories.Any())
|
||||
{
|
||||
<<<<<<< HEAD
|
||||
questionDbContext.QuestionCategories.Add(new Db.QuestionCategory() { Id = 1, CategoryName = "Category 1", CategoryImage = "img1" });
|
||||
questionDbContext.QuestionCategories.Add(new Db.QuestionCategory() { Id = 2, CategoryName = "Category 2", CategoryImage = "img1" });
|
||||
questionDbContext.QuestionCategories.Add(new Db.QuestionCategory() { Id = 3, CategoryName = "Category 3", CategoryImage = "img1" });
|
||||
questionDbContext.QuestionCategories.Add(new Db.QuestionCategory() { Id = 4, CategoryName = "Category 4", CategoryImage = "img1" });
|
||||
questionDbContext.QuestionCategories.Add(new Db.QuestionCategory() { Id = 5, CategoryName = "Category 5", CategoryImage = "img1" });
|
||||
=======
|
||||
questionDbContext.QuestionCategories.Add(new Db.QuestionCategory() { Id = 1, CategoryName = "Flooding", CategoryImage= "https://example.com/images/img1.png" });
|
||||
questionDbContext.QuestionCategories.Add(new Db.QuestionCategory() { Id = 2, CategoryName = "Electrical", CategoryImage = "https://example.com/images/img2.png" });
|
||||
questionDbContext.QuestionCategories.Add(new Db.QuestionCategory() { Id = 3, CategoryName = "Structural", CategoryImage = "https://example.com/images/img3.png" });
|
||||
questionDbContext.QuestionCategories.Add(new Db.QuestionCategory() { Id = 4, CategoryName = "Utility", CategoryImage = "https://example.com/images/img4.png" });
|
||||
questionDbContext.QuestionCategories.Add(new Db.QuestionCategory() { Id = 5, CategoryName = "Debris", CategoryImage = "https://example.com/images/img5.png" });
|
||||
>>>>>>> cf3a04891b7b50d0a02ac9c8b9a78ccb9436c35c
|
||||
questionDbContext.SaveChanges();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public async Task<(bool IsSuccess, IEnumerable<Models.Question> Questions, string ErrorMessage)> GetQuestionsAsync(string Language)
|
||||
@ -273,8 +256,6 @@ namespace DamageAssesment.Api.Questions.Providers
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
//Question Category Logic
|
||||
|
||||
public async Task<(bool IsSuccess, IEnumerable<Models.QuestionCategory> QuestionCategories, string ErrorMessage)> GetQuestionCategoriesAsync()
|
||||
|
Reference in New Issue
Block a user