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);