Пример #1
0
        public ActionResult Create(string username, string scriptname)
        {
            unitOfWork.createScript(username, scriptname);
            unitOfWork.SubmitChanges();

            var Model = CreateIndexViewModel(username);

            return(RedirectToAction("Index", new { username = username })); //View("Index", Model);
        }
Пример #2
0
        public string Post([FromBody] Models.CanvasScriptsMgmt.ScriptSimple scriptFromClient)
        {
            var scriptBuilder = unitOfWork.Scripts.GetBoBuilder(CanvasScriptKey.Create(scriptFromClient.userName, scriptFromClient.scriptName));

            scriptBuilder.setScript(scriptFromClient.scriptJson);
            unitOfWork.SubmitChanges();

            return(scriptFromClient.scriptJson);
        }
Пример #3
0
        public ActionResult SaveUser(Models.UserMgmt.UserViewModel NewUser)
        {
            //NewUser.Name = NewUser.Name.Trim();
            //ValidateModel(NewUser);
            if (!ModelState.IsValid)
            {
                ModelState.AddModelError("Name", "Der Name wurde nicht festgelegt");
                return(View("NewUser"));
            }
            else
            {
                // speichern
                unitOfWork.Users.CreateBoAndAdd(NewUser.Name);
                unitOfWork.SubmitChanges();

                return(View("Index", GetUsers(true)));
            }
        }