Esempio n. 1
0
        public ActionResult Relative(int id)
        {
            var version = Entities().VariantVersions.Find(id);

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

            UserService users = GetService <UserService>();

            if (!users.IsAllowedToEdit(version.Variant, User.Identity.Name))
            {
                return(new HttpUnauthorizedResult());
            }

            DefinitionService definitions = GetService <DefinitionService>();
            var model = new RelativeDirectionsModel(version, definitions.CalculateGlobalDirectionDiagram(version), definitions.GetRelativeDirs(version));

            return(View(model));
        }