예제 #1
0
        public async Task <IActionResult> Edit(string id, [Bind("Cid,Pid,SellPrice")] Sell sell)
        {
            if (id != sell.Cid)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(sell);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!SellExists(sell.Cid))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(sell));
        }
예제 #2
0
        public async Task <IActionResult> Create([Bind("Sid,Sname,Stel,Sfax,Scity")] Suppliers suppliers)
        {
            if (ModelState.IsValid)
            {
                _contextSupplier.Add(suppliers);
                await _contextSupplier.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(suppliers));
        }
예제 #3
0
        public async Task <IActionResult> Create([Bind("Cid,Cname,Ctel,Cfax,Ccity")] Customers customers)
        {
            if (ModelState.IsValid)
            {
                _contextCustomer.Add(customers);
                await _contextCustomer.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(customers));
        }
예제 #4
0
        public async Task <IActionResult> Create([Bind("Spid,Sid,Spname,Specification,Spunit,Spprice")] Purchase purchase)
        //public ActionResult Create([Bind("Spid,Sid,Spname,Spunit")] Purchase purchase)
        {
            if (ModelState.IsValid)
            {
                _context.Add(purchase);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(purchase));
        }