| | |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | _elecPrice.Settings = new Vmo.ElecPriceSetting(); |
| | | _elecPrice.Settings.MonthList = new List<Vmo.ElecPriceMonthSetting> { new Vmo.ElecPriceMonthSetting() }; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | _elecPrice = new Vmo.ElecPriceVmo(); |
| | | _elecPrice.Settings = new Vmo.ElecPriceSetting(); |
| | | _elecPrice.Settings.MonthList = new List<Vmo.ElecPriceMonthSetting>(); |
| | | } |
| | | this.elecPriceViewModelBindingSource.DataSource = _allBindingList; |
| | | this.elecPriceViewModelBindingSource.ResetBindings(false); |
| | |
| | | { |
| | | var bll = new BLL.ElecPrice(); |
| | | _elecPrice.Settings.MonthList.Add(price); |
| | | if (_elecPrice.ID == 0) |
| | | { |
| | | var id = await bll.Insert(_elecPrice); |
| | | if (id > 0) |
| | | { |
| | | _elecPrice.ID = id; |
| | | foreach (var item in price.HourList) |
| | | { |
| | | this._allBindingList.Add(new ElecPriceViewModel |
| | | { |
| | | BelongName = $"{price.StartMonth}~{price.EndMonth}(月)", |
| | | StartHour = item.StartHour, |
| | | EndHour = item.EndHour, |
| | | Price = item.Price |
| | | }); |
| | | } |
| | | this.elecPriceViewModelBindingSource.ResetBindings(false); |
| | | return true; |
| | | } |
| | | return false; |
| | | } |
| | | var bol = await bll.Update(_elecPrice); |
| | | if (bol) |
| | | { |