protected override void UpdateEntityFieldsInternal(InspektionsRouteGISModel model, InspektionsRouteGIS entity)
        {
            base.UpdateEntityFieldsInternal(model, entity);
            IGeometry shape = null;

            entity.InspektionsRtStrAbschnitteList.Clear();

            foreach (InspektionsRtStrAbschnitteModel irsa in model.InspektionsRtStrAbschnitteModelList)
            {
                var str = GetEntityById <StrassenabschnittGIS>(irsa.StrassenabschnittId);
                if (shape != null)
                {
                    shape = shape.Union(str.Shape);
                }
                else
                {
                    shape = str.Shape;
                }
                entity.AddStrassenabschnittGIS(str);
            }
            entity.Shape = shape;

            CurrentSession.Flush(); //Make sure that InspektionsRtStrAbschnitten are created
            if (entity.LegendNumber == null)
            {
                entity.LegendNumber = GetLegendNumber();
            }
        }
示例#2
0
 /// <summary>
 /// Commit NHibernate transaction.
 /// </summary>
 public static void CommitTransaction()
 {
     _logger.Debug("Commit NHibernate transaction.");
     if (CurrentSession != null && CurrentSession.Transaction.IsActive)
     {
         CurrentSession.Flush();
         CurrentSession.Transaction.Commit();
     }
 }
示例#3
0
 public static void FlushSessionToDbAndClear()
 {
     CurrentSession.Flush();
     if (DoNotClearSession)
     {
         return;
     }
     CurrentSession.Clear();
 }
示例#4
0
        public void DeleteByTitle(String title)
        {
            var queryResult = CurrentSession.QueryOver <AnnouncementDTO>()
                              .Where(p => p.Title == title);

            if (queryResult != null && queryResult.RowCount() > 0)
            {
                IList <AnnouncementDTO> peopleToBeDeleted = queryResult.List();
                peopleToBeDeleted.ForEach(personToBeDeleted => CurrentSession.Delete(personToBeDeleted));
                CurrentSession.Flush();
            }
        }
示例#5
0
        public void Save(IDamageHandlingMethodState state)
        {
            IDamageHandlingMethodState s = state;

            CurrentSession.SaveOrUpdate(s);

            var saveable = s as ISaveable;

            if (saveable != null)
            {
                saveable.Save();
            }
            CurrentSession.Flush();
        }
        public void Save(IMovementTypeState state)
        {
            IMovementTypeState s = state;

            CurrentSession.SaveOrUpdate(s);

            var saveable = s as ISaveable;

            if (saveable != null)
            {
                saveable.Save();
            }
            CurrentSession.Flush();
        }
        public void Save(ISellableInventoryItemState state)
        {
            ISellableInventoryItemState s = state;

            CurrentSession.SaveOrUpdate(s);

            var saveable = s as ISaveable;

            if (saveable != null)
            {
                saveable.Save();
            }
            CurrentSession.Flush();
        }
示例#8
0
        /// <summary>
        ///     The commit.
        /// </summary>
        /// <returns>
        ///     The <see cref="int" />.
        /// </returns>
        public virtual int Commit()
        {
            if (currentSession?.Transaction != null && currentSession.Transaction.IsActive)
            {
                CurrentSession?.Transaction.Commit();
                CloseTransaction();
            }
            else
            {
                CurrentSession.Flush();
            }

            return(1);
        }
        public void Save(IInventoryPRTriggeredState state)
        {
            IInventoryPRTriggeredState s = state;

            CurrentSession.SaveOrUpdate(s);

            var saveable = s as ISaveable;

            if (saveable != null)
            {
                saveable.Save();
            }
            CurrentSession.Flush();
        }
        public void Save(IInventoryPostingRuleState state)
        {
            IInventoryPostingRuleState s = state;

            if (ReadOnlyProxyGenerator != null)
            {
                s = ReadOnlyProxyGenerator.GetTarget <IInventoryPostingRuleState>(state);
            }
            CurrentSession.SaveOrUpdate(s);

            var saveable = s as ISaveable;

            if (saveable != null)
            {
                saveable.Save();
            }
            CurrentSession.Flush();
        }
示例#11
0
        public void Save(IMovementConfirmationState state)
        {
            IMovementConfirmationState s = state;

            if (ReadOnlyProxyGenerator != null)
            {
                s = ReadOnlyProxyGenerator.GetTarget <IMovementConfirmationState>(state);
            }
            CurrentSession.SaveOrUpdate(s);

            var saveable = s as ISaveable;

            if (saveable != null)
            {
                saveable.Save();
            }
            CurrentSession.Flush();
        }
        public void Save(IOrderItemMvoState state)
        {
            IOrderItemMvoState s = state;

            if (ReadOnlyProxyGenerator != null)
            {
                s = ReadOnlyProxyGenerator.GetTarget <IOrderItemMvoState>(state);
            }
            CurrentSession.SaveOrUpdate(s);

            var saveable = s as ISaveable;

            if (saveable != null)
            {
                saveable.Save();
            }
            CurrentSession.Flush();
        }
        public void Save(IProductCategoryMemberState state)
        {
            IProductCategoryMemberState s = state;

            if (ReadOnlyProxyGenerator != null)
            {
                s = ReadOnlyProxyGenerator.GetTarget <IProductCategoryMemberState>(state);
            }
            CurrentSession.SaveOrUpdate(s);

            var saveable = s as ISaveable;

            if (saveable != null)
            {
                saveable.Save();
            }
            CurrentSession.Flush();
        }
        public void Save(IAttributeSetInstanceExtensionFieldState state)
        {
            IAttributeSetInstanceExtensionFieldState s = state;

            if (ReadOnlyProxyGenerator != null)
            {
                s = ReadOnlyProxyGenerator.GetTarget <IAttributeSetInstanceExtensionFieldState>(state);
            }
            CurrentSession.SaveOrUpdate(s);

            var saveable = s as ISaveable;

            if (saveable != null)
            {
                saveable.Save();
            }
            CurrentSession.Flush();
        }
        public void Save(IShipmentMethodTypeState state)
        {
            IShipmentMethodTypeState s = state;

            if (ReadOnlyProxyGenerator != null)
            {
                s = ReadOnlyProxyGenerator.GetTarget <IShipmentMethodTypeState>(state);
            }
            CurrentSession.SaveOrUpdate(s);

            var saveable = s as ISaveable;

            if (saveable != null)
            {
                saveable.Save();
            }
            CurrentSession.Flush();
        }
示例#16
0
 public void Save(ProductionOrderMaterialsPackage entity)
 {
     CurrentSession.SaveOrUpdate(entity);
     CurrentSession.Flush();
 }
 public void Save(ExpenditureWaybill entity)
 {
     CurrentSession.SaveOrUpdate(entity);
     CurrentSession.Flush();
 }
示例#18
0
 public void Save(MovementWaybill entity)
 {
     CurrentSession.SaveOrUpdate(entity);
     CurrentSession.Flush();
 }
示例#19
0
 public void Save(ReturnFromClientWaybill entity)
 {
     CurrentSession.SaveOrUpdate(entity);
     CurrentSession.Flush();
 }
 public void Save(AccountingPriceList entity)
 {
     CurrentSession.SaveOrUpdate(entity);
     CurrentSession.Flush();
 }
示例#21
0
 /// <summary>
 /// Flushes current nhibernate session
 /// </summary>
 public static void FlushSession()
 {
     CurrentSession.Flush();
 }
示例#22
0
 public void Save(DealPaymentToClient value)
 {
     CurrentSession.SaveOrUpdate(value);
     CurrentSession.Flush();
 }
示例#23
0
 /// <summary>
 /// Сохранение изменений
 /// </summary>
 public void Flush()
 {
     CurrentSession.Flush();
 }
 public void Save(DealCreditInitialBalanceCorrection value)
 {
     CurrentSession.SaveOrUpdate(value);
     CurrentSession.Flush();
 }
 public void Save(WriteoffWaybill entity)
 {
     CurrentSession.SaveOrUpdate(entity);
     CurrentSession.Flush();
 }
示例#26
0
 public void Save(ChangeOwnerWaybill entity)
 {
     CurrentSession.SaveOrUpdate(entity);
     CurrentSession.Flush();
 }