public void CreateInspectieFormulier(Inspectieformulier inspec)
 {
     using (FestispecContext context = new FestispecContext())
     {
         context.Inspectieformulier.Add(inspec);
         context.SaveChanges();
     }
 }
Пример #2
0
 public void RemoveVraagFromInspectieFormulier(InspectieformulierVragenlijstCombinatie voc)
 {
     using (FestispecContext context = new FestispecContext())
     {
         context.InspectieformulierVragenlijstCombinatie.Remove(voc);
         context.SaveChanges();
     }
 }
Пример #3
0
 public void CreateJob(Opdracht opdracht)
 {
     using (FestispecContext context = new FestispecContext())
     {
         context.Opdracht.Add(opdracht);
         context.SaveChanges();
     }
 }
 public void AddPossibleAnwser(VraagMogelijkAntwoord pos)
 {
     using (FestispecContext context = new FestispecContext())
     {
         context.VraagMogelijkAntwoord.Add(pos);
         context.SaveChanges();
     }
 }
 internal void AddPossibleAnswers(List <VraagMogelijkAntwoord> newPosAnswers)
 {
     using (FestispecContext context = new FestispecContext())
     {
         context.VraagMogelijkAntwoord.AddRange(newPosAnswers);
         context.SaveChanges();
     }
 }
 public void DeleteQuestion(Vraag question)
 {
     using (FestispecContext context = new FestispecContext())
     {
         context.Vraag.Remove(question);
         context.SaveChanges();
     }
 }
Пример #7
0
 public void AddVraagToInspectieFormulier(InspectieformulierVragenlijstCombinatie voc)
 {
     using (FestispecContext context = new FestispecContext())
     {
         context.InspectieformulierVragenlijstCombinatie.Add(voc);
         context.SaveChanges();
     }
 }
 public void UpdateRapportage(int jobID, string report)
 {
     using (FestispecContext context = new FestispecContext())
     {
         context.Opdracht.Where(x => x.OpdrachtID == jobID).FirstOrDefault().Rapportage = report;
         context.SaveChanges();
     }
 }
Пример #9
0
 public bool Register(Account account)
 {
     using (FestispecContext context = new FestispecContext())
     {
         context.Account.Add(account);
         return(context.SaveChanges() > 1);
     }
 }
 public void UpdateTemplate(RapportTemplate template)
 {
     using (FestispecContext context = new FestispecContext())
     {
         context.RapportTemplate.Where(x => x.TemplateID == template.TemplateID).FirstOrDefault().TemplateText = template.TemplateText;
         context.SaveChanges();
     }
 }
 public void CreateTemplate(RapportTemplate template)
 {
     using (FestispecContext context = new FestispecContext())
     {
         context.RapportTemplate.Add(template);
         context.SaveChanges();
     }
 }
 public void AddQuestionToInspectionForm(Vraag question)
 {
     using (FestispecContext context = new FestispecContext())
     {
         context.Vraag.Add(question);
         context.SaveChanges();
     }
 }
 public void DeleteInspectieFormulier(Inspectieformulier inspec)
 {
     using (FestispecContext context = new FestispecContext())
     {
         Inspectieformulier target = context.Inspectieformulier.Include("Vraag").Include("Vraag.VraagMogelijkAntwoord").Include("Vraag.Antwoorden").Where(x => x.InspectieformulierID == inspec.InspectieformulierID).FirstOrDefault();
         context.Inspectieformulier.Remove(target);
         context.SaveChanges();
     }
 }
 public int AddQuestion(Vraag question)
 {
     using (FestispecContext context = new FestispecContext())
     {
         context.Vraag.Add(question);
         context.SaveChanges();
         return(context.Vraag.Max(q => q.VraagID));
     }
 }
Пример #15
0
 public void DeleteInspectionFormTemplate(int templateID)
 {
     using (FestispecContext context = new FestispecContext())
     {
         Inspectieformulier target = context.Inspectieformulier.Where(x => x.InspectieformulierID == templateID).FirstOrDefault();
         context.Inspectieformulier.Remove(target);
         context.SaveChanges();
     }
 }
 public void CreateQuotation(Offerte quotation)
 {
     using (FestispecContext context = new FestispecContext())
     {
         Opdracht job = context.Opdracht.FirstOrDefault(j => j.OpdrachtID == quotation.OpdrachtID);
         job.Offerte.Add(quotation);
         context.SaveChanges();
     }
 }
 public void UpdateInspectieFormulier(Inspectieformulier inspec)
 {
     using (FestispecContext context = new FestispecContext())
     {
         Inspectieformulier target = context.Inspectieformulier.Where(i => i.InspectieformulierID == inspec.InspectieformulierID).FirstOrDefault();
         context.Entry(target).CurrentValues.SetValues(inspec);
         context.SaveChanges();
     }
 }
 public void UpdateDecision(int quotationId, string decision)
 {
     using (FestispecContext context = new FestispecContext())
     {
         Offerte toUpdate = context.Offerte.FirstOrDefault(q => q.OfferteID == quotationId);
         toUpdate.KlantbeslissingReden = decision;
         context.SaveChanges();
     }
 }
