Ejemplo 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(PhoneNumber).State = EntityState.Modified;

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

            return(RedirectToPage("./Index"));
        }
Ejemplo 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.VoucherAccountLut.Add(VoucherAccountLut);
            await _context.SaveChangesAsync();

            return(RedirectToPage("./Index"));
        }
Ejemplo 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());
            }

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

            return(RedirectToPage("./Index"));
        }
Ejemplo 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());
            }

            var entry = _context.Add(new Member());

            entry.CurrentValues.SetValues(Member);
            await _context.SaveChangesAsync();

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            return(RedirectToPage("./Index"));
        }
Ejemplo 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 newIdentity = new MemberIdentity();

            newIdentity.WhenCreated        = DateTime.Now;
            newIdentity.MemberDetailsState = MemberDetailsState.Pending;
            newIdentity.MemberId           = 1;
            var entry = _context.Add(newIdentity);

            entry.CurrentValues.SetValues(MemberIdentity);
            await _context.SaveChangesAsync();

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

            //    Member = await _context.Member.FindAsync(id);

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

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

            var member = await _context.Member
                         .AsNoTracking()
                         .FirstOrDefaultAsync(m => m.Id == id);

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

            try
            {
                _context.Member.Remove(member);
                await _context.SaveChangesAsync();

                return(RedirectToPage("./Index"));
            }
            catch (DbUpdateException /* ex */)
            {
                //Log the error (uncomment ex variable name and write a log.)
                return(RedirectToAction("./Delete",
                                        new { id, saveChangesError = true }));
            }
        }