Ejemplo n.º 1
0
        private void AddAnalyzerButton_Click(object sender, EventArgs e)
        {
            AssignUserForm assignUserForm = new AssignUserForm();
            assignUserForm.Prompt = "Add task analyzer";
            if (DialogResult.OK == assignUserForm.ShowDialog())
            {
                foreach (string user in assignUserForm.Users)
                {
                    if (TaskAnalyzerList.Items.Contains(user))
                        continue;

                    TaskAnalyzerList.Items.Add(user);
                }
            }
        }
Ejemplo n.º 2
0
        private void AddManagerToolStripMenuItem_Click(object sender, EventArgs e)
        {
            AssignUserForm assignUserForm = new AssignUserForm();
            assignUserForm.Prompt = "Add task manager";
            TreeNode managersNode = null;
            SubRegion origionRegion;
            if (DialogResult.OK == assignUserForm.ShowDialog())
            {
                managersNode = WorkspaceTreeView.SelectedNode;
                origionRegion = (SubRegion)managersNode.Parent.Tag;
                UpdateRegionRequest request = new UpdateRegionRequest();
                request.Type = UpdateRegionType.AddManager.ToString();
                request.Region = new SubRegion();
                request.Region.ID = origionRegion.ID;

                foreach (string user in assignUserForm.Users)
                {
                    if (origionRegion.Manager.Contains(user))
                        continue;

                    request.Region.Manager.Add(user);
                }

                if (request.Region.Manager.Count == 0)
                    return;

                HTTPAgent.instance().updateRegion(this, DataCenter.Instance().GlobalRegion.Version, request,
                    "Add managers", managersNode);
            }
        }
Ejemplo n.º 3
0
        private void AddAnalyzerToolStripMenuItem_Click(object sender, EventArgs e)
        {
            AssignUserForm assignUserForm = new AssignUserForm();
            assignUserForm.Prompt = "Add task analyzer";
            TreeNode analyzersNode = null;
            BindingTask task;
            if (DialogResult.OK == assignUserForm.ShowDialog())
            {
                analyzersNode = WorkspaceTreeView.SelectedNode;
                task = ((TaskModel)analyzersNode.Parent.Tag).mTask;
                UpdateTaskRequest request = new UpdateTaskRequest();
                request.Type = UpdateTaskType.AddAnalyzer.ToString();
                foreach (string user in assignUserForm.Users)
                {
                    if (request.Analyzer.Contains(user))
                        continue;

                    request.Analyzer.Add(user);
                }

                if (request.Analyzer.Count == 0)
                    return;

                HTTPAgent.instance().updateTask(this, task.ID, request, "Add analyzers", analyzersNode);
            }
        }