Exemple #1
0
        public async Task <IActionResult> Create([Bind("Id,Total,GiftTo,Bless,Date,ToDate")] Order order)
        {
            if (ModelState.IsValid)
            {
                _context.Add(order);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(order));
        }
Exemple #2
0
        public async Task <IActionResult> Create([Bind("Id,Name,Description,ImageUrl")] Stores stores)
        {
            if (ModelState.IsValid)
            {
                _context.Add(stores);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(stores));
        }
        public async Task <IActionResult> Create([Bind("Id,FirstName,LastName,Telephone,Email")] Contact contact)
        {
            if (ModelState.IsValid)
            {
                _context.Add(contact);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(contact));
        }
Exemple #4
0
        public async Task <IActionResult> Create([Bind("Id,UserName,Password,FirstName,LastName,Type,Telephone")] User user)
        {
            if (ModelState.IsValid)
            {
                _context.Add(user);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(user));
        }
Exemple #5
0
        public async Task <IActionResult> Create([Bind("Id,Name,Percentage")] Sale sale)
        {
            if (ModelState.IsValid)
            {
                _context.Add(sale);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(sale));
        }
Exemple #6
0
        public async Task <IActionResult> Create([Bind("Id,Name,ImageUrl")] Category category)
        {
            if (ModelState.IsValid)
            {
                _context.Add(category);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(category));
        }
Exemple #7
0
        public async Task <IActionResult> Create([Bind("StoreID,SaleId")] StoreSale storeSale)
        {
            if (ModelState.IsValid)
            {
                _context.Add(storeSale);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["StoreID"] = new SelectList(_context.Set <Sale>(), "Id", "Name", storeSale.StoreID);
            ViewData["SaleId"]  = new SelectList(_context.Stores, "Id", "Name", storeSale.SaleId);
            return(View(storeSale));
        }