public async Task <IActionResult> Edit(int id, [Bind("Id,AssetBrandName")] AssetBrand assetBrand) { if (id != assetBrand.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(assetBrand); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!AssetBrandExists(assetBrand.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(assetBrand)); }
public async Task <IActionResult> Create([Bind("Id,AssetBrandName")] AssetBrand assetBrand) { if (ModelState.IsValid) { _context.Add(assetBrand); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(assetBrand)); }
public async Task <IActionResult> Create([Bind("AssetBrandId,Code,Name,CreateBy,CreateDate,UpdateBy,UpdateDate,IsActive,IsDelete")] AssetBrand assetBrand) { if (ModelState.IsValid) { _context.Add(assetBrand); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(assetBrand)); }