public async Task <IActionResult> Create([Bind("ID,Name,Email,Telephone,BirthDay,Sallary")] SalesAdvisor salesAdvisor) { if (ModelState.IsValid) { _context.Add(salesAdvisor); await _context.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(salesAdvisor)); }
public async Task <IActionResult> Create([Bind("ID,Rate,Easy,Friendly,EnoughInfo,Recomend,Suggestion,SalesOrderId")] Survey survey) { if (ModelState.IsValid) { _context.Add(survey); await _context.SaveChangesAsync(); return(RedirectToAction("Index")); } ViewData["SalesOrderId"] = new SelectList(_context.SalesOrder, "ID", "ID", survey.SalesOrderId); return(View(survey)); }
public async Task <IActionResult> Create([Bind("ID,ProductName,SalePrice,SaleDate,SalesAdvisorId,CustomerId")] SalesOrder salesOrder) { if (ModelState.IsValid) { _context.Add(salesOrder); await _context.SaveChangesAsync(); 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)); }