예제 #1
0
        public async Task <IActionResult> Edit(int id, [Bind("ID,TypeMelding,Datum,AgendaDatum,Titel,Ondertitel,Omschrijving,Afdeling,Machine,Klant,Link,AfbeeldingPad,ProcedurePad")] Melding melding)
        {
            if (id != melding.ID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(melding);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!MeldingExists(melding.ID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(melding));
        }
예제 #2
0
        public void generateTestMeldingen(Dashboard dashboard)
        {
            initNonExistingRepo(true);
            Melding melding1 = new Melding()
            {
                IsActive        = true,
                IsPositive      = true,
                MeldingDateTime = DateTime.Now.AddHours(-1),
                Message         = "Deze Alert is een positieve test alert",
                Titel           = "Postieve Test Melding",
                Dashboard       = dashboard
            };

            dashboardRepository.createMelding(melding1);
            Melding melding2 = new Melding()
            {
                IsActive        = true,
                IsPositive      = false,
                MeldingDateTime = DateTime.Now.AddHours(-2),
                Message         = "Deze Alert is een Negatieve test alert",
                Titel           = "Negatieve Test Melding",
                Dashboard       = dashboard
            };

            dashboardRepository.createMelding(melding2);
            //meldingen.Add(melding1);
            //meldingen.Add(melding2);
        }
예제 #3
0
        public async Task <IActionResult> PutMelding(long id, Melding melding)
        {
            if (id != melding.meldingID)
            {
                return(BadRequest());
            }

            _context.Entry(melding).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!MeldingExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
예제 #4
0
        public async Task <IActionResult> Edit(int id, [Bind("MeldingID,UserID,Titel,Omschrijving,CategorieID,Datum,Foto,Gesloten")] Melding melding)
        {
            if (id != melding.MeldingID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(melding);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!MeldingExists(melding.MeldingID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["CategorieID"] = new SelectList(_context.Categorie, "CategorieID", "CategorieID", melding.CategorieID);
            ViewData["UserID"]      = new SelectList(_context.Users, "Id", "Id", melding.UserID);
            return(View(melding));
        }
예제 #5
0
        public async Task <ActionResult <Melding> > PostMelding(Melding melding)
        {
            _context.Meldingen.Add(melding);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetMelding", new { id = melding.meldingID }, melding));
        }
예제 #6
0
        public void setMeldingInactive(int id)
        {
            initNonExistingRepo();
            Melding melding = getMeldingById(id);

            melding.IsActive = false;
            dashboardRepository.updateMelding(melding);
        }
        public ActionResult Melding(int id)
        {
            IDashboardManager dashboardManager = new DashboardManager();
            Melding           melding          = dashboardManager.getMeldingById(id);

            dashboardManager.setMeldingInactive(id);
            return(View("MeldingDetail", melding));
        }
예제 #8
0
        public async Task <IActionResult> Create([Bind("ID,TypeMelding,Datum,AgendaDatum,Titel,Ondertitel,Omschrijving,Afdeling,Machine,Klant,Link,AfbeeldingPad,ProcedurePad")] Melding melding)
        {
            if (ModelState.IsValid)
            {
                _context.Add(melding);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(melding));
        }
예제 #9
0
        public void AddMelding(int id, MeldingDTO meldingDTO)
        {
            var passagier = _passengerRepository.GetbyId(id);
            var melding   = new Melding()
            {
                Inhoud = meldingDTO.Inhoud
            };

            passagier.Meldingen.Add(melding);
            _passengerRepository.SaveChanges();
        }
예제 #10
0
 public void AddMeldingToAll(MeldingDTO meldingDTO)
 {
     foreach (var p in _passengerRepository.GetAll())
     {
         var melding = new Melding()
         {
             Inhoud = meldingDTO.Inhoud
         };
         p.Meldingen.Add(melding);
     }
     _passengerRepository.SaveChanges();
 }
예제 #11
0
        public async Task <ActionResult <Melding> > PostMelding(Melding melding)
        {
            if (melding.Tijdstip == null)
            {
                melding.Tijdstip = DateTime.Now;
            }

            _context.Meldingen.Add(melding);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetMelding", new { id = melding.MeldingID }, melding));
        }
        public async Task <ActionResult <DashboardUserVM> > GetDashboardUserVM()
        {
            DashboardUserVM vm = new DashboardUserVM();

            List <Tabel>   tabellen         = new List <Tabel>();
            List <Persoon> personen         = new List <Persoon>();
            Melding        recentsteMelding = null;

            personen = await _context.Personen
                       .Include(p => p.Type)
                       .Include(p => p.Meldingen).ThenInclude(p => p.Plaats)
                       .ToListAsync();

            foreach (var persoon in personen)
            {
                Tabel tabel = new Tabel();
                if (persoon.Meldingen != null && persoon.Meldingen.Count() != 0)
                {
                    foreach (var melding in persoon.Meldingen)
                    {
                        if (recentsteMelding == null)
                        {
                            recentsteMelding = melding;
                        }
                        if (melding.Tijdstip > recentsteMelding.Tijdstip)
                        {
                            recentsteMelding = melding;
                        }
                    }
                }



                tabel.Naam          = persoon.Naam;
                tabel.Voornaam      = persoon.Voornaam;
                tabel.Type          = persoon.Type.Functie;
                tabel.Overtredingen = persoon.Meldingen.Count();
                if (recentsteMelding != null)
                {
                    tabel.Recentste = recentsteMelding.Tijdstip;
                    tabel.Locatie   = recentsteMelding.Plaats.Naam;
                }
                tabel.Tagnummer = persoon.PersoonID;

                tabellen.Add(tabel);
            }

            vm.tabellen = tabellen;

            return(vm);
        }
예제 #13
0
        public void PostMelding(string deltakerId, string lagId, string meldingstekst)
        {
            using (var context = _dataContextFactory.Create())
            {
                var melding = new Melding(deltakerId, lagId, meldingstekst)
                {
                    SekvensId = TimeService.Now.Ticks,
                    Tidspunkt = TimeService.Now
                };
                context.Meldinger.Add(melding);

                context.SaveChanges();
            }
        }
예제 #14
0
        public Melding createMelding(Alert alert, double waarde)
        {
            initNonExistingRepo();

            Melding melding = new Melding()
            {
                Alert           = alert,
                IsActive        = true,
                MeldingDateTime = DateTime.Now,
            };

            switch (alert.Operator)
            {
            case "<":
                melding.IsPositive = false;
                break;

            case ">":
                melding.IsPositive = true;
                break;

            default:
                melding.IsPositive = false;
                break;
            }
            StringBuilder message = new StringBuilder("");

            if (alert.DataConfig.Vergelijking == null)
            {
                message.Append("Het element " + alert.DataConfig.Element.Naam + " heeft de waarde " + waarde);
            }
            else
            {
                message.Append("De vergelijking tussen " + alert.DataConfig.Element.Naam + " " + alert.DataConfig.Vergelijking.Naam + " heeft de waarde " + waarde);
            }
            melding.Message = message.ToString();
            melding.Titel   = "Melding van " + alert.DataConfig.Element.Naam;
            dashboardRepository.addMelding(melding);
            return(melding);
        }
예제 #15
0
        public async Task <Bestelling> PostToAll(string inhoud)
        {
            var melding = new Melding {
                Inhoud = inhoud
            };

            try
            {
                var request = new HttpRequestMessage
                {
                    Method     = HttpMethod.Post,
                    RequestUri = new Uri(Api + "/melding"),
                    Content    = new StringContent(JsonConvert.SerializeObject(melding), Encoding.UTF8, "application/json")
                };
                await Client.SendAsync(request);
            }
            catch (Exception ex)
            {
                await new MessageDialog(ex.Message).ShowAsync();
            }

            return(null);
        }
예제 #16
0
        public GroepTest()
        {
            locatie = new Locatie("a", 2, "Bel", 9000, "Gent");
            school  = school = new School("Test", "*****@*****.**", locatie);

            groep  = new Groep("groep1", false);
            groep1 = new Groep("blablabla", false);

            cursist1 = new Cursist("Steve", "Sinaeve", "*****@*****.**");
            cursist6 = new Cursist("test", "testen", "*****@*****.**");

            Melding melding = new Melding("U bent uitgenodigd", groep.Naam);

            cursist6.Meldingen.Add(melding);

            cursist = new Cursist("Jochem", "Van Hespen", "*****@*****.**");
            groep.VoegCursistToe(cursist);

            cursist2 = new Cursist("Jochem", "Van Hespen", "*****@*****.**");
            cursist3 = new Cursist("Jochem", "Van Hespen", "*****@*****.**");
            cursist4 = new Cursist("Jochem", "Van Hespen", "*****@*****.**");
            cursist5 = new Cursist("Jochem", "Van Hespen", "*****@*****.**");
            groep1.VoegCursistToe(cursist2);
            groep1.VoegCursistToe(cursist3);
            groep1.VoegCursistToe(cursist4);
            groep1.VoegCursistToe(cursist5);
            Locatie locatie5 = new Locatie("Poortstraat", 52, "België", 8820, "Torhout");

            Organisatie org2 = new Organisatie("SK Torhout", "*****@*****.**", locatie5, "iets");

            org2.Contactpersonen.Add(It.IsAny <Contactpersoon>());
            String inhoudMotivatie =
                "ok ok ok ok ok ok  kook ok ok o kok ok ok o kok o ko kook ok ok o kok ok ok o kok o ko kook ok ok o kok ok ok o kok o ko kook ok ok o kok ok ok o kok o ko ko ko ko ko k ok ok ok o k ok ok ok o ko k ok okk ok ok ok o ko k ok okk ok ok ok o ko k ok okk ok ok ok o ko k ok okk ok ok ok o ko k ok okk ok ok ok o ko k ok okk ok ok ok o ko k ok okk ok ok ok o ko k ok okk ok ok ok o ko k ok ok ok o k";

            motivatie  = new Motivatie(inhoudMotivatie, org2);
            motivatie1 = new Motivatie(inhoudMotivatie, org2);
        }
예제 #17
0
        public async Task <IActionResult> Create([Bind("MeldingID,UserID,Titel,Omschrijving,CategorieID,Datum,Foto,Gesloten")] Melding melding)
        {
            if (melding.Titel.Length < 3)
            {
                ViewData["TitelLengteError"] = "De titel moet minimaal 4 karakters bevatten.";
            }
            if (melding.Omschrijving.Length < 10)
            {
                ViewData["OmschrijvingError"] = "De omschrijving moet minimaal 10 karakters bevatten.";
            }
            if (_context.Melding.Any(m => m.Titel.Contains(melding.Titel)))
            {
                ViewData["TitelBestaatError"] = "De gekozen titel lijkt te erg op een al bestaande titel.";
            }
            if (melding.Omschrijving.Length < 10 || melding.Titel.Length < 3 || _context.Melding.Any(m => m.Titel.Contains(melding.Titel)))
            {
                MaakMeldingVM createVM = new MaakMeldingVM {
                    Categories = _context.Categorie.ToList()
                };
                return(View(createVM));
            }
            if (melding.Foto == null)
            {
                melding.Foto = "https://vidi-touch.eu/wp-content/themes/vidistri/img/geen-afbeelding.jpg";
            }
            if (ModelState.IsValid)
            {
                _context.Add(melding);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(OverzichtMeldingen)));
            }
            ViewData["CategorieID"] = new SelectList(_context.Categorie, "CategorieID", "CategorieID", melding.CategorieID);
            ViewData["UserID"]      = new SelectList(_context.Users, "Id", "Id", melding.UserID);
            return(View(melding));
        }
예제 #18
0
 private static MsgHead WrapInMsgHead(Melding melding, Args args)
 {
     return(new MsgHead
     {
         Items = new object[]
         {
             new Document
             {
                 RefDoc = new RefDoc
                 {
                     MsgType = new CS {
                         V = "XML", DN = "XML-instans"
                     },
                     Item = new RefDocContent {
                         Melding = melding
                     }
                 }
             }
         },
         MsgInfo = new MsgInfo
         {
             Type = new CS {
                 V = "NPR_KPP", DN = "KPP melding"
             },
             GenDate = DateTime.Now,
             MsgId = Guid.NewGuid().ToString(),
             Sender = new Sender
             {
                 Organisation = new Organisation
                 {
                     OrganisationName = args.OrganizationName,
                     Ident = new []
                     {
                         new Ident
                         {
                             Id = args.OrganizationHerId,
                             TypeId = new CV {
                                 V = "HER", DN = "HER-Id", S = "9051"
                             }
                         }
                     },
                     Organisation1 = new Organisation
                     {
                         OrganisationName = args.OrganizationName2,
                         Ident = new[]
                         {
                             new Ident
                             {
                                 Id = args.OrganizationHerId2,
                                 TypeId = new CV {
                                     V = "HER", DN = "HER-Id", S = "9051"
                                 }
                             }
                         }
                     }
                 }
             },
             Receiver = new Receiver
             {
                 Organisation = new Organisation
                 {
                     OrganisationName = "Helsedirektoratet",
                     Ident = new[]
                     {
                         new Ident
                         {
                             Id = "2397",
                             TypeId = new CV {
                                 V = "HER", DN = "HER-Id", S = "9051"
                             }
                         }
                     },
                     Organisation1 = new Organisation
                     {
                         OrganisationName = "NPR",
                         Ident = new []
                         {
                             new Ident
                             {
                                 Id = args.HDirHerId,
                                 TypeId = new CV {
                                     V = "HER", DN = "HER-Id", S = "9051"
                                 }
                             }
                         }
                     }
                 }
             }
         }
     });
 }
예제 #19
0
        public async void NaboVarselEndToEndTest()
        {
            /* SETUP */
            string instanceOwnerPartyId = "1337";

            Instance instanceTemplate = new Instance()
            {
                InstanceOwner = new InstanceOwner
                {
                    PartyId = instanceOwnerPartyId,
                }
            };

            SvarPaaNabovarselType svar = new SvarPaaNabovarselType();

            svar.ansvarligSoeker             = new PartType();
            svar.ansvarligSoeker.mobilnummer = "90912345";
            svar.eiendomByggested            = new EiendomListe();
            svar.eiendomByggested.eiendom    = new List <EiendomType>();
            svar.eiendomByggested.eiendom.Add(new EiendomType()
            {
                adresse = new EiendommensAdresseType()
                {
                    postnr = "8450"
                }, kommunenavn = "Hadsel"
            });
            string xml = string.Empty;

            using (var stringwriter = new System.IO.StringWriter())
            {
                XmlSerializer serializer = new XmlSerializer(typeof(SvarPaaNabovarselType));
                serializer.Serialize(stringwriter, svar);
                xml = stringwriter.ToString();
            }

            #region Org instansiates form with message
            string instanceAsString = JsonConvert.SerializeObject(instanceTemplate);
            string xmlmelding       = File.ReadAllText("Data/Files/melding.xml");

            string boundary = "abcdefgh";
            MultipartFormDataContent formData = new MultipartFormDataContent(boundary)
            {
                { new StringContent(instanceAsString, Encoding.UTF8, "application/json"), "instance" },
                { new StringContent(xml, Encoding.UTF8, "application/xml"), "skjema" },
                { new StringContent(xmlmelding, Encoding.UTF8, "application/xml"), "melding" }
            };

            Uri uri = new Uri("/dibk/nabovarsel/instances", UriKind.Relative);

            /* TEST */

            HttpClient client = SetupUtil.GetTestClient(_factory, "dibk", "nabovarsel");
            string     token  = PrincipalUtil.GetOrgToken("dibk");
            client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);

            HttpResponseMessage response = await client.PostAsync(uri, formData);

            response.EnsureSuccessStatusCode();

            Assert.True(response.StatusCode == HttpStatusCode.Created);

            Instance createdInstance = JsonConvert.DeserializeObject <Instance>(await response.Content.ReadAsStringAsync());

            Assert.NotNull(createdInstance);
            Assert.Equal(2, createdInstance.Data.Count);
            #endregion

            #region end user gets instance

            // Reset token and client to end user
            client = SetupUtil.GetTestClient(_factory, "dibk", "nabovarsel");
            token  = PrincipalUtil.GetToken(1337);
            client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);

            string instancePath = "/dibk/nabovarsel/instances/" + createdInstance.Id;

            HttpRequestMessage httpRequestMessage =
                new HttpRequestMessage(HttpMethod.Get, instancePath);

            response = await client.SendAsync(httpRequestMessage);

            string responseContent = await response.Content.ReadAsStringAsync();

            Instance instance = (Instance)JsonConvert.DeserializeObject(responseContent, typeof(Instance));

            Assert.Equal(HttpStatusCode.OK, response.StatusCode);
            Assert.Equal("1337", instance.InstanceOwner.PartyId);
            Assert.Equal("Task_1", instance.Process.CurrentTask.ElementId);
            Assert.Equal(2, instance.Data.Count);
            #endregion

            #region end user gets application metadata
            httpRequestMessage = new HttpRequestMessage(HttpMethod.Get, "/dibk/nabovarsel/api/v1/applicationmetadata");
            response           = await client.SendAsync(httpRequestMessage);

            responseContent = await response.Content.ReadAsStringAsync();

            Application application = (Application)JsonConvert.DeserializeObject(responseContent, typeof(Application));
            Assert.Equal(HttpStatusCode.OK, response.StatusCode);
            #endregion

            #region Get Message DataElement

            // In this application the message element is connected to Task_1. Find the datatype for this task and retrive this from storage
            DataType    dataType           = application.DataTypes.FirstOrDefault(r => r.TaskId != null && r.TaskId.Equals(instance.Process.CurrentTask.ElementId));
            DataElement dataElementMessage = instance.Data.FirstOrDefault(r => r.DataType.Equals(dataType.Id));
            httpRequestMessage = new HttpRequestMessage(HttpMethod.Get, instancePath + "/data/" + dataElementMessage.Id);
            response           = await client.SendAsync(httpRequestMessage);

            responseContent = await response.Content.ReadAsStringAsync();

            Melding melding = (Melding)JsonConvert.DeserializeObject(responseContent, typeof(Melding));
            Assert.Equal(HttpStatusCode.OK, response.StatusCode);
            Assert.Equal("Informasjon om tiltak", melding.MessageTitle);
            #endregion

            #region Get Status
            httpRequestMessage = new HttpRequestMessage(HttpMethod.Get, $"{instancePath}/process");
            response           = await client.SendAsync(httpRequestMessage);

            responseContent = await response.Content.ReadAsStringAsync();

            ProcessState processState = (ProcessState)JsonConvert.DeserializeObject(responseContent, typeof(ProcessState));
            Assert.Equal("Task_1", processState.CurrentTask.ElementId);
            #endregion

            #region Validate instance (the message element)
            httpRequestMessage = new HttpRequestMessage(HttpMethod.Get, $"{instancePath}/validate");
            response           = await client.SendAsync(httpRequestMessage);

            responseContent = await response.Content.ReadAsStringAsync();

            List <ValidationIssue> messages = (List <ValidationIssue>)JsonConvert.DeserializeObject(responseContent, typeof(List <ValidationIssue>));
            Assert.Empty(messages);
            #endregion

            // TODO. Add verification of not able to update message and check that statues is updated
            #region push to next step
            httpRequestMessage = new HttpRequestMessage(HttpMethod.Put, $"{instancePath}/process/next");
            response           = await client.SendAsync(httpRequestMessage);

            responseContent = await response.Content.ReadAsStringAsync();

            Assert.Equal(HttpStatusCode.OK, response.StatusCode);
            #endregion

            #region Get Status after next
            httpRequestMessage = new HttpRequestMessage(HttpMethod.Get, $"{instancePath}/process");
            response           = await client.SendAsync(httpRequestMessage);

            responseContent = await response.Content.ReadAsStringAsync();

            processState = (ProcessState)JsonConvert.DeserializeObject(responseContent, typeof(ProcessState));
            Assert.Equal("Task_2", processState.CurrentTask.ElementId);
            #endregion

            #region GetUpdated instance to check pdf
            httpRequestMessage = new HttpRequestMessage(HttpMethod.Get, instancePath);
            response           = await client.SendAsync(httpRequestMessage);

            responseContent = await response.Content.ReadAsStringAsync();

            instance = (Instance)JsonConvert.DeserializeObject(responseContent, typeof(Instance));
            IEnumerable <DataElement> lockedDataElements = instance.Data.Where(r => r.Locked == true);
            Assert.Single(lockedDataElements);
            #endregion

            #region Get Form DataElement

            dataType = application.DataTypes.FirstOrDefault(r => r.TaskId != null && r.TaskId.Equals(processState.CurrentTask.ElementId));

            DataElement dataElementForm = instance.Data.FirstOrDefault(r => r.DataType.Equals(dataType.Id));

            httpRequestMessage = new HttpRequestMessage(HttpMethod.Get, instancePath + "/data/" + dataElementForm.Id);

            response = await client.SendAsync(httpRequestMessage);

            responseContent = await response.Content.ReadAsStringAsync();

            SvarPaaNabovarselType skjema = (SvarPaaNabovarselType)JsonConvert.DeserializeObject(responseContent, typeof(SvarPaaNabovarselType));
            Assert.Equal(HttpStatusCode.OK, response.StatusCode);

            #endregion
            #region Update Form DataElement
            string        requestJson = JsonConvert.SerializeObject(skjema);
            StringContent httpContent = new StringContent(requestJson, Encoding.UTF8, "application/json");

            httpRequestMessage = new HttpRequestMessage(HttpMethod.Put, instancePath + "/data/" + dataElementForm.Id)
            {
                Content = httpContent
            };
            response = await client.SendAsync(httpRequestMessage);

            responseContent = await response.Content.ReadAsStringAsync();

            Assert.Equal(HttpStatusCode.Created, response.StatusCode);
            #endregion
            #region push to next step
            httpRequestMessage = new HttpRequestMessage(HttpMethod.Put, $"{instancePath}/process/next");
            response           = await client.SendAsync(httpRequestMessage);

            responseContent = await response.Content.ReadAsStringAsync();

            // Expect conflict since the form contains validation errors that needs to be resolved before moving to next task in process.
            Assert.Equal(HttpStatusCode.Conflict, response.StatusCode);
            #endregion

            #region Validate data in Task_2 (the form)
            httpRequestMessage = new HttpRequestMessage(HttpMethod.Get, $"{instancePath}/validate");
            response           = await client.SendAsync(httpRequestMessage);

            responseContent = await response.Content.ReadAsStringAsync();

            messages = (List <ValidationIssue>)JsonConvert.DeserializeObject(responseContent, typeof(List <ValidationIssue>));
            Assert.Single(messages);
            #endregion

            #region Update Form DataElement with missing value
            skjema.nabo        = new NaboGjenboerType();
            skjema.nabo.epost  = "*****@*****.**";
            requestJson        = JsonConvert.SerializeObject(skjema);
            httpContent        = new StringContent(requestJson, Encoding.UTF8, "application/json");
            httpRequestMessage = new HttpRequestMessage(HttpMethod.Put, instancePath + "/data/" + dataElementForm.Id)
            {
                Content = httpContent
            };
            response = await client.SendAsync(httpRequestMessage);

            responseContent = await response.Content.ReadAsStringAsync();

            Assert.Equal(HttpStatusCode.Created, response.StatusCode);
            #endregion

            #region push to confirm task
            httpRequestMessage = new HttpRequestMessage(HttpMethod.Put, $"{instancePath}/process/next");
            response           = await client.SendAsync(httpRequestMessage);

            responseContent = await response.Content.ReadAsStringAsync();

            Assert.Equal(HttpStatusCode.OK, response.StatusCode);
            #endregion

            #region Get Status after next
            httpRequestMessage = new HttpRequestMessage(HttpMethod.Get, $"{instancePath}/process");
            response           = await client.SendAsync(httpRequestMessage);

            responseContent = await response.Content.ReadAsStringAsync();

            processState = (ProcessState)JsonConvert.DeserializeObject(responseContent, typeof(ProcessState));
            Assert.Equal(HttpStatusCode.OK, response.StatusCode);
            Assert.Equal("Task_3", processState.CurrentTask.ElementId);
            #endregion

            #region push to end step
            httpRequestMessage = new HttpRequestMessage(HttpMethod.Put, $"{instancePath}/process/next");
            response           = await client.SendAsync(httpRequestMessage);

            responseContent = await response.Content.ReadAsStringAsync();

            Assert.Equal(HttpStatusCode.OK, response.StatusCode);
            #endregion

            #region Get Status after next
            httpRequestMessage = new HttpRequestMessage(HttpMethod.Get, $"{instancePath}/process");
            response           = await client.SendAsync(httpRequestMessage);

            responseContent = await response.Content.ReadAsStringAsync();

            processState = (ProcessState)JsonConvert.DeserializeObject(responseContent, typeof(ProcessState));
            Assert.Equal(HttpStatusCode.OK, response.StatusCode);
            Assert.Null(processState.CurrentTask);
            Assert.Equal("EndEvent_1", processState.EndEvent);
            #endregion

            TestDataUtil.DeleteInstanceAndData("dibk", "nabovarsel", 1337, new Guid(createdInstance.Id.Split('/')[1]));
        }
예제 #20
0
 public void addMelding(Melding melding)
 {
     throw new NotImplementedException();
 }
예제 #21
0
 public void updateMelding(Melding melding)
 {
     context.Entry(melding).State = EntityState.Modified;
     context.SaveChanges();
 }
예제 #22
0
 public void createMelding(Melding melding1)
 {
     context.Meldingen.Add(melding1);
     context.SaveChanges();
 }