예제 #1
0
        /// <summary>
        /// Delete an entity.
        /// </summary>
        /// <param name="model"></param>
        public void Delete(SalesRebateViewModel model)
        {
            var entity = model.ToEntity();

            this._SalesRebatesRepository.Delete(entity);

            #region Commit Changes
            this._unitOfWork.Commit();
            #endregion
        }
예제 #2
0
        /// <summary>
        /// Update an entity.
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public SalesRebateViewModel Update(SalesRebateViewModel model)
        {
            this.ThrowExceptionIfExist(model);

            var entity = model.ToEntity();

            entity = this._SalesRebatesRepository.Update(entity);

            #region Commit Changes
            this._unitOfWork.Commit();
            #endregion

            model = entity.ToModel();
            return(model);
        }
예제 #3
0
        /// <summary>
        /// Add an entity.
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public SalesRebateViewModel Add(SalesRebateViewModel model)
        {
            this.ThrowExceptionIfExist(model);

            var entity = model.ToEntity();

            entity = this._SalesRebatesRepository.Add(entity);

            #region Commit Changes
            this._unitOfWork.Commit();
            #endregion

            this._journalPostingsService.TryPostAutomatic(entity.Id, MovementType.SalesRebate);

            model = entity.ToModel();
            return(model);
        }