예제 #1
0
        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_);
        }
예제 #2
0
 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");
     }
 }
예제 #3
0
        public void onStatisticsClick()
        {
            var tasks = DataProviderFactory.getDataProvider().getTasks(project_.id);

            view_.navigateToStatistic(tasks);
        }
예제 #4
0
        public void updateTasks()
        {
            var tasks = DataProviderFactory.getDataProvider().getTasks(project_.id);

            view_.showData(project_, tasks);
        }
예제 #5
0
        public void updateUsersList()
        {
            var users = DataProviderFactory.getDataProvider().getUsers();

            view_.showUsers(users);
        }