public async Task <IActionResult> Create([Bind("BranchID,BranchName,Address,OpeningTime,CloseingTime")] Banch banch)
        {
            if (ModelState.IsValid)
            {
                _context.Add(banch);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(banch));
        }
Beispiel #2
0
        public async Task <IActionResult> Create([Bind("PurchaserID,FirstName,LastName,Address,Phone,DOB")] Purchaser purchaser)
        {
            if (ModelState.IsValid)
            {
                _context.Add(purchaser);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(purchaser));
        }
        public async Task <IActionResult> Create([Bind("SaleManId,SaleManName,BikeAmount,SaleDate")] SaleMan saleMan)
        {
            if (ModelState.IsValid)
            {
                _context.Add(saleMan);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(saleMan));
        }
Beispiel #4
0
        public async Task <IActionResult> Create([Bind("ID,PurchaserID,BanchID")] BikeSale bikeSale)
        {
            if (ModelState.IsValid)
            {
                _context.Add(bikeSale);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["BanchID"]     = new SelectList(_context.Banch, "BranchID", "BranchID", bikeSale.BanchID);
            ViewData["PurchaserID"] = new SelectList(_context.Purchaser, "PurchaserID", "PurchaserID", bikeSale.PurchaserID);
            return(View(bikeSale));
        }