示例#1
0
        /// <summary>
        /// 更换项目时重新构建项目结构树
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void cmb_project_SelectedIndexChanged(object sender, EventArgs e)
        {
            ProjectCmbItem item = (ProjectCmbItem)cmb_project.SelectedItem;

            if (item == null)
            {
                MessageBox.Show("请选择项目", "提示");
                return;
            }
            ProjectId   = item.Value;
            ecprojectid = ProjectSystem.FindProjectid(ProjectId).ToString();

            ProjectCmbItem.BlockBind(cmb_block, ecprojectid);
        }
示例#2
0
        /// <summary>
        /// 更换项目时重新构建项目结构树
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void cmb_project_SelectedIndexChanged(object sender, EventArgs e)
        {
            tvMType.Nodes.Clear();
            tn = new TreeNode();
            ProjectCmbItem item = (ProjectCmbItem)cmb_project.SelectedItem;

            if (item == null)
            {
                MessageBox.Show("请选择项目", "提示");
                return;
            }
            ProjectId = item.Value;
            tn.Tag    = ProjectId;
            project p = project.Find(ProjectId);

            if (p != null)
            {
                tn.Text               = p.description;
                tn.ImageIndex         = 3;
                tn.SelectedImageIndex = 3;
            }
            else
            {
                tn.Text = "项目";
            }
            this.tvMType.Nodes.Add(tn);
            ecprojectid = ProjectSystem.FindProjectid(ProjectId).ToString();
            DataTable dt    = new DataTable();
            DataTable dtact = new DataTable();

            //int projectid = ProjectSystem.FindProjectid(ProjectId);
            dt    = SubProject.FindAllSubPro(ProjectId).Tables[0];
            dtact = Activity.FindActivityDs(ProjectId).Tables[0];
            //string virroot = ProjectSystem.GetProName(projectID);
            CreateTreeViewRecursiveNew(tn, dt, dtact, "0");
            ProjectCmbItem.BlockBind(cmb_block, ecprojectid);
        }