public AuditoriaAddForm(Auditoria source) : base() { InitializeComponent(); _entity = source.Clone(); _entity.BeginEdit(); SetFormData(); _mf_type = ManagerFormType.MFAdd; this.Text = Resources.Labels.AUDITORIA_ADD_TITLE; }
/// <summary> /// Guarda en la bd el objeto actual /// </summary> protected bool SaveObject() { using (StatusBusy busy = new StatusBusy(moleQule.Face.Resources.Messages.SAVING)) { this.Datos.RaiseListChangedEvents = false; Auditoria temp = _auditoria.Clone(); temp.ApplyEdit(); // do the save try { _auditoria = temp.Save(); _auditoria.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, AppController.APP_TITLE, MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return(false); } catch (Exception ex) { MessageBox.Show(iQExceptionHandler.GetAllMessages(ex), AppController.APP_TITLE, MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return(false); } finally { this.Datos.RaiseListChangedEvents = true; } } }