protected override void GetFormSourceData(long oid) { if (oid != 0) { _entity = RevisionMaterial.Get(oid); _entity.BeginEdit(); } _mf_type = ManagerFormType.MFEdit; }
public RevisionAddForm(RevisionMaterial source) : base() { InitializeComponent(); _entity = source.Clone(); _entity.BeginEdit(); SetFormData(); _mf_type = ManagerFormType.MFAdd; this.Text = Resources.Labels.REVISION_ADD_TITLE; }
public RevisionEditForm(RevisionMaterial entity, MaterialDocente material, bool ismodal) : base(0, ismodal) { InitializeComponent(); _material = material; _entity = entity; if (_entity != null) { SetFormData(); this.Text = Resources.Labels.REVISION_EDIT_TITLE + " " + _entity.Version.ToUpper(); } _mf_type = ManagerFormType.MFEdit; }
/// <summary> /// Guarda en la bd el objeto actual /// </summary> protected override bool SaveObject() { using (StatusBusy busy = new StatusBusy(moleQule.Face.Resources.Messages.SAVING)) { this.Datos.RaiseListChangedEvents = false; RevisionMaterial temp = _entity.Clone(); temp.ApplyEdit(); // do the save try { _entity = temp.Save(); _entity.ApplyEdit(); //Decomentar si se va a mantener en memoria //_entity.BeginEdit(); return(true); } catch (iQValidationException ex) { MessageBox.Show(iQExceptionHandler.GetAllMessages(ex) + Environment.NewLine + ex.SysMessage, moleQule.Library.Application.AppController.APP_TITLE, MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return(false); } catch (Exception ex) { MessageBox.Show(iQExceptionHandler.GetAllMessages(ex), moleQule.Library.Application.AppController.APP_TITLE, MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return(false); } finally { this.Datos.RaiseListChangedEvents = true; } } }
protected override void GetFormSourceData() { _entity = RevisionMaterial.New(); _entity.BeginEdit(); }