It turns out that the create function that the other trainee did not work because it has two tables with n-n relation and in the function it is only going to fetch data and register them in one. But I can not figure out how to add another table or use the relational table.
This is the code of the create function that he left
' GET: DEF_DEFECT/Create
Function Create() As ActionResult
Return View()
End Function
' POST: DEF_DEFECT/Create
'To protect from overposting attacks, please enable the specific properties you want to bind to, for
'more details see http://go.microsoft.com/fwlink/?LinkId=317598.
<HttpPost()>
<ValidateAntiForgeryToken()>
Function create(<Bind(Include:="CODE_DEF,DESCRIPTION_DEF")> ByVal dEF_DEFECT As DEF_DEFECT) As ActionResult
If ModelState.IsValid Then
db.DEF_DEFECT.Add(dEF_DEFECT)
db.SaveChanges()
Return RedirectToAction("Index")
End If
Return View(dEF_DEFECT)
End Function
He sent me to get code_def
and description_def
on table def_defect
but I need to get cod_process
from table Pro_Process
.
These 2 tables, when normalized, gave rise to the table Process_Defect
Can someone help me?