internal void DeleteSelf(Empresa parent) { // if we're not dirty then don't update the database if (!this.IsDirty) { return; } // if we're new then don't update the database if (this.IsNew) { return; } try { parent.Session().Delete(parent.Session().Get <ContactoEmpresa>(Oid)); } catch (Exception ex) { throw new iQPersistentException(iQExceptionHandler.GetAllMessages(ex)); } MarkNew(); }
internal void Update(Empresa parent) { // if we're not dirty then don't update the database if (!this.IsDirty) { return; } _oid_empresa = parent.Oid; try { ValidationRules.CheckRules(); if (!IsValid) { throw new iQValidationException(moleQule.Library.Resources.Messages.GENERIC_VALIDATION_ERROR); } ContactoEmpresa obj = parent.Session().Get <ContactoEmpresa>(Oid); obj.CopyValues(this); parent.Session().Update(obj); } catch (Exception ex) { throw new iQPersistentException(iQExceptionHandler.GetAllMessages(ex)); } MarkOld(); }
internal void Insert(Empresa parent) { // if we're not dirty then don't update the database if (!this.IsDirty) { return; } _oid_empresa = parent.Oid; try { ValidationRules.CheckRules(); if (!IsValid) { throw new iQValidationException(moleQule.Library.Resources.Messages.GENERIC_VALIDATION_ERROR); } parent.Session().Save(this); } catch (Exception ex) { iQExceptionHandler.TreatException(ex); } MarkOld(); }
internal void Insert(Empresa parent) { // if we're not dirty then don't update the database if (!this.IsDirty) { return; } try { parent.Session().Save(this); } catch (Exception ex) { throw new iQPersistentException(iQExceptionHandler.GetAllMessages(ex)); } MarkOld(); }
internal void Insert(Empresa parent) { // if we're not dirty then don't update the database if (!this.IsDirty) { return; } try { parent.Session().Save(this); } catch (Exception ex) { iQExceptionHandler.TreatException(ex); } MarkOld(); }