Ejemplo n.º 1
0
        public async Task <IActionResult> Create([Bind("ID,ClientID,FoodID,Address,Numb,TotalCost,Ordertime")] Order order)
        {
            if (ModelState.IsValid)
            {
                _context.Add(order);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(order));
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> Create([Bind("NewsID,Title,Text")] News news)
        {
            if (ModelState.IsValid)
            {
                _context.Add(news);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(news));
        }
Ejemplo n.º 3
0
        public async Task <IActionResult> Create([Bind("PartnerID,CompanyName,Description,Link")] Partners partners)
        {
            if (ModelState.IsValid)
            {
                _context.Add(partners);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(partners));
        }
Ejemplo n.º 4
0
        public async Task <IActionResult> Create([Bind("ID,LastName,FirstName,PhoneNumber,Password,SignDate")] Client client)
        {
            if (ModelState.IsValid)
            {
                _context.Add(client);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(client));
        }
Ejemplo n.º 5
0
        public async Task <IActionResult> Create([Bind("ID,LastName,FirstName,PhoneNumber,Password,RateOutOfTen")] Employee employee)
        {
            if (ModelState.IsValid)
            {
                _context.Add(employee);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(employee));
        }
Ejemplo n.º 6
0
        public async Task <IActionResult> Create([Bind("FoodID,Title,Cost")] Food food)
        {
            if (ModelState.IsValid)
            {
                _context.Add(food);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(food));
        }