public void Insert(Filial filial) { using (var session = NHibernateHelper.OpenSession()) { ValidarNome(filial, session); ValidarSigla(filial, session); var filialRepository = new DefaultRepository<Filial>(session); var listUsuarios = filial.Usuarios; filial.Usuarios = null; filialRepository.Insert(filial); session.Flush(); session.Clear(); filial = filialRepository.FindById(filial.Id); filial.Usuarios = listUsuarios; filialRepository.Update(filial); } }
public void Update(Movimentacao movimentacao) { using (var session = NHibernateHelper.OpenSession()) { var repository = new DefaultRepository<Movimentacao>(session); repository.Update(movimentacao); } }
public void Update(Usuario usuario) { using (var session = NHibernateHelper.OpenSession()) { ValidarNome(usuario, session); var repository = new DefaultRepository<Usuario>(session); repository.Update(usuario); } }
public void Update(GrupoVisao grupoVisao) { using (var session = NHibernateHelper.OpenSession()) { ValidarNome(grupoVisao, session); var repository = new DefaultRepository<GrupoVisao>(session); repository.Update(grupoVisao); } }
public void Update(Visao visao) { using (var session = NHibernateHelper.OpenSession()) { ValidarNome(visao, session); var visaoRepository = new DefaultRepository<Visao>(session); visaoRepository.Update(visao); } }
public void Update(Indicador indicador) { using (var session = NHibernateHelper.OpenSession()) { if (indicador.TipoCalculo == TipoCalculoEnum.Banco) ValidarIndicadorBanco(indicador, session); var repository = new DefaultRepository<Indicador>(session); repository.Update(indicador); } }
/// <summary>Creates the core Google.Apis packages.</summary> private void DoStep1() { if (BuildVersion != 0) { DefaultRepository.Update(string.Format("{0}.{1}", MajorVersion, MinorVersion)); } // if there are incoming changes those changes will be printed, otherwise we can continue in the process if (!HasIncomingChanges(new List <Hg> { DefaultRepository })) { // in case build fails the method will print its failures if (BuildDefaultRepository()) { CreateCoreNuGetPackages(); // TODO(peleyal): release notes should be part of the package } } }
/// <summary>Creates the core Google.Apis packages.</summary> private void DoStep1() { if (BuildVersion != 0) { DefaultRepository.Update(string.Format("{0}.{1}", MajorVersion, MinorVersion)); } // if there are incoming changes those changes will be printed, otherwise we can continue in the process if (!HasIncomingChanges(new List <Hg> { DefaultRepository })) { // in case build fails the method will print its failures // TODO(peleyal): Currently a WP project can't be build. NEED TO INVESTIGATE MORE. if (BuildDefaultRepository()) { CreateCoreNuGetPackages(); } } }
internal static Content Update(Content content) { var binding = content.WorkflowBinding; var newContent = DefaultRepository.Update <Content, ContentDAL>(content); binding.SetContent(newContent); WorkflowRepository.UpdateContentWorkflowBind(binding); // Обновить свойства у агрегированных контентов foreach (var aggregated in content.AggregatedContents) { var localAggregated = aggregated; localAggregated.AutoArchive = content.AutoArchive; localAggregated = DefaultRepository.Update <Content, ContentDAL>(localAggregated); binding.SetContent(localAggregated); WorkflowRepository.UpdateContentWorkflowBind(binding); } return(GetById(newContent.Id)); }
public void Insert(GrupoVisao grupoVisao) { using (var session = NHibernateHelper.OpenSession()) { ValidarNome(grupoVisao, session); var repository = new DefaultRepository<GrupoVisao>(session); var listVisoes = grupoVisao.Visoes; grupoVisao.Visoes = null; repository.Insert(grupoVisao); session.Flush(); session.Clear(); grupoVisao = repository.FindById(grupoVisao.Id); grupoVisao.Visoes = listVisoes; repository.Update(grupoVisao); } }
public void Insert(Visao visao) { using (var session = NHibernateHelper.OpenSession()) { ValidarNome(visao, session); var visaoRepository = new DefaultRepository<Visao>(session); var listIndicadores = visao.Indicadores; visao.Indicadores = null; visaoRepository.Insert(visao); session.Flush(); session.Clear(); visao = visaoRepository.FindById(visao.Id); visao.Indicadores = listIndicadores; visaoRepository.Update(visao); } }
public EntityPermission Update(EntityPermission permission) => DefaultRepository.Update <EntityPermission, ContentPermissionDAL>(permission);
public EntityPermission Update(EntityPermission permission) => DefaultRepository.Update <EntityPermission, BackendActionPermissionDAL>(permission);
public EntityPermission Update(EntityPermission permission) => DefaultRepository.Update <EntityPermission, ArticlePermissionDAL>(permission);
public void UpdateDefaultUnit(Unit unit) { DefaultRepository.Update(unit); }
Field IFieldRepository.Update(Field item) { using (var scope = new QPConnectionScope()) { try { if (QPContext.DatabaseType == DatabaseType.SqlServer) { ChangeMaxOrderTriggerState(scope.DbConnection, false); ChangeM2MDefaultTriggerState(scope.DbConnection, false); ChangeCleanEmptyLinksTriggerState(scope.DbConnection, false); ChangeInsertFieldTriggerState(scope.DbConnection, false); ChangeUpdateFieldTriggerState(scope.DbConnection, false); } var preUpdateField = GetById(item.Id); var constraint = item.Constraint; var dynamicImage = item.DynamicImage; var fieldValues = item.QpPluginFieldValues; item.ReorderContentFields(); UpdateBackwardFields(item, preUpdateField); var newItem = DefaultRepository.Update <Field, FieldDAL>(item); var oldDal = GetDal(preUpdateField); var newDal = GetDal(newItem); Common.UpdateColumn(scope.DbConnection, oldDal, newDal); UpdateRelationData(item, preUpdateField); if (oldDal.Order != item.Order) { RecreateNewViews(item.ContentId); } UpdateConstraint(constraint, newItem); UpdateDynamicImage(dynamicImage, newItem); UpdatePluginValues(fieldValues, newItem.Id); if (newDal.LinkId != oldDal.LinkId) { DropLinkWithCheck(scope.DbConnection, oldDal); } return(GetById(newItem.Id)); } finally { if (QPContext.DatabaseType == DatabaseType.SqlServer) { ChangeMaxOrderTriggerState(scope.DbConnection, true); ChangeM2MDefaultTriggerState(scope.DbConnection, true); ChangeCleanEmptyLinksTriggerState(scope.DbConnection, true); ChangeInsertFieldTriggerState(scope.DbConnection, true); ChangeUpdateFieldTriggerState(scope.DbConnection, true); } } } }
public EntityPermission Update(EntityPermission permission) => DefaultRepository.Update <EntityPermission, WorkflowPermissionDAL>(permission);
public void Update(Filial filial) { using (var session = NHibernateHelper.OpenSession()) { var filialRepository = new DefaultRepository<Filial>(session); filialRepository.Update(filial); } }
public EntityPermission Update(EntityPermission permission) => DefaultRepository.Update <EntityPermission, SiteFolderPermissionDAL>(permission);