Пример #19
0
 public void UpdateJob(Opdracht opdracht)
 {
     using (FestispecContext context = new FestispecContext())
     {
         Opdracht toUpdate = context.Opdracht.Where(c => c.OpdrachtID == opdracht.OpdrachtID).FirstOrDefault();
         context.Entry(toUpdate).CurrentValues.SetValues(opdracht);
         context.SaveChanges();
     }
 }
 public void UpdateJobStatus(int jobId, string status)
 {
     using (FestispecContext context = new FestispecContext())
     {
         Opdracht toUpdate = context.Opdracht.FirstOrDefault(j => j.OpdrachtID == jobId);
         toUpdate.Status = context.Status.First(s => s.Betekenis == status).Betekenis;
         context.SaveChanges();
     }
 }
 public int CreateInspectieFormulier(Inspectieformulier inspec)
 {
     using (FestispecContext context = new FestispecContext())
     {
         context.Inspectieformulier.Add(inspec);
         context.SaveChanges();
         return(context.Inspectieformulier.Max(i => i.InspectieformulierID));
     }
 }
Пример #22
0
 public Contactpersoon CreateContactPerson(Contactpersoon contactpersoon)
 {
     using (FestispecContext context = new FestispecContext())
     {
         Contactpersoon contact = context.Contactpersoon.Add(contactpersoon);
         context.SaveChanges();
         return(contact);
     }
 }
Пример #23
0
 public Klant CreateCustomer(Klant klant)
 {
     using (FestispecContext context = new FestispecContext())
     {
         Klant customer = context.Klant.Add(klant);
         context.SaveChanges();
         return(customer);
     }
 }
Пример #24
0
 public void UpdateContactPerson(Contactpersoon contact)
 {
     using (FestispecContext context = new FestispecContext())
     {
         Contactpersoon toUpdate = context.Contactpersoon.Where(c => c.ContactpersoonID == contact.ContactpersoonID).FirstOrDefault();
         context.Entry(toUpdate).CurrentValues.SetValues(contact);
         context.SaveChanges();
     }
 }
Пример #25
0
 public void UpdateCustomer(Klant klant)
 {
     using (FestispecContext context = new FestispecContext())
     {
         Klant toUpdate = context.Klant.Where(c => c.KlantID == klant.KlantID).FirstOrDefault();
         context.Entry(toUpdate).CurrentValues.SetValues(klant);
         context.SaveChanges();
     }
 }
Пример #26
0
 public void UpdateAccount(Account account)
 {
     using (FestispecContext context = new FestispecContext())
     {
         Account toUpdate = context.Account.Where(c => c.AccountID == account.AccountID).FirstOrDefault();
         context.Entry(toUpdate).CurrentValues.SetValues(account);
         context.SaveChanges();
     }
 }
 public void DeleteInspectieFormulier(Inspectieformulier inspec)
 {
     using (FestispecContext context = new FestispecContext())
     {
         Inspectieformulier target = context.Inspectieformulier.Where(i => i.InspectieformulierID == inspec.InspectieformulierID).FirstOrDefault();
         context.Inspectieformulier.Remove(target);
         context.SaveChanges();
     }
 }
 public void UpdateQuotation(Offerte quotation)
 {
     using (FestispecContext context = new FestispecContext())
     {
         Offerte toUpdate = context.Offerte.FirstOrDefault(q => q.OfferteID == quotation.OfferteID);
         quotation.Aanmaakdatum = toUpdate.Aanmaakdatum;
         context.Entry(toUpdate).CurrentValues.SetValues(quotation);
         context.SaveChanges();
     }
 }
 public int UpdateQuestion(Vraag question)
 {
     using (FestispecContext context = new FestispecContext())
     {
         Vraag target = context.Vraag.Where(v => v.VraagID == question.VraagID).FirstOrDefault();
         context.Entry(target).CurrentValues.SetValues(question);
         context.SaveChanges();
         return(1);
     }
 }
        public void AddToPlanning(int accountId, int formulierId)
        {
            using (FestispecContext context = new FestispecContext())
            {
                Inspectieformulier formulier = context.Inspectieformulier.Find(formulierId);
                Account            account   = context.Account.Find(accountId);

                formulier.Ingepland.Add(account);
                context.SaveChanges();
            }
        }