예제 #1
0
        protected void bindTasks()
        {
            int userID   = 0;
            int clientID = 0;

            List <LeadTask> tasks = null;

            int roleID = Core.SessionHelper.getUserRoleId();

            switch (roleID)
            {
            case (int)UserRole.Administrator:
                tasks = TasksManager.GetAll();
                break;

            case (int)UserRole.Client:
            case (int)UserRole.SiteAdministrator:
                clientID = Core.SessionHelper.getClientId();

                tasks = TasksManager.GetLeadTaskByClientId(clientID);
                break;

            default:
                userID = Core.SessionHelper.getUserId();

                tasks = TasksManager.GetLeadTaskByUserID(userID);
                break;
            }


            gvTasks.DataSource = tasks;

            gvTasks.DataBind();
        }