public ActionResult GetRelations(int id)
        {
            ViewBag.Person = personService.GetPerson(id);

            IEnumerable <Relation> relations = relationService.GetRelations(x => x.SourceId == id);

            return(View(relations));
        }
示例#2
0
        // GET: Relation

        public ActionResult Index(long?employeeId)
        {
            RelationCollectionViewModel model = new RelationCollectionViewModel {
                Employees = employeeService.GetAll(),
                Relations = service.GetRelations()
            };

            if (employeeId.HasValue)
            {
                model.Relations = service.GetRelationsByEmployee(employeeId.Value);
            }

            return(View(model));
        }