public async Task <IActionResult> Create([Bind("CompanyId,CompanyName,Email,Active,City,Country")] Company company) { if (ModelState.IsValid) { _context.Add(company); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(company)); }
public async Task <IActionResult> Create([Bind("PackageTypeId,PackagingType,Description")] PackageType packageType) { if (ModelState.IsValid) { _context.Add(packageType); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(packageType)); }
public async Task <IActionResult> Create([Bind("GoodsTypeId,GoodType,Description")] GoodsType goodsType) { if (ModelState.IsValid) { _context.Add(goodsType); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(goodsType)); }
public async Task <IActionResult> Create([Bind("companyGoodsPackageId,CompanyId,PackageTypeid,GoodsTypeId,PackagingDate")] CompanyGoodsPackage companyGoodsPackage) { if (ModelState.IsValid) { _context.Add(companyGoodsPackage); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["CompanyId"] = new SelectList(_context.Company, "CompanyId", "CompanyId", companyGoodsPackage.CompanyId); ViewData["GoodsTypeId"] = new SelectList(_context.GoodsType, "GoodsTypeId", "GoodsTypeId", companyGoodsPackage.GoodsTypeId); ViewData["PackageTypeid"] = new SelectList(_context.PackageType, "PackageTypeId", "PackageTypeId", companyGoodsPackage.PackageTypeid); return(View(companyGoodsPackage)); }