Exemple #1
0
        private void ComboBox_Segments_SelectedIndexChanged(object sender, EventArgs e)
        {
            ComboBox_Company.Items.Clear();
            ComboBox_Company.Items.Add("全部单位");

            if (ComboBox_Segments.SelectedItem is Prjsct)
            {
                Prjsct         prjsct   = ComboBox_Segments.SelectedItem as Prjsct;
                List <Orginfo> OrgInfos = DepositoryOrganInfo.QueryOrgans(prjsct.PrjsctCode, "");
                ComboBox_Company.Items.AddRange(OrgInfos.ToArray());
            }

            if (ComboBox_Company.Items.Count > 1)
            {
                ComboBox_Company.SelectedIndex = 1;
            }
            else
            {
                ComboBox_Company.SelectedIndex = 0;
            }
        }
Exemple #2
0
        private void Section_SelectedIndexChanged(object sender, EventArgs e)
        {
            Search.Enabled  = false;
            Unit.DataSource = null;

            var section = Section.SelectedItem as Prjsct;
            var units   = new List <Orginfo>();

            if (section != null && !string.IsNullOrEmpty(section.PrjsctCode))
            {
                units.AddRange(DepositoryOrganInfo.QueryOrgans(section.PrjsctCode, ""));
                units.Add(new Orginfo()
                {
                    DepName = "全部",
                    DepCode = "#"
                });

                Unit.DataSource = units;
            }
            Search.Enabled = true;
        }
Exemple #3
0
        private void SetTreeValues(Prjsct section, Orginfo unit, PrjFolder room)
        {
            Section.SelectedIndexChanged  -= new EventHandler(Section_SelectedIndexChanged);
            Unit.SelectedIndexChanged     -= new EventHandler(Unit_SelectedIndexChanged);
            TestRoom.SelectedIndexChanged -= new EventHandler(TestRoom_SelectedIndexChanged);

            Section.DataSource = DepositoryPrjsctInfo.QueryPrjscts(Yqun.Common.ContextCache.ApplicationContext.Current.InProject.Code);
            Section.Text       = section.PrjsctName;

            Unit.DataSource = DepositoryOrganInfo.QueryOrgans(section.PrjsctCode, "");
            Unit.Text       = unit.DepName;

            TestRoom.DataSource    = DepositoryFolderInfo.QueryPrjFolders(unit.DepCode, "");
            TestRoom.SelectedItem  = room;
            TestRoom.SelectedValue = room.FolderCode;
            TestRoom.SelectedText  = room.FolderName;
            TestRoom.Text          = room.FolderName;


            Section.SelectedIndexChanged  += new EventHandler(Section_SelectedIndexChanged);
            Unit.SelectedIndexChanged     += new EventHandler(Unit_SelectedIndexChanged);
            TestRoom.SelectedIndexChanged += new EventHandler(TestRoom_SelectedIndexChanged);
        }