using System.Data;
|
using static Hydro.MapViewEnum;
|
|
namespace PBS.WinFrmUI.Hydro
|
{
|
public partial class TemplateEditForm : DevExpress.XtraEditors.XtraForm
|
{
|
public TemplateEditForm(PBS.Vmo.ModelTemplateVmo modelTemplate)
|
{
|
InitializeComponent();
|
if (modelTemplate != null)
|
{
|
this._modelTemplate = modelTemplate;
|
}
|
|
}
|
public PBS.Vmo.ModelTemplateVmo _modelTemplate;
|
|
|
string[] arrs;
|
|
public PBS.eModelTemplateType Type { get; set; }
|
|
public int BuildType { get; set; }
|
|
public string TemplateName { get; set; }
|
//初始化
|
private void TemplateEditForm_Load(object sender, EventArgs e)
|
{
|
BindData();
|
//LoadForm();
|
}
|
|
private void btnCancel_Click(object sender, EventArgs e)
|
{
|
this.Hide();
|
}
|
|
private void BindData()
|
{
|
arrs = Enum.GetNames(typeof(PBS.eModelTemplateType));
|
var arr = arrs.Where(c => c == PBS.eModelTemplateType.Floor.ToString()).ToArray();
|
this.comBoxModel.Properties.Items.AddRange(arr);
|
|
this.imgCmbBuildType.Properties.AddEnum<PBS.ePlaceType>();
|
this.imgCmbBuildType.SelectedIndex = 0;
|
|
}
|
|
private void btnOk_Click(object sender, EventArgs e)
|
{
|
this.Hide();
|
var type = comBoxModel.SelectedItem.ToString();
|
this.TemplateName = this.txtName.Text;
|
this.Type = (PBS.eModelTemplateType)Enum.Parse(typeof(PBS.eModelTemplateType), type);
|
|
if (this.imgCmbBuildType.EditValue is int id)
|
{
|
this.BuildType = id;
|
|
}
|
DialogResult = DialogResult.OK;
|
}
|
|
|
}
|
}
|