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)); }
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)); }
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)); }