コード例 #1
0
        public ActionResult Edit(int id)
        {
            Client         client         = clientRepository.Get(id);
            IList <Policy> clientPolicies = policyRepository.GetByClient(id);

            ViewBag.Policies = policyRepository.Get().Except(clientPolicies).Select(policy => new SelectListItem
            {
                Text  = policy.Name,
                Value = policy.Id.ToString()
            });

            if (client == null)
            {
                return(HttpNotFound());
            }

            return(View(client));
        }
コード例 #2
0
 public IList <Policy> GetByClient(int clientId)
 {
     return(policyRepository.GetByClient(clientId));
 }