public async Task <IActionResult> Create([Bind("Id,Name,RegistereddDate")] PrepaidCustomer prepaidCustomer)
        {
            if (ModelState.IsValid)
            {
                _context.Add(prepaidCustomer);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(prepaidCustomer));
        }
示例#2
0
        public async Task <IActionResult> Create([Bind("Id,Name,Description")] TopUpChannel topUpChannel)
        {
            if (ModelState.IsValid)
            {
                _context.Add(topUpChannel);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(topUpChannel));
        }
示例#3
0
        public async Task <IActionResult> Create([Bind("Id,Number,Balance,PrepaidCustomerId")] MobileAccount mobileAccount)
        {
            if (ModelState.IsValid)
            {
                _context.Add(mobileAccount);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["PrepaidCustomerId"] = new SelectList(_context.Set <PrepaidCustomer>(), "Id", "Id", mobileAccount.PrepaidCustomerId);
            return(View(mobileAccount));
        }
示例#4
0
        public async Task <IActionResult> Create([Bind("Id,MobileAccountId,TopUpChannelId,TopUpAmount")] TopUp topUp)
        {
            if (ModelState.IsValid)
            {
                _context.Add(topUp);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["MobileAccountId"] = new SelectList(_context.MobileAccount, "Id", "Id", topUp.MobileAccountId);
            ViewData["TopUpChannelId"]  = new SelectList(_context.Set <TopUpChannel>(), "Id", "Id", topUp.TopUpChannelId);
            return(View(topUp));
        }