public async Task <IActionResult> Create([Bind("StatusId,StatusName")] Status status) { if (ModelState.IsValid) { _context.Add(status); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(status)); }
public async Task <IActionResult> Create([Bind("ParamId,ParamName")] Param @param) { if (ModelState.IsValid) { _context.Add(@param); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(@param)); }
public async Task <IActionResult> Create([Bind("CategoryId,CategoryName")] Category category) { if (ModelState.IsValid) { _context.Add(category); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(category)); }
public async Task <IActionResult> Create([Bind("CompanyId,CompanyName,CompanyHeadquarters,CompanyNIP")] Company company) { if (ModelState.IsValid) { _context.Add(company); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(company)); }
public async Task <IActionResult> Create([Bind("PhotoId,PhotoUrl")] Photo photo) { if (ModelState.IsValid) { _context.Add(photo); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(photo)); }
public async Task <IActionResult> Create([Bind("AssortmentId,AssortmentName,AssortmentBrand,AssortmentPrice,ParamId")] Assortment assortment) { if (ModelState.IsValid) { _context.Add(assortment); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["ParamId"] = new SelectList(_context.Params, "ParamId", "ParamName", assortment.ParamId); return(View(assortment)); }
public async Task <IActionResult> Create([Bind("LeasingId,LeasingStart,LeasingEnd,LeasingExtend,Id")] Leasing leasing) { if (ModelState.IsValid) { _context.Add(leasing); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["Id"] = new SelectList(_context.ApplicationUsers, "Id", "Id", leasing.Id); return(View(leasing)); }
public async Task <IActionResult> Create([Bind("ProductId,ProductName,ProductDescription,ProductPrice,ProductAvailability,ProductCode,ProductAdded,CategoryId")] Product product) { if (ModelState.IsValid) { _context.Add(product); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["CategoryId"] = new SelectList(_context.Categories, "CategoryId", "CategoryName", product.CategoryId); return(View(product)); }
public async Task <IActionResult> Create([Bind("ReportId,ReportDescription,ReportAdded,LeasingDetailId,StatusId")] Report report) { if (ModelState.IsValid) { _context.Add(report); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["LeasingDetailId"] = new SelectList(_context.LeasingDetails, "LeasingDetailId", "LeasingDetailId", report.LeasingDetailId); ViewData["StatusId"] = new SelectList(_context.Statuses, "StatusId", "StatusName", report.StatusId); return(View(report)); }