using DevExpress.Utils.MVVM;
|
using DevExpress.XtraEditors;
|
using DevExpress.XtraEditors.Controls;
|
using System;
|
using System.Collections.Generic;
|
using System.ComponentModel;
|
using System.Data;
|
using System.Drawing;
|
using System.Linq;
|
using System.Text;
|
using System.Threading.Tasks;
|
using System.Windows.Forms;
|
|
namespace HStation.WinFrmUI
|
{
|
public partial class XhsSchemeMgrListCtrl : DevExpress.XtraEditors.XtraUserControl
|
{
|
public XhsSchemeMgrListCtrl()
|
{
|
InitializeComponent();
|
this.layoutControl1.SetupLayoutControl();
|
this.listBoxControl1.InitialDefaultSettings(30);
|
}
|
|
private long _projectId;//项目id
|
private List<HStation.Dto.XhsProjectSiteStdDto> _allProjectSiteList = null;//所有项目站列表
|
private List<HStation.Dto.XhsSchemeDto> _allSchemeList = null;//所有方案列表
|
|
|
/// <summary>
|
/// 绑定数据
|
/// </summary>
|
public async void SetBindingData(long projectId)
|
{
|
_allProjectSiteList = await new BLL.XhsProjectSiteStd().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)
|
{
|
|
}
|
|
}
|
}
|