public async Task <IActionResult> Create([Bind("idPosition,width,height")] Position position) { if (ModelState.IsValid) { _context.Add(position); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(position)); }
public async Task <IActionResult> Create([Bind("IdBrand,NameBrand")] Brand brand) { if (ModelState.IsValid) { _context.Add(brand); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(brand)); }
public async Task <IActionResult> Create([Bind("idCategory,nameCategory,link_imageCategory,Sex")] Category category) { if (ModelState.IsValid) { _context.Add(category); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(category)); }
public async Task <IActionResult> Create([Bind("idMerchant,lstname,fstname,storename,phone,website,stt")] Model.Users.Merchant merchant) { if (ModelState.IsValid) { _context.Add(merchant); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(merchant)); }
public async Task <IActionResult> Create([Bind("idAccount,username,passwd,avt_path,rate,rankVip,IdMerchant,idCustomer")] Account account) { if (ModelState.IsValid) { _context.Add(account); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } //ViewData["idCustomer"] = new SelectList(_context.Customers, "idCustomer", "idCustomer", account.idCustomer); //ViewData["IdMerchant"] = new SelectList(_context.Merchants, "idMerchant", "idMerchant", account.IdMerchant); return(View(account)); }
public async Task <IActionResult> Create([Bind("idProduct,nameProduct,Code,Description,Image,Size,Sex,OldPrice,Price,Creat_date,Count,Fee,Home,Status,View,Color,idCategory,idAccount,IdRepository,IdBrand")] Product product) { if (ModelState.IsValid) { _context.Add(product); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["idAccount"] = new SelectList(_context.Accounts, "idAccount", "idAccount", product.idAccount); ViewData["IdBrand"] = new SelectList(_context.Brands, "IdBrand", "IdBrand", product.IdBrand); ViewData["idCategory"] = new SelectList(_context.Categories, "idCategory", "idCategory", product.idCategory); ViewData["IdRepository"] = new SelectList(_context.Repositories, "idRepository", "idRepository", product.IdRepository); return(View(product)); }