qin
2025-03-19 342b10ed5f4ebbccf2d2868d211fbe91cf3e8d5d
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
72
73
74
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 TemplateType 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(TemplateType));
            var arr = arrs.Where(c => c == TemplateType.楼层模板.ToString()).ToArray();
            this.comBoxModel.Properties.Items.AddRange(arr);
            //combobox_type.SelectedItem = TemplateType.小区模板;
 
 
            //this.comboBoxBuildType.Properties.Items.AddRange(buildTypes.ToArray());
            //this.comboBoxBuildType.Properties.
 
            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 = (TemplateType)Enum.Parse(typeof(TemplateType), type);
 
            if (this.imgCmbBuildType.EditValue is int id)
            {
                this.BuildType = id;
 
            }
            //this._modelTemplate.FormJson = Yw.JsonHelper.Object2Json(this._buildBaseModel);
            //XtraMessageBox.Show("操作成功!");
            DialogResult = DialogResult.OK;
        }
 
 
    }
}