protected override DialogResult showEditDialog(Building entity) { BuildingEditor editor = new BuildingEditor((BuildingDao)this.dao); try{ editor.entity = entity; editor.renderEntity(); return(editor.ShowDialog(this)); } catch (Exception ex) { MyMessageBox msgBox = new MyMessageBox("Data error!", ex, MyConstants.BOX_TYPE_ERROR); msgBox.ShowDialog(this); return(DialogResult.Abort); } }
protected override DialogResult showAddDialog(Building entity) { BuildingEditor editor = new BuildingEditor((BuildingDao)this.dao); try { Building building = new Building(); if (this.parentWindow.queryCondition != null) { building.project_id = this.parentWindow.queryCondition.project_id; building.stage_id = this.parentWindow.queryCondition.stage_id; } editor.entity = building; editor.renderEntity(); return(editor.ShowDialog(this)); } catch (Exception ex) { MyMessageBox msgBox = new MyMessageBox("Data error!", ex, MyConstants.BOX_TYPE_ERROR); msgBox.ShowDialog(this); return(DialogResult.Abort); } }