예제 #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));
        }
예제 #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));
        }
예제 #3
0
        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));
        }
예제 #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));
        }
예제 #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));
        }
예제 #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));
        }
예제 #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));
        }