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);
Beispiel #6
0
 partial void DeleteAgents(Agents instance);
Beispiel #7
0
 partial void UpdateAgents(Agents instance);
Beispiel #8
0
 partial void InsertAgents(Agents instance);