public bool registrerKunde(kunde spm) { using (var db = new FaqContext()) { try { var nyttSpm = new kunde() { id = spm.id, fornavn = spm.fornavn, etternavn = spm.etternavn, epost = spm.epost, spm = spm.spm }; db.Kunder.Add(nyttSpm); db.SaveChanges(); return(true); } catch (Exception e) { return(false); } } }
public bool registrerspørsmål(faqhjelp spml) { using (var db = new FaqContext()) { try { var nyttSpml = new faqhjelp() { id = spml.id, spml = spml.spml, svar = spml.svar, like = spml.like, unlike = spml.unlike }; db.Spm.Add(nyttSpml); db.SaveChanges(); return(true); } catch (Exception e) { return(false); } } }
public ActionResult Index() { FaqContext db = new FaqContext(); var allFaqs = db.Faqs.ToList(); ViewBag.FaqsList = allFaqs; return(View()); }
public bool AddUserQuestion(UserQuestionDomainModel question) { using (var db = new FaqContext()) { db.Question.Add(new UserQuestion { Name = question.Name, Date = DateTime.Now, Email = question.Email, Question = question.Question, Answer = "Ubesvart" }); db.SaveChanges(); log.Debug("AddUserQuestionDb"); return(true); } }
public List <FaqDomainModel> getCategoryContent(Category category) { using (var db = new FaqContext()) { List <Faq> faq = db.Faq.Where(o => o.Category == category).ToList(); List <FaqDomainModel> categoryContent = new List <FaqDomainModel>(); faq.ForEach(c => categoryContent.Add(new FaqDomainModel { Category = category.ToString(), Question = c.Question, Answer = c.Answer })); log.Error("getCategory" + categoryContent); return(categoryContent); } }
public List <FaqDomainModel> getAllAnswers() { using (var db = new FaqContext()) { List <Faq> faq = (from a in db.Faq select a).ToList(); List <FaqDomainModel> allAnswers = new List <FaqDomainModel>(); faq.ForEach(c => allAnswers.Add(new FaqDomainModel { Question = c.Question, Answer = c.Answer })); log.Error("getAllAnswers" + allAnswers); return(allAnswers); } }
public List <UserQuestionDomainModel> getAllUserQuestions() { using (var db = new FaqContext()) { List <UserQuestion> queryResult = (from a in db.Question select a).ToList(); List <UserQuestionDomainModel> allAnswers = new List <UserQuestionDomainModel>(); queryResult.ForEach(c => allAnswers.Add(new UserQuestionDomainModel { Id = c.Id, Name = c.Name, Email = c.Email, Date = c.Date.ToShortDateString(), Question = c.Question, Answer = c.Answer })); log.Error("Failed to get Airports"); return(allAnswers); } }
public List <kunde> alleSpm() { var db = new FaqContext(); var liste = new List <kunde>(); var allespm = db.Kunder.ToList(); foreach (var spm in allespm) { kunde k = new kunde { id = spm.id, fornavn = spm.fornavn, etternavn = spm.etternavn, epost = spm.epost, spm = spm.spm }; liste.Add(k); } ; return(liste); }
public List <faqhjelp> AlleSpmOgSvar() { var db = new FaqContext(); var liste = new List <faqhjelp>(); var AlleSpmSvarListe = db.Spm.ToList(); foreach (var spmsvar in AlleSpmSvarListe) { faqhjelp k = new faqhjelp { id = spmsvar.id, spml = spmsvar.spml, svar = spmsvar.svar, like = spmsvar.like, unlike = spmsvar.unlike }; liste.Add(k); } ; return(liste); }
public AnswersController(FaqContext context) : base(context) { }
/// <inheritdoc /> /// <summary> /// The default constructor /// </summary> /// <param name="service">The injected context service</param> public HomeController(FaqContext service) : base(service) { }
/// <inheritdoc /> /// <summary> /// The default constructor /// </summary> /// <param name="service">The injected context service</param> /// <param name="fileFactory">The injected file factory</param> public AnswersController(FaqContext service) : base(service) { }
public UsersController(FaqContext context) : base(context) { }
public DataInitializer(FaqContext context) { _context = context; }
public CategoriesController(FaqContext context) { _context = context; }
public TagsController(FaqContext context) : base(context) { }
public HomeController(FaqContext ctx) { context = ctx; }
public FaqController(FaqContext context) { _context = context; }
public FaqController(FaqContext context) { this.db = context; }
public QuestionsController(FaqContext context) : base(context) { }