예제 #1
0
        /// <summary>
        /// Переименование проекта
        /// </summary>
        private void Rename(IControllerContext context)
        {
            var data = WebUtility.UrlDecode(context.Request.Content);
            IHttpFormParameters parameters = HttpParser.ParseFormParameters(data);
            string   prjOldName            = parameters.GetString("prjOldName");
            IProject project = ProjectManager.Manager.Rename(parameters.GetString("prjOldName"), parameters.GetString("prjName"), parameters.GetString("prjDescription"));

            if (project == null)
            {
                throw new Project.Exception(Project.Exception.NotFound, prjOldName);
            }

            StringBuilder result = ResultProjectToJson(true, project);

            context.Response.Write(result.ToString());
        }