Exemplo n.º 1
0
        public async Task <IActionResult> Edit(int id, [Bind("BranchID,BranchName,Address,OpeningTime,CloseingTime")] Banch banch)
        {
            if (id != banch.BranchID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(banch);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!BanchExists(banch.BranchID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(banch));
        }
Exemplo n.º 2
0
        public async Task <IActionResult> Edit(int id, [Bind("PurchaserID,FirstName,LastName,Address,Phone,DOB")] Purchaser purchaser)
        {
            if (id != purchaser.PurchaserID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(purchaser);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!PurchaserExists(purchaser.PurchaserID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(purchaser));
        }
Exemplo n.º 3
0
        public async Task <IActionResult> Edit(int id, [Bind("SaleManId,SaleManName,BikeAmount,SaleDate")] SaleMan saleMan)
        {
            if (id != saleMan.SaleManId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(saleMan);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!SaleManExists(saleMan.SaleManId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(saleMan));
        }
Exemplo n.º 4
0
        public async Task <IActionResult> Edit(int id, [Bind("ID,PurchaserID,BanchID")] BikeSale bikeSale)
        {
            if (id != bikeSale.ID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(bikeSale);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!BikeSaleExists(bikeSale.ID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["BanchID"]     = new SelectList(_context.Banch, "BranchID", "BranchName", bikeSale.BanchID);
            ViewData["PurchaserID"] = new SelectList(_context.Purchaser, "PurchaserID", "FirstName", bikeSale.PurchaserID);
            return(View(bikeSale));
        }