| | |
| | | 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; |
| | | using PBS.Model; |
| | | |
| | | namespace PBS.WinFrmUI |
| | | { |
| | |
| | | InitializeComponent(); |
| | | } |
| | | |
| | | private BindingList<ElecPriceHourSetting> _allBindingList = null; //这就是输入进去立马就获取到的值 |
| | | private BindingList<Vmo.ElecPriceHourSetting> _allBindingList = null; //这就是输入进去立马就获取到的值 |
| | | |
| | | public event Func<Model.ElecPriceMonthSetting, bool> ReloadDataEvent; |
| | | public event Func<Vmo.ElecPriceMonthSetting, Task<bool>> ReloadDataEvent; |
| | | |
| | | public void SetBindingData() |
| | | { |
| | | _allBindingList = new BindingList<Model.ElecPriceHourSetting>(); |
| | | _allBindingList = new BindingList<Vmo.ElecPriceHourSetting>(); |
| | | this.bindingSource1.DataSource = _allBindingList; |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | //确定 |
| | | private void btnOk_Click(object sender, EventArgs e) |
| | | private async void btnOk_Click(object sender, EventArgs e) |
| | | { |
| | | if (!verify()) |
| | | { |
| | |
| | | } |
| | | if (this.ReloadDataEvent == null) |
| | | return; |
| | | var Eleprice = new Model.ElecPriceMonthSetting(); |
| | | var Eleprice = new Vmo.ElecPriceMonthSetting(); |
| | | int Startmonth = 0; |
| | | if (!int.TryParse(this.txtStartMonth.Text, out Startmonth)) |
| | | { |
| | |
| | | }*/ |
| | | Eleprice.EndMonth = Endmonth; |
| | | Eleprice.HourList = _allBindingList.ToList(); //把绑定列表的值赋给hourlist |
| | | var isok = this.ReloadDataEvent.Invoke(Eleprice); |
| | | var isok = await this.ReloadDataEvent.Invoke(Eleprice); |
| | | if (isok == false) |
| | | { |
| | | XtraMessageBox.Show("添加失败"); |
| | |
| | | { |
| | | if (_allBindingList == null || _allBindingList.Count < 1) |
| | | return; |
| | | var row = this.gridView2.GetFocusedRow() as Model.ElecPriceHourSetting; |
| | | var row = this.gridView2.GetFocusedRow() as Vmo.ElecPriceHourSetting; |
| | | if (row == null) |
| | | return; |
| | | if (e.Column == this.ColDelete) |