public async Task <IActionResult> Create([Bind("BrandId,Name")] Brand brand) { if (ModelState.IsValid) { _context.Add(brand); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(brand)); }
public async Task <IActionResult> Create([Bind("SupplierId,Name,Address,Mobile")] Supplier supplier) { if (ModelState.IsValid) { _context.Add(supplier); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(supplier)); }
public async Task <IActionResult> Create([Bind("CategoryId,CategoryName,SubCategory,Description,SerialNo")] Category category) { if (ModelState.IsValid) { _context.Add(category); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(category)); }
public async Task <IActionResult> Create([Bind("ItemCode,ItemName,Category,SubCategory,SupplierId,BrandId,PurchasePrice,SalePrice,EexpireDate,SlideTitle,NewArrivalTitle,Picture")] Items items) { if (ModelState.IsValid) { _context.Add(items); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["BrandId"] = new SelectList(_context.Brand, "BrandId", "BrandId", items.BrandId); ViewData["Category"] = new SelectList(_context.Category, "CategoryName", "CategoryName", items.Category); ViewData["SupplierId"] = new SelectList(_context.Supplier, "SupplierId", "SupplierId", items.SupplierId); return(View(items)); }