duheng
2024-08-14 71ff3ccde064c104db61fa28300b039456c0ba06
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
using DevExpress.XtraEditors;
using HStation.BLL;
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 XhsProjectBasicInfoViewCtrl : DevExpress.XtraEditors.XtraUserControl
    {
        public XhsProjectBasicInfoViewCtrl()
        {
            InitializeComponent();
            this.layoutControl1.SetupLayoutControl();
        }
 
        private Lazy<HStation.BLL.XhsProject> _bll = new(() => new HStation.BLL.XhsProject());
 
        /// <summary>
        /// 绑定数据
        /// </summary>
        public async void SetBindingData(long projectId)
        {
            var project = await _bll.Value.GetByID(projectId);
            this.txtName.EditValue = project.Name;
            this.txtNO.EditValue = project.NO;
            this.txtCustomer.EditValue = project.Customer;
            this.txtAddress.EditValue = project.Address;
            this.txtFlags.EditValue = Yw.Untity.FlagsHelper.ToString(project.Flags);
            this.txtTagNme.EditValue = project.TagName;
            this.txtDescription.EditValue = project.Description;
 
        }
 
        /// <summary>
        /// 绑定数据
        /// </summary>
        public void SetBindingData(XhsProjectDto project)
        {
            this.txtName.EditValue = project.Name;
            this.txtNO.EditValue = project.NO;
            this.txtCustomer.EditValue = project.Customer;
            this.txtAddress.EditValue = project.Address;
            this.txtFlags.EditValue = Yw.Untity.FlagsHelper.ToString(project.Flags);
            this.txtTagNme.EditValue = project.TagName;
            this.txtDescription.EditValue = project.Description;
        }
 
    }
}