public async Task <IActionResult> Edit(string id, [Bind("FranchiseNo,PartnerName")] Partners partners)
        {
            if (id != partners.FranchiseNo)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(partners);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!PartnersExists(partners.FranchiseNo))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["FranchiseNo"] = new SelectList(_context.Franchises, "FranchiseNo", "FranchiseNo", partners.FranchiseNo);
            return(View(partners));
        }
        public async Task <IActionResult> Edit(string id, [Bind("FranchiseNo,FranchiseName,FranchiseAddress,FranchisePostcode,FranchiseTel,FranchiseFax,FranchiseStartdate,FranchisorNo")] Franchises franchises)
        {
            if (id != franchises.FranchiseNo)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(franchises);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!FranchisesExists(franchises.FranchiseNo))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["FranchisorNo"] = new SelectList(_context.Franchisors, "FranchisorNo", "FranchisorNo", franchises.FranchisorNo);
            return(View(franchises));
        }
        public async Task <IActionResult> Edit(string id, [Bind("FranchiseNo,HomeNo,ShowDate,ShowTime,ShowTotalSale")] Shows shows)
        {
            if (id != shows.FranchiseNo)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(shows);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ShowsExists(shows.FranchiseNo))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["FranchiseNo"] = new SelectList(_context.Franchises, "FranchiseNo", "FranchiseNo", shows.FranchiseNo);
            ViewData["HomeNo"]      = new SelectList(_context.Homes, "HomeNo", "HomeAddress", shows.HomeNo);
            return(View(shows));
        }
Exemple #4
0
        public async Task <IActionResult> Edit(string id, [Bind("OrderNo,ItemNo,OrderQuantity")] Orderlines orderlines)
        {
            if (id != orderlines.OrderNo)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(orderlines);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!OrderlinesExists(orderlines.OrderNo))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["ItemNo"]  = new SelectList(_context.Items, "ItemNo", "ItemNo", orderlines.ItemNo);
            ViewData["OrderNo"] = new SelectList(_context.Orders, "OrderNo", "OrderNo", orderlines.OrderNo);
            return(View(orderlines));
        }
Exemple #5
0
        public async Task <IActionResult> Edit(string id, [Bind("InvoiceNo,InvoiceDate,InvoiceDateDue,InvoiceNet,FranchiseNo,OrderNo")] Invoices invoices)
        {
            if (id != invoices.InvoiceNo)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(invoices);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!InvoicesExists(invoices.InvoiceNo))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["FranchiseNo"] = new SelectList(_context.Franchises, "FranchiseNo", "FranchiseNo", invoices.FranchiseNo);
            ViewData["OrderNo"]     = new SelectList(_context.Orders, "OrderNo", "OrderNo", invoices.OrderNo);
            return(View(invoices));
        }
Exemple #6
0
        public async Task <IActionResult> Edit(string id, [Bind("FranchisorNo,FranchisorName,FranchisorAddress,FranchisorPostcode,FranchisorTel,FranchisorFax")] Franchisors franchisors)
        {
            if (id != franchisors.FranchisorNo)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(franchisors);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!FranchisorsExists(franchisors.FranchisorNo))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(franchisors));
        }
Exemple #7
0
        public async Task <IActionResult> Edit(string id, [Bind("ItemNo,ItemDescription,ItemGender,ItemColour,ItemSize,ItemWholesalePrice,ItemRetailPrice")] Items items)
        {
            if (id != items.ItemNo)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(items);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ItemsExists(items.ItemNo))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(items));
        }
        public async Task <IActionResult> Edit(string id, [Bind("FranchiseNo,HomeNo,ShowDate,ItemNo,SaleQuantity")] Saleitems saleitems)
        {
            if (id != saleitems.FranchiseNo)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(saleitems);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!SaleitemsExists(saleitems.FranchiseNo))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["ItemNo"]      = new SelectList(_context.Items, "ItemNo", "ItemNo", saleitems.ItemNo);
            ViewData["FranchiseNo"] = new SelectList(_context.Shows, "FranchiseNo", "FranchiseNo", saleitems.FranchiseNo);
            return(View(saleitems));
        }
        public async Task <IActionResult> Edit(int id, [Bind("HomeNo,HomeName,HometypeCode,HomeAddress,HomePostcode,HomeTel")] Homes homes)
        {
            if (id != homes.HomeNo)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(homes);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!HomesExists(homes.HomeNo))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["HometypeCode"] = new SelectList(_context.Hometypes, "HometypeCode", "HometypeCode", homes.HometypeCode);
            return(View(homes));
        }
        public async Task <IActionResult> Edit(string id, [Bind("HometypeCode,HometypeDescription")] Hometypes hometypes)
        {
            if (id != hometypes.HometypeCode)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(hometypes);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!HometypesExists(hometypes.HometypeCode))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(hometypes));
        }