Exemplo n.º 1
0
        // To protect from overposting attacks, please 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(DressSize).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!DressSizeExists(DressSize.Id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

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

            BlouseModel = await _context.BlouseModel
                          .AsNoTracking()
                          .FirstOrDefaultAsync(m => m.Id == id);

            if (BlouseModel == null)
            {
                return(NotFound());
            }

            try
            {
                _context.BlouseModel.Remove(BlouseModel);
                await _context.SaveChangesAsync();

                return(RedirectToPage("./Index"));
            }
            catch (DbUpdateException)
            {
                return(RedirectToPage("./Delete",
                                      new { id, saveChangesError = true }));
            }
        }
Exemplo n.º 3
0
        // To protect from overposting attacks, please 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.CoatModel.Add(CoatModel);
            await _context.SaveChangesAsync();

            return(RedirectToPage("./Index"));
        }
Exemplo n.º 4
0
        // To protect from overposting attacks, please 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.HighHeeledShoesColors.Add(HighHeeledShoesColors);
            await _context.SaveChangesAsync();

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

            if (await TryUpdateModelAsync <Blouse>(
                    blouseToUpdate,
                    "blouse",
                    b => b.Brand))
            {
                await _context.SaveChangesAsync();

                return(RedirectToPage("./Index"));
            }
            _context.Attach(Blouse).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!BlouseExists(Blouse.Id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            return(RedirectToPage("./Index"));
        }
Exemplo n.º 13
0
        // To protect from overposting attacks, please 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 emptyBlouse = new Blouse();

            if (await TryUpdateModelAsync <Blouse>(emptyBlouse,
                                                   "blouse",
                                                   b => b.Brand))
            {
                _context.Blouse.Add(emptyBlouse);
                await _context.SaveChangesAsync();

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

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

            var modelToUpdate = await _context.BlouseModel.FindAsync(id);

            if (await TryUpdateModelAsync <BlouseModel>(
                    modelToUpdate,
                    "BlouseModel",
                    n => n.Name))
            {
                await _context.SaveChangesAsync();

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

            return(Page());
        }