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);
Пример #6
0
 partial void DeleteAgents(Agents instance);
Пример #7
0
 partial void UpdateAgents(Agents instance);
Пример #8
0
 partial void InsertAgents(Agents instance);