Exemplo n.º 1
0
        // To protect from overposting attacks, enable the specific properties you want to bind to, for
        // more details, see https://aka.ms/RazorPagesCRUD.
        public async Task <IActionResult> OnPostAsync()
        {
            if (!ModelState.IsValid)
            {
                return(Page());
            }

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

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!DeviceCompositionExists(DeviceComposition.ID))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(RedirectToPage("./Index"));
        }
Exemplo n.º 2
0
        // To protect from overposting attacks, enable the specific properties you want to bind to, for
        // more details, see https://aka.ms/RazorPagesCRUD.
        public async Task <IActionResult> OnPostAsync()
        {
            if (!ModelState.IsValid)
            {
                return(Page());
            }

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

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!NirInnovationRateExists(NirInnovationRate.NirScaleID, NirInnovationRate.NirInnovationPropertyID))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(RedirectToPage("./Index"));
        }
Exemplo n.º 3
0
        // To protect from overposting attacks, enable the specific properties you want to bind to, for
        // more details, see https://aka.ms/RazorPagesCRUD.
        public async Task <IActionResult> OnPostAsync()
        {
            if (!ModelState.IsValid)
            {
                return(Page());
            }

            var okrInnovationRate = await _context.OkrInnovationRates
                                    .Where(n => n.OkrInnovationPropertyID == Okr.OkrInnovationPropertyID)
                                    .Where(n => n.DeviceCompositionID == Okr.DeviceCompositionID)
                                    .FirstOrDefaultAsync();

            var deviceComplexityRate = await _context.DeviceComplexityRates
                                       .Where(n => n.DeviceCompositionID == Okr.DeviceCompositionID)
                                       .Where(n => n.DeviceCountRangeID == Okr.DeviceCountRangeID)
                                       .FirstOrDefaultAsync();

            Okr.DeviceComplexityRateID = deviceComplexityRate.ID;
            Okr.OkrInnovationRateID    = okrInnovationRate.ID;

            _context.Okrs.Add(Okr);
            await _context.SaveChangesAsync();

            return(RedirectToPage("./Index"));
        }
Exemplo n.º 4
0
        // To protect from overposting attacks, enable the specific properties you want to bind to, for
        // more details, see https://aka.ms/RazorPagesCRUD.
        public async Task <IActionResult> OnPostAsync()
        {
            if (!ModelState.IsValid)
            {
                return(Page());
            }

            _context.DeviceCountRanges.Add(DeviceCountRange);
            await _context.SaveChangesAsync();

            return(RedirectToPage("./Index"));
        }
Exemplo n.º 5
0
        // To protect from overposting attacks, enable the specific properties you want to bind to, for
        // more details, see https://aka.ms/RazorPagesCRUD.
        public async Task <IActionResult> OnPostAsync()
        {
            if (!ModelState.IsValid)
            {
                return(Page());
            }

            _context.OkrInnovationProperties.Add(OkrInnovationProperty);
            await _context.SaveChangesAsync();

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

            DeviceCountRange = await _context.DeviceCountRanges.FindAsync(id);

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

            return(RedirectToPage("./Index"));
        }
Exemplo n.º 7
0
        public async Task <IActionResult> OnPostAsync(int?nirID, int?nirInnovationPropertyID)
        {
            if (nirID == null || nirInnovationPropertyID == null)
            {
                return(NotFound());
            }

            NirInnovationRate = await _context.NirInnovationRates.FindAsync(nirID, nirInnovationPropertyID);

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

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

            OkrInnovationProperty = await _context.OkrInnovationProperties.FindAsync(id);

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

            return(RedirectToPage("./Index"));
        }
Exemplo n.º 9
0
        public async Task <IActionResult> OnPostAsync(int?okrInnovationPropertyID, int?deviceCompositionID)
        {
            if (okrInnovationPropertyID == null || deviceCompositionID == null)
            {
                return(NotFound());
            }

            OkrInnovationRate = await _context.OkrInnovationRates
                                .FindAsync(okrInnovationPropertyID, deviceCompositionID);

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

            return(RedirectToPage("./Index"));
        }
Exemplo n.º 10
0
        // To protect from overposting attacks, enable the specific properties you want to bind to, for
        // more details, see https://aka.ms/RazorPagesCRUD.
        public async Task <IActionResult> OnPostAsync()
        {
            if (!ModelState.IsValid)
            {
                return(Page());
            }

            var okrInnovationRate = await _context.OkrInnovationRates
                                    .Where(n => n.OkrInnovationPropertyID == Okr.OkrInnovationPropertyID)
                                    .Where(n => n.DeviceCompositionID == Okr.DeviceCompositionID)
                                    .FirstOrDefaultAsync();

            var deviceComplexityRate = await _context.DeviceComplexityRates
                                       .Where(n => n.DeviceCompositionID == Okr.DeviceCompositionID)
                                       .Where(n => n.DeviceCountRangeID == Okr.DeviceCountRangeID)
                                       .FirstOrDefaultAsync();

            Okr.DeviceComplexityRateID = deviceComplexityRate.ID;
            Okr.OkrInnovationRateID    = okrInnovationRate.ID;

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

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!OkrExists(Okr.ID))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(RedirectToPage("./Index"));
        }