/// <summary> /// /// </summary> public frmPlanHeatItem( int grdeviceID, int planHeatID, PlanHeatItem planHeatItem) { if (planHeatItem == null) throw new ArgumentNullException("dbGRPlanHeat"); InitializeComponent(); InitControls(); this._planHeatItem = planHeatItem; this._grDeviceID = grdeviceID; this._planHeatID = planHeatID; this._editMonth = planHeatItem.Month; this._adeState = ADEState.Edit; this.numMonth.Value = this._planHeatItem.Month; this.numPlanHeat.Value = this._planHeatItem.PlanHeat; }
/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnEdit_Click(object sender, EventArgs e) { if (this.dgvPlanHeat.CurrentRow != null) { DataRowView rv = this.dgvPlanHeat.CurrentRow.DataBoundItem as DataRowView ; int month = Convert.ToInt32(rv["month"]); int planHeat = Convert.ToInt32(rv["planHeat"]); int planHeatID = Convert.ToInt32(rv["planHeatID"]); PlanHeatItem item = new PlanHeatItem(); item.Month = month; item.PlanHeat = planHeat; frmPlanHeatItem f = new frmPlanHeatItem(this._grDeviceID, planHeatID, item); DialogResult dr = f.ShowDialog(this); if (dr == DialogResult.OK) { RefreshPlanHeatDataGridView(this._grDeviceID); } } }