public async Task <IActionResult> Create([Bind("Title,Quantity,Price,OrderID,AttachmentPath,Description,ID,NrIntern,UserID,CreateBy,UpdateBy,CreateDate,UpdateDate,OrganizationID,Remark,Deleted")] OrderPosition orderPosition) { if (ModelState.IsValid) { orderPosition.ID = Guid.NewGuid(); _context.Add(orderPosition); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["OrderID"] = new SelectList(_context.Orders, "ID", "NrIntern", orderPosition.OrderID); return(View(orderPosition)); }
public async Task <IActionResult> Create([Bind("Title,Description,SendDate,Status,AmountNet,SupplierOrganizationID,OrderID,ID,NrIntern,UserID,CreateBy,UpdateBy,CreateDate,UpdateDate,OrganizationID,Remark,Deleted")] Invoice invoice) { if (ModelState.IsValid) { invoice.ID = Guid.NewGuid(); _context.Add(invoice); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["OrderID"] = new SelectList(_context.Orders, "ID", "NrIntern", invoice.OrderID); ViewData["SupplierOrganizationID"] = new SelectList(_context.Organizations, "ID", "ID", invoice.SupplierOrganizationID); return(View(invoice)); }