public async Task <IActionResult> Edit(int id, [Bind("Id,Code,Name")] BbsProvince bbsProvince)
        {
            if (id != bbsProvince.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(bbsProvince);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!BbsProvinceExists(bbsProvince.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(bbsProvince));
        }
Beispiel #2
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,Username,Password,Gender,Email,RealName,RegisterTime,Province,City,Town,Addr,IsDel")] BbsBuyer bbsBuyer)
        {
            if (id != bbsBuyer.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(bbsBuyer);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!BbsBuyerExists(bbsBuyer.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(bbsBuyer));
        }
Beispiel #3
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,Name,Description,ImgUrl,WebSite,Sort,IsDisplay")] BbsBrand bbsBrand)
        {
            if (id != bbsBrand.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(bbsBrand);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!BbsBrandExists(bbsBrand.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(bbsBrand));
        }
Beispiel #4
0
        public async Task <IActionResult> Edit(string id, [Bind("Username,Password,Degree,Email,Gender,ImgUrl,Phone,RealName,School,IsDel")] BbsEmployee bbsEmployee)
        {
            if (id != bbsEmployee.Username)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(bbsEmployee);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!BbsEmployeeExists(bbsEmployee.Username))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(bbsEmployee));
        }
        public async Task <IActionResult> Edit(int id, [Bind("Id,BuyerId,Name,City,Addr,Phone,IsDef")] BbsAddr bbsAddr)
        {
            if (id != bbsAddr.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(bbsAddr);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!BbsAddrExists(bbsAddr.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["BuyerId"] = new SelectList(_context.BbsBuyer, "Username", "Username", bbsAddr.BuyerId);
            return(View(bbsAddr));
        }
        public async Task <IActionResult> Edit(int id, [Bind("Id,No,Name,Weight,IsNew,IsHot,IsCommend,CreateTime,CreateUserId,CheckTime,CheckUserId,IsShow,IsDel,TypeId,BrandId,Keywords,Sales,Description,PackageList,Feature,Color,Size")] BbsProduct bbsProduct)
        {
            if (id != bbsProduct.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(bbsProduct);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!BbsProductExists(bbsProduct.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["BrandId"] = new SelectList(_context.BbsBrand, "Id", "Id", bbsProduct.BrandId);
            ViewData["TypeId"]  = new SelectList(_context.BbsType, "Id", "Id", bbsProduct.TypeId);
            return(View(bbsProduct));
        }