Ejemplo n.º 1
0
        public frmProjectEdit(TaskManagerAPI.Project project)
        {
            InitializeComponent();
            _project = project;

            txtName.Text = _project.Name.Trim();
        }
Ejemplo n.º 2
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            // Create your application here
            this.SetContentView(Resource.Layout.ProjectCreate);

            // Set click on the create button (This will now edit the title not create a fresh one)
            Button editBtn = FindViewById <Button>(Resource.Id.btnCreateProject);

            editBtn.Click += btnCreateProject_Click;
            editBtn.Text   = "Update Project";

            // Get project details
            int projectId = Intent.GetIntExtra("SelectedProjectId", -1);

            // If the project cannot be found for some reason throw an exception and get us out of here
            if (projectId == 0)
            {
                throw new Exception("Project not found?!");
            }

            _project = TaskManagerAPI.Project.GetProject(Token.AuthToken, projectId);

            // Update activity title
            this.Title = "Edit " + _project.Name;

            // Get the text input
            _txtProjectName      = FindViewById <EditText>(Resource.Id.txtProjectName);
            _txtProjectName.Text = _project.Name;
        }
Ejemplo n.º 3
0
        public frmTaskList(TaskManagerAPI.Project project)
        {
            InitializeComponent();
            _project = project;

            this.Text = "Tasks for " + _project.Name;
        }
Ejemplo n.º 4
0
 private void btnViewTasks_Click(object sender, EventArgs e)
 {
     if (listProjects.SelectedItems.Count > 0)
     {
         TaskManagerAPI.Project selectedProject = (TaskManagerAPI.Project)listProjects.SelectedItems[0];
         frmTaskList            taskList        = new frmTaskList(selectedProject);
         taskList.ShowDialog();
     }
 }
Ejemplo n.º 5
0
 private void btnEditProject_Click(object sender, EventArgs e)
 {
     if (listProjects.SelectedItems.Count > 0)
     {
         TaskManagerAPI.Project selectedProject = (TaskManagerAPI.Project)listProjects.SelectedItems[0];
         frmProjectEdit         editProject     = new frmProjectEdit(selectedProject);
         editProject.ShowDialog();
         PopulateProjectsList();
     }
 }
Ejemplo n.º 6
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            // Create your application here
            SetContentView(Resource.Layout.TaskCreate);

            _projectId = Intent.GetIntExtra("SelectedProjectId", -1);

            // Add event handlers
            FindViewById <Button>(Resource.Id.btnCreateTask).Click += btnCreateTask_Click;

            // Get project and set title
            TaskManagerAPI.Project proj = TaskManagerAPI.Project.GetProject(Token.AuthToken, _projectId);
            this.Title = "Create Task for " + proj.Name;
        }
Ejemplo n.º 7
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            // Create your application here
            SetContentView(Resource.Layout.TaskList);

            // Get Project Id
            int projectId = Intent.GetIntExtra("SelectedProjectId", -1);

            _projectId = projectId;

            // Get the tasks from the API
            TaskManagerAPI.ProjectTask[] tasks = TaskManagerAPI.ProjectTask.GetTasks(Token.AuthToken, projectId);

            // Get layout
            LinearLayout layout = FindViewById <LinearLayout>(Resource.Id.linearTaskList);

            // Put tasks onto screen
            foreach (var task in tasks)
            {
                ValuedCheckItem taskCheck = new ValuedCheckItem(this, task.ProjectTaskId.ToString());
                taskCheck.Text = task.Description;

                if (task.Completed)
                {
                    taskCheck.Checked = true;
                }

                taskCheck.CheckedChange += TaskCheck_CheckedChange;

                layout.AddView(taskCheck);
            }

            // Display a message if there are not tasks assigned to this project
            if (tasks.Count() == 0)
            {
                TextView noTasksText = new TextView(this);
                noTasksText.Text = "There are currently no tasks for this project!";
                noTasksText.SetTextColor(Android.Graphics.Color.Red);
                layout.AddView(noTasksText);
            }

            // Get the project
            TaskManagerAPI.Project proj = TaskManagerAPI.Project.GetProject(Token.AuthToken, _projectId);
            this.Title = proj.Name + " Tasks";
        }
Ejemplo n.º 8
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            // Create your application here
            this.SetContentView(Resource.Layout.ProjectOptions);

            // Store the passed in project Id
            _projectId = Intent.GetIntExtra("SelectedProjectId", -1);

            // Get buttons and assign clicks
            FindViewById <Button>(Resource.Id.btnProjectViewTasks).Click += btnProjectViewTasks_Click;
            FindViewById <Button>(Resource.Id.btnProjectEdit).Click      += btnProjectEdit_Click;
            FindViewById <Button>(Resource.Id.btnProjectDelete).Click    += btnProjectDelete_Click;

            _project   = TaskManagerAPI.Project.GetProject(Token.AuthToken, _projectId);
            this.Title = _project.Name + " Options";
        }
Ejemplo n.º 9
0
 public frmTaskCreate(TaskManagerAPI.Project project)
 {
     InitializeComponent();
     _project = project;
 }