Exemple #1
0
        public async Task <IActionResult> Create([Bind("Id,Customer_Id,Type,Condition,Value")] Notification_Rule notification_Rule)
        {
            if (ModelState.IsValid)
            {
                _context.Add(notification_Rule);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(notification_Rule));
        }
Exemple #2
0
        public async Task <IActionResult> Create([Bind("Id,Transaction_Id,Notification_Rule,Message")] Notification notification)
        {
            if (ModelState.IsValid)
            {
                _context.Add(notification);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(notification));
        }
Exemple #3
0
        public async Task <IActionResult> Create([Bind("Id,First_Name,Last_Name,Date_Of_Birth,Address,City,State,Zip")] Customer_Info customer_Info)
        {
            if (ModelState.IsValid)
            {
                _context.Add(customer_Info);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(customer_Info));
        }
Exemple #4
0
        public async Task <IActionResult> Create([Bind("Id,Account_Type,Nickname,Interest_rate,Balance")] Account account)
        {
            if (ModelState.IsValid)
            {
                _context.Add(account);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(account));
        }
        public async Task <IActionResult> Create([Bind("Id,Account_Id,TimeStamp,Type,Description,Amount,Balance_After")] Financial_Transaction financial_Transaction)
        {
            if (ModelState.IsValid)
            {
                _context.Add(financial_Transaction);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(financial_Transaction));
        }
        public async Task <IActionResult> Create([Bind("Id,UserName,NormalizedUserName,Email,NormalizedEmail,EmailConfirmed,PasswordHash,SecurityStamp,ConcurrencyStamp,PhoneNumber,PhoneNumberConfirmed,TwoFactorEnabled,LockoutEnd,LockoutEnabled,AccessFailedCount")] AspNetUsers aspNetUsers)
        {
            if (ModelState.IsValid)
            {
                _context.Add(aspNetUsers);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(aspNetUsers));
        }
Exemple #7
0
        public async Task <IActionResult> Create([Bind("Customer_Id,Account_Id")] Customer_Account customer_account)
        {
            if (ModelState.IsValid)
            {
                _context.Add(customer_account);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(customer_account));
        }
Exemple #8
0
        public async Task <ActionResult <IEnumerable <Cliente> > > PostClientes(Cliente newCliente)
        {
            var varCliente = await _context.Clientes.FindAsync(newCliente.Id);

            if (varCliente != null)
            {
                return(BadRequest());
            }
            else
            {
                _context.Clientes.Add(newCliente);
                await _context.SaveChangesAsync();

                return(CreatedAtAction(nameof(GetClientes), new { id = newCliente.Id }, newCliente));
            }
        }
        public async Task <ActionResult <IEnumerable <Producto> > > PostClientes(Producto newProducto)
        {
            var varProducto = await _context.Productos.FindAsync(newProducto.Id);

            if (varProducto != null)
            {
                return(NotFound());
            }
            else
            {
                _context.Productos.Add(newProducto);
                await _context.SaveChangesAsync();

                return(CreatedAtAction(nameof(GetProductos), new { id = newProducto.Id }, newProducto));
            }
        }