protected override DialogResult showEditDialog(Floorplan entity) { FloorplanEditor editor = new FloorplanEditor((FloorplanDao)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(Floorplan entity) { FloorplanEditor editor = new FloorplanEditor((FloorplanDao)this.dao); try { Floorplan floorplan = new Floorplan(); if (this.parentWindow.queryCondition != null) { floorplan.project_id = this.parentWindow.queryCondition.project_id; floorplan.stage_id = this.parentWindow.queryCondition.stage_id; floorplan.building_id = this.parentWindow.queryCondition.building_id; } editor.entity = floorplan; 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); } }