public ActionResult ActionWithUser(int id, string UserAction) { // Performes actions with users var nuser = new NewUser(); var ScrumNotesDatabase = new Database(); nuser.UserAction = UserAction; switch (UserAction) { case "Create": nuser.AllowEdit = true; return View(nuser); case "View": nuser.AllowEdit = false; nuser = ScrumNotesDatabase.GetUserInfo(id); return this.View(nuser); case "Edit": nuser = ScrumNotesDatabase.GetUserInfo(id); nuser.id = id; nuser.AllowEdit = true; return this.View(nuser); case "Delete": ScrumNotesDatabase.DeleteUser(id); return this.RedirectToAction("ShowUsers"); } return this.View(); }
public ActionResult ActionWithUser(NewUser newUser) { var ScrumNotesDatabase = new Database(); switch (newUser.UserAction) { case "Create": ScrumNotesDatabase.CreateUser(newUser); return this.RedirectToAction("ShowUsers"); case "Edit": ScrumNotesDatabase.ModifyUser(newUser); return this.RedirectToAction("ShowUsers"); } return this.View(newUser); }
public ActionResult ActionWithProject(int id, string ProjectAction) { var ScrumNotesDatabase = new Database(); UsersList userlist = ScrumNotesDatabase.GetUsersInProject(id); SchedulingStatusList ssl = ScrumNotesDatabase.GetSchedulingStatuses(id); UsersListForProject ulfp = ScrumNotesDatabase.GetUsersForProjectRoles(id); _logger.Debug("Performing actions with project"); var nproject = new NewProject(false, userlist, ProjectAction, ssl, ulfp); switch (ProjectAction) { case "Create": nproject.AllowEdit = true; nproject.ProjectAction = ProjectAction; return View(nproject); break; case "View": nproject = ScrumNotesDatabase.GetProjectInfo(id); nproject.SetExtraParams(false, userlist, ProjectAction, ssl, ulfp); nproject.AllowEdit = false; return View(nproject); break; case "Edit": nproject = ScrumNotesDatabase.GetProjectInfo(id); nproject.SetExtraParams(false, userlist, ProjectAction, ssl, ulfp); nproject.AllowEdit = true; nproject.id = id; return View(nproject); break; case "Delete": ScrumNotesDatabase.DeleteProject(id); return this.RedirectToAction("Index"); break; } return this.View(); }
/// <summary> /// The show users. /// </summary> /// <returns> /// The <see cref="ActionResult"/>. /// </returns> public ActionResult ShowUsers() { // List of users here var ScrumNotesDatabase = new Database(); UsersList userslist = ScrumNotesDatabase.GetUsersList(); return View(userslist); }
public ActionResult ActionWithProject(NewProject newproject) { var ScrumNotesDatabase = new Database(); switch (newproject.ProjectAction) { case "Create": ScrumNotesDatabase.CreateProject(newproject); this.RedirectToAction("Index"); return this.View(newproject); break; case "Edit": ScrumNotesDatabase.ModifyProject(newproject); return this.RedirectToAction("Index"); } return this.RedirectToAction("Index"); }
// <summary> /// <summary> /// The index. /// </summary> /// <returns> /// The <see cref="ActionResult"/>. /// </returns> public ActionResult Index() { var ScrumNotesDatabase = new Database(); ProjectsList projects = ScrumNotesDatabase.GetProjectsList(); return this.View(projects); }