/// <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 }
/// <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); }
/// <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); }