Пример #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(TopUp).State = EntityState.Modified;

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

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

            return(RedirectToPage("./Index"));
        }
Пример #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.MobileAccount.Add(MobileAccount);
            await _context.SaveChangesAsync();

            return(RedirectToPage("./Index"));
        }
Пример #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.TopUpChannel.Add(TopUpChannel);
            await _context.SaveChangesAsync();

            return(RedirectToPage("./Index"));
        }
Пример #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()
        {
            if (!ModelState.IsValid)
            {
                return(Page());
            }

            var mobile = (from account in _context.MobileAccount
                          where account.Id == TopUp.MobileAccountId select account).FirstOrDefault();

            mobile.Balance = mobile.Balance + TopUp.TopUpAmount;
            _context.TopUp.Add(TopUp);
            await _context.SaveChangesAsync();

            return(RedirectToPage("./Index"));
        }
Пример #6
0
        public async Task <IActionResult> OnPostAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

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

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

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

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

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

            return(RedirectToPage("./Index"));
        }
Пример #8
0
        public async Task <IActionResult> OnPostAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

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

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

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