Ejemplo n.º 1
0
 public ActionResult Edit(Form form)
 {
     var ws = new WorkspaceService();
     if (ws.IsUserCanInteractWithWorkspace(SessionStorage.User.Id, form.Workspace.Id))
     {
         ws.UpdateWorkspace(form.Workspace);
         this.SetTempMessage("Workspace has been updated.", "success");
     }
     return RedirectToAction("Index");
 }
Ejemplo n.º 2
0
        public ActionResult Create(Form form)
        {
            if (!ModelState.IsValid) return View(form);

            form.Workspace.Owner = new UserService().GetUser(SessionStorage.User.Id);
            new WorkspaceService().AddWorkspace(form.Workspace);

            //TODO: Check for user account type, if it is free or not
            return RedirectToAction("Index");
        }