public ActionResult AddAgent(AddAgent agent) { AgentRepository repository = new AgentRepository(); Agents agentToAdd = new Agents { name = agent.agentName }; repository.Save(agentToAdd); return RedirectToAction("Index"); }
public ActionResult Edit(int agentId, EditAgent agent) { AgentRepository repository = new AgentRepository(); Agents agentToUpdate = new Agents { id = agent.agentId, Contracts = repository.GetById(agentId).Contracts, name = agent.agentName }; repository.Update(agentToUpdate); return RedirectToAction("Index"); }
partial void DeleteAgents(Agents instance);
partial void UpdateAgents(Agents instance);
partial void InsertAgents(Agents instance);