public DashboardPresenter(DashboardView view) { view_ = view; var user = DataProviderFactory.getDataProvider().getCurrentUser(); switch (user.role) { case Projman.Server.User.Types.Role.Admin: { navigate_ = new List <string> { PROJECTS, USERS }; break; } case Projman.Server.User.Types.Role.Manager: { navigate_ = new List <string> { PROJECTS }; break; } case Projman.Server.User.Types.Role.User: { navigate_ = new List <string> { TASKS }; break; } } view.SetButtons(navigate_); }
public void login(string login, string password) { try { DataProviderFactory.getDataProvider().login(login, password); view_.navigateToDashboard(); } catch (Grpc.Core.RpcException e) { view_.showError("Can not login to server, please try again later"); } }
public void onStatisticsClick() { var tasks = DataProviderFactory.getDataProvider().getTasks(project_.id); view_.navigateToStatistic(tasks); }
public void updateTasks() { var tasks = DataProviderFactory.getDataProvider().getTasks(project_.id); view_.showData(project_, tasks); }
public void updateUsersList() { var users = DataProviderFactory.getDataProvider().getUsers(); view_.showUsers(users); }