Exemple #1
0
        protected override DialogResult showEditDialog(Media entity)
        {
            MediaEditor editor = new MediaEditor((MediaDao)this.dao);

            editor.entity = entity;
            try
            {
                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 showAddDialog(Media entity)
        {
            MediaEditor editor = new MediaEditor((MediaDao)this.dao);

            try
            {
                Media media = new Media();
                if (this.parentWindow.queryCondition != null)
                {
                    media.project_id = this.parentWindow.queryCondition.project_id;
                }
                editor.entity = media;
                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);
            }
        }