lixiaojun
2024-09-11 ec0d0b6f8e3ac7791c736ae8aad69c4a1587cad9
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
namespace HStation.WinFrmUI
{
    public partial class XhsProjectSimulationSchemeMgrCtrl : DevExpress.XtraEditors.XtraUserControl
    {
        public XhsProjectSimulationSchemeMgrCtrl()
        {
            InitializeComponent();
            this.layoutControl1.SetupLayoutControl();
            this.listBoxControl1.InitialDefaultSettings(30);
        }
 
        private long _projectId;//项目id
        private List<HStation.Vmo.XhsProjectSiteVmo> _allProjectSiteList = null;//所有项目站列表
        private List<HStation.Vmo.XhsSchemeVmo> _allSchemeList = null;//所有方案列表
 
 
        /// <summary>
        /// 绑定数据
        /// </summary>
        public async Task SetBindingData(long projectId)
        {
            _allProjectSiteList = await BLLFactory<HStation.BLL.XhsProjectSite>.Instance.GetByProjectID(projectId);
            InitialProjectSiteList();
        }
 
        //初始化项目站列表
        private void InitialProjectSiteList()
        {
            this.imgCmbProjectSiteList.Properties.BeginUpdate();
            this.imgCmbProjectSiteList.Properties.Items.Clear();
            if (_allProjectSiteList != null && _allProjectSiteList.Count > 0)
            {
                foreach (var projectSite in _allProjectSiteList)
                {
                    var imgItem = new ImageComboBoxItem();
                    imgItem.Value = projectSite;
                    imgItem.Description = projectSite.Name;
                    this.imgCmbProjectSiteList.Properties.Items.Add(imgItem);
                }
            }
            this.imgCmbProjectSiteList.Properties.EndUpdate();
            this.imgCmbProjectSiteList.SelectedIndex = 0;
            if (_allProjectSiteList != null && _allProjectSiteList.Count > 1)
            {
                this.itemForProjectSiteList.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Always;
            }
            else
            {
                this.itemForProjectSiteList.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Never;
            }
        }
 
        //项目站选择索引改变
        private void imgCmbProjectSiteList_SelectedIndexChanged(object sender, EventArgs e)
        {
            var item = this.imgCmbProjectSiteList.SelectedItem as XhsProjectStdDto;
            if (item == null)
            {
                return;
            }
 
        }
 
        //项目站选择值改变
        private void imgCmbProjectSiteList_SelectedValueChanged(object sender, EventArgs e)
        {
 
        }
 
    }
}