using DevExpress.XtraEditors; 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 SelectXhsProjectTransferFileDlg : DevExpress.XtraEditors.XtraForm { public SelectXhsProjectTransferFileDlg() { InitializeComponent(); this.IconOptions.Icon = Yw.WinFrmUI.GlobalParas.AppIcon; this.layoutControl1.SetupLayoutControl(); this.gridView1.SetNormalView(); this.dtStart.SetOnlyShowDate(); this.dtEnd.SetOnlyShowDate(); } public event Action ReloadDataEvent; private List _allBindingList = null; public void SetBindingData() { this.dtStart.DateTime = DateTime.Now.AddDays(-10); this.dtEnd.DateTime = DateTime.Now; Search(); } //查询 private async void Search() { var fileName = this.txtFileName.Text.Trim(); var fileCode = this.txtFileCode.Text.Trim(); var fileSuffix = this.txtSuffix.Text.Trim(); var uploadUserName = this.txtUploadUserName.Text.Trim(); var startTime = this.dtStart.DateTime.Date; var endTime = this.dtEnd.DateTime.Date.AddDays(1); var list = await BLLFactory.Instance.GetFluzzyList(fileName, fileCode, fileSuffix, uploadUserName, startTime, endTime); _allBindingList = new List(); list?.ForEach(x => _allBindingList.Add(new SelectXhsProjectTransferFileViewModel(x))); this.selectXhsProjectTransferFileViewModelBindingSource.DataSource = _allBindingList; this.selectXhsProjectTransferFileViewModelBindingSource.ResetBindings(false); } private void btnSearch_Click(object sender, EventArgs e) { Search(); } private void btnOk_Click(object sender, EventArgs e) { var row = this.gridView1.GetFocusedRow() as SelectXhsProjectTransferFileViewModel; if (row == null) { return; } this.ReloadDataEvent?.Invoke(row.Vmo); this.DialogResult = DialogResult.OK; this.Close(); } } }