Exemplo n.º 1
0
        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));
        }
Exemplo n.º 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));
        }
Exemplo n.º 3
0
        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));
        }
Exemplo n.º 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));
        }