public async Task <IActionResult> OnPostAsync()
        {
            if (!ModelState.IsValid)
            {
                return(Page());
            }
            var datefin = Tache.datedemarage.AddDays(Tache.nbjours);

            Console.WriteLine("datefin" + datefin);
            Jalon jalon = _context.jalon.Find(Tache.JalonID);

            if (jalon.datefinprevue != null && jalon.datefinprevue < datefin)
            {
                jalon.datefinprevue = datefin;
                _context.jalon.Update(jalon);
            }
            if (jalon.datefinprevue == null)
            {
                jalon.datefinprevue = datefin;
                _context.jalon.Update(jalon);
            }

            _context.taches.Add(Tache);
            await _context.SaveChangesAsync();

            return(RedirectToPage("./Index", new{ id = Tache.JalonID }));
        }
        public async Task <IActionResult> OnPostAsync()
        {
            if (!ModelState.IsValid)
            {
                return(Page());
            }

            _context.Attach(Resp).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!RespExists(Resp.RespID))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(RedirectToPage("./Index"));
        }
Beispiel #3
0
        public async Task <IActionResult> OnPostAsync()
        {
            if (!ModelState.IsValid)
            {
                return(Page());
            }

            _context.Attach(Exigeance).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!ExigeanceExists(Exigeance.ExigeanceID))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(RedirectToPage("./Index", new{ id = Exigeance.ProjetID }));
        }
Beispiel #4
0
        public async Task <IActionResult> OnPostAsync()
        {
            if (!ModelState.IsValid)
            {
                return(Page());
            }

            _context.Exigeance.Add(Exigeance);
            await _context.SaveChangesAsync();

            return(RedirectToPage("./Index/", new{ id = Exigeance.ProjetID }));
        }
        public async Task <IActionResult> OnPostAsync()
        {
            if (!ModelState.IsValid)
            {
                return(Page());
            }

            _context.Projets.Add(Projet);
            await _context.SaveChangesAsync();

            return(RedirectToPage("./Index"));
        }
        public async Task <IActionResult> OnPostAsync()
        {
            if (!ModelState.IsValid)
            {
                return(Page());
            }

            _context.jalon.Add(Jalon);
            await _context.SaveChangesAsync();

            return(RedirectToPage("./Index", new{ id = Jalon.ProjetiD }));
        }
        public async Task <IActionResult> OnPostAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            TypeExigeance = await _context.TypeExigeance.FindAsync(id);

            if (TypeExigeance != null)
            {
                _context.TypeExigeance.Remove(TypeExigeance);
                await _context.SaveChangesAsync();
            }

            return(RedirectToPage("./Index"));
        }
        public async Task <IActionResult> OnPostAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            Projet = await _context.Projets.FindAsync(id);

            if (Projet != null)
            {
                _context.Projets.Remove(Projet);
                await _context.SaveChangesAsync();
            }

            return(RedirectToPage("./Index"));
        }
        public async Task <IActionResult> OnPostAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            Jalon = await _context.jalon.FindAsync(id);

            if (Jalon != null)
            {
                _context.jalon.Remove(Jalon);
                await _context.SaveChangesAsync();
            }

            return(RedirectToPage("./Index", new{ id = Jalon.ProjetiD }));
        }