コード例 #1
0
        public async Task <IActionResult> Create([Bind("StockID,Category,Price,AvalibleSize")] AvalibleStock avalibleStock)
        {
            if (ModelState.IsValid)
            {
                _context.Add(avalibleStock);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(avalibleStock));
        }
コード例 #2
0
        public async Task <IActionResult> Create([Bind("EmployeeID,EmployeeName,Address,MobileNumber,ShiftStart,ShiftFinish")] OurEmployee ourEmployee)
        {
            if (ModelState.IsValid)
            {
                _context.Add(ourEmployee);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(ourEmployee));
        }
コード例 #3
0
        public async Task <IActionResult> Create([Bind("ID,ClientID,StockID")] OnlineSale onlineSale)
        {
            if (ModelState.IsValid)
            {
                _context.Add(onlineSale);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["ClientID"] = new SelectList(_context.RegularClient, "ClientID", "ClientID", onlineSale.ClientID);
            ViewData["StockID"]  = new SelectList(_context.AvalibleStock, "StockID", "StockID", onlineSale.StockID);
            return(View(onlineSale));
        }