| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- using DevExpress.Xpo;
- using DevExpress.XtraEditors;
- using Ips.Sps.Sigs;
- 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 Ips.Sps.Adcs
- {
- public partial class AdcSelectForm : DevExpress.XtraEditors.XtraForm
- {
- public AdcSelectForm()
- {
- InitializeComponent();
- }
- Session _session;
- public List<AdCard> SelectAdcList { get; private set; } = new List<AdCard>();
- private void AdcSelectForm_Load(object sender, EventArgs e)
- {
- Realod();
- }
- private void Realod()
- {
- _session = new Session();
- var adcList = _session.Query<AdCard>()
- .Where(m => m.Enable)
- .ToList();
- bsAdcList.DataSource = adcList;
- }
- private void btnOk_Click(object sender, EventArgs e)
- {
- SelectAdcList.Clear();
- var rowHandles = gvAdcList.GetSelectedRows();
- foreach (var rowHandle in rowHandles)
- {
- var adc = gvAdcList.GetRow(rowHandle) as AdCard;
- if (adc == null) continue;
- SelectAdcList.Add(adc);
- }
- this.DialogResult = DialogResult.OK;
- Close();
- }
- private void gvAdcList_RowClick(object sender, DevExpress.XtraGrid.Views.Grid.RowClickEventArgs e)
- {
- if (e.Clicks == 2 && e.Button == MouseButtons.Left)
- {
- btnOk.PerformClick();
- }
- }
- }
- }
|