/// <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; if (!CreaSesiones()) { return(true); } if (_entity.IsDirty) { if (!CrearPartes()) { MessageBox.Show(Resources.Messages.ERROR_CREAR_PARTES); return(false); } } Horario 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; } } }