コード例 #1
0
        private void comboBoxWs_SelectedIndexChanged(object sender, EventArgs e)
        {
            Workspaces      workspaces     = new Workspaces();
            List <DatumWSR> ws             = workspaces.WorkspacesFind();
            string          workspaceGid   = ws[comboBoxWs.SelectedIndex].gid;
            ProjectNames    pn             = new ProjectNames();
            List <Datum>    listOfProjects = pn.ProjectsFind(workspaceGid);//краткий перечень проектов

            foreach (Datum i in listOfProjects)
            {
                comboBoxProject.Items.Add(i.name);
            }
            comboBoxProject.SelectedIndex = 0;
        }
コード例 #2
0
        public void FillCombos()
        {
            string       gidWS = listOfWorkspaces[comboBoxWs.SelectedIndex].gid;
            ProjectNames pn    = new ProjectNames();

            listOfProjects = pn.ProjectsFind(gidWS);
            foreach (Datum d in listOfUsers)
            {
                comboBox1.Items.Add(d.name);
                comboBox3.Items.Add(d.name);
            }
            foreach (Datum d in listOfProjects)
            {
                comboBox2.Items.Add(d.name);
            }
            comboBox1.SelectedIndex = 0;
            comboBox2.SelectedIndex = 0;
            comboBox3.SelectedIndex = 0;
        }
コード例 #3
0
        private void buttonRun_Click(object sender, EventArgs e)
        {
            dataGridView1.Rows.Clear();
            label6.Text = "Загрузка перечня...";
            TaskData        td             = new TaskData();
            UsersData       usd            = new UsersData();
            List <Datum>    listOfUsers    = usd.UsersFind();
            Workspaces      workspaces     = new Workspaces();
            List <DatumWSR> ws             = workspaces.WorkspacesFind();
            string          workspaceGid   = ws[comboBoxWs.SelectedIndex].gid;
            ProjectNames    pn             = new ProjectNames();
            List <Datum>    listOfProjects = pn.ProjectsFind(workspaceGid);//краткий перечень проектов
            string          projectGid;

            if (comboBoxProject.SelectedIndex >= 0)
            {
                projectGid = listOfProjects[comboBoxProject.SelectedIndex].gid;
            }
            else
            {
                projectGid = null;
            }
            List <Datum> listOfTasks = td.TasksFind(projectGid);
            string       assignee    = listOfUsers[comboBoxUser.SelectedIndex].gid;
            TaskFullData tfd         = new TaskFullData();
            int          n           = 1;
            bool         yes         = false;
            int          c1          = listOfTasks.Count();
            int          t           = 1;

            label6.Text = "Обработка данных...";
            foreach (Datum i in listOfTasks)
            {
                yes = false;
                DataTaskFull dtf   = tfd.TasksFind(i.gid);
                string       follw = "";
                foreach (TheElement ftf in dtf.followers)
                {
                    follw += ftf.name + "; ";
                }
                string proj = "";
                foreach (TheElement ftf in dtf.projects)
                {
                    proj += ftf.name + "; ";
                }
                if (dtf.assignee != null)
                {
                    if (dtf.assignee.gid == assignee)
                    {
                        yes = true;
                    }
                }
                bool compCheck = false;
                if (checkBoxNotDone.Checked == false)
                {
                    compCheck = true;
                }
                if (yes & (dtf.completed == compCheck || dtf.completed == false))
                {
                    dataGridView1.Rows.Add(t, i.name, dtf.assignee.name, follw, dtf.due_on, dtf.completed, proj, dtf.notes);
                    t++;
                }

                progressBar1.Value = Convert.ToInt32(n * 100 / c1);
                n++;
            }
            label6.Text = "Данные загружены";
        }