Esempio n. 1
0
        public async Task <IActionResult> Edit(int id, [Bind("ID,Name,Email,Telephone,BirthDay,Sallary")] SalesAdvisor salesAdvisor)
        {
            if (id != salesAdvisor.ID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(salesAdvisor);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!SalesAdvisorExists(salesAdvisor.ID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction("Index"));
            }
            return(View(salesAdvisor));
        }
Esempio n. 2
0
        public async Task <IActionResult> Edit(int id, [Bind("ID,ProductName,SalePrice,SaleDate,SalesAdvisorId,CustomerId")] SalesOrder salesOrder)
        {
            if (id != salesOrder.ID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(salesOrder);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!SalesOrderExists(salesOrder.ID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction("Index"));
            }
            ViewData["CustomerId"]     = new SelectList(_context.Customer, "ID", "ID", salesOrder.CustomerId);
            ViewData["SalesAdvisorId"] = new SelectList(_context.SalesAdvisor, "ID", "ID", salesOrder.SalesAdvisorId);
            return(View(salesOrder));
        }
Esempio n. 3
0
        public async Task <IActionResult> Edit(int id, [Bind("ID,Rate,Easy,Friendly,EnoughInfo,Recomend,Suggestion,SalesOrderId")] Survey survey)
        {
            if (id != survey.ID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(survey);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!SurveyExists(survey.ID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction("Index"));
            }
            ViewData["SalesOrderId"] = new SelectList(_context.SalesOrder, "ID", "ID", survey.SalesOrderId);
            return(View(survey));
        }