Esempio n. 1
0
        public ActionResult Shape(int id, string shapeData, string linkData, string next)
        {
            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>();

            definitions.SaveBoardData(version, shapeData, linkData);

            if (next == "done")
            {
                return(RedirectToAction("Edit", "Variants", new { id = version.VariantID }));
            }
            else if (next == "next")
            {
                return(RedirectToAction("Global", new { id }));
            }

            return(RedirectToAction("Shape", new { id }));
        }