Exemple #1
0
        protected override DialogResult showAddDialog(Apartment entity)
        {
            ApartmentEditor editor = new ApartmentEditor((ApartmentDao)this.dao);

            try
            {
                Apartment apartment = new Apartment();
                if (this.parentWindow.queryCondition != null)
                {
                    apartment.floorplan_id = this.parentWindow.queryCondition.floorplan_id;
                    apartment.building_id  = this.parentWindow.queryCondition.building_id;
                    apartment.stage_id     = this.parentWindow.queryCondition.stage_id;
                    apartment.project_id   = this.parentWindow.queryCondition.project_id;
                }
                editor.entity = apartment;
                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);
            }
        }
Exemple #2
0
        protected override DialogResult showEditDialog(Apartment entity)
        {
            ApartmentEditor editor = new ApartmentEditor((ApartmentDao)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);
            }
        }