예제 #1
0
        public async Task <IActionResult> Create([Bind("FranchisorNo,FranchisorName,FranchisorAddress,FranchisorPostcode,FranchisorTel,FranchisorFax")] Franchisors franchisors)
        {
            if (ModelState.IsValid)
            {
                _context.Add(franchisors);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(franchisors));
        }
예제 #2
0
        public async Task <IActionResult> Create([Bind("ItemNo,ItemDescription,ItemGender,ItemColour,ItemSize,ItemWholesalePrice,ItemRetailPrice")] Items items)
        {
            if (ModelState.IsValid)
            {
                _context.Add(items);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(items));
        }
        public async Task <IActionResult> Create([Bind("HometypeCode,HometypeDescription")] Hometypes hometypes)
        {
            if (ModelState.IsValid)
            {
                _context.Add(hometypes);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(hometypes));
        }
        public async Task <IActionResult> Create([Bind("FranchiseNo,PartnerName")] Partners partners)
        {
            if (ModelState.IsValid)
            {
                _context.Add(partners);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["FranchiseNo"] = new SelectList(_context.Franchises, "FranchiseNo", "FranchiseNo", partners.FranchiseNo);
            return(View(partners));
        }
        public async Task <IActionResult> Create([Bind("FranchiseNo,FranchiseName,FranchiseAddress,FranchisePostcode,FranchiseTel,FranchiseFax,FranchiseStartdate,FranchisorNo")] Franchises franchises)
        {
            if (ModelState.IsValid)
            {
                _context.Add(franchises);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["FranchisorNo"] = new SelectList(_context.Franchisors, "FranchisorNo", "FranchisorNo", franchises.FranchisorNo);
            return(View(franchises));
        }
예제 #6
0
        public async Task <IActionResult> Create([Bind("HomeNo,HomeName,HometypeCode,HomeAddress,HomePostcode,HomeTel")] Homes homes)
        {
            if (ModelState.IsValid)
            {
                _context.Add(homes);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["HometypeCode"] = new SelectList(_context.Hometypes, "HometypeCode", "HometypeCode", homes.HometypeCode);
            return(View(homes));
        }
예제 #7
0
        public async Task <IActionResult> Create([Bind("FranchiseNo,HomeNo,ShowDate,ShowTime,ShowTotalSale")] Shows shows)
        {
            if (ModelState.IsValid)
            {
                _context.Add(shows);
                await _context.SaveChangesAsync();

                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));
        }
예제 #8
0
        public async Task <IActionResult> Create([Bind("InvoiceNo,InvoiceDate,InvoiceDateDue,InvoiceNet,FranchiseNo,OrderNo")] Invoices invoices)
        {
            if (ModelState.IsValid)
            {
                _context.Add(invoices);
                await _context.SaveChangesAsync();

                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));
        }
예제 #9
0
        public async Task <IActionResult> Create([Bind("OrderNo,ItemNo,OrderQuantity")] Orderlines orderlines)
        {
            if (ModelState.IsValid)
            {
                _context.Add(orderlines);
                await _context.SaveChangesAsync();

                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));
        }
        public async Task <IActionResult> Create([Bind("FranchiseNo,HomeNo,ShowDate,ItemNo,SaleQuantity")] Saleitems saleitems)
        {
            if (ModelState.IsValid)
            {
                _context.Add(saleitems);
                await _context.SaveChangesAsync();

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