private void EditDicLevelOfRisk_Shown(object sender, EventArgs e) { if (this._editableId != -1) { this._entity = ApplicationMap.LevelsOfRisk[this._editableId]; this.nameTB.Text = _entity.Name; } }
private void saveBtn_Click(object sender, EventArgs e) { if (String.IsNullOrEmpty(nameTB.Text.Trim())) { this.Close(); return; } if (this._editableId != -1) { this._entity.Name = nameTB.Text.Trim(); ApplicationMap.LevelsOfRisk[this._editableId] = this._entity; } else { this._entity = new LevelOfRisk(this.nameTB.Text.Trim()); ApplicationMap.LevelsOfRisk[this._editableId] = this._entity; } this.DialogResult = System.Windows.Forms.DialogResult.OK; }