Пример #1
0
        public async Task <IdOutputDto <long> > UpdateAccountUnit(UpdateAccountUnitInput input)
        {
            var accountUnit = await _accountUnitRepository.GetAsync(input.AccountId);

            #region Setting the values to be updated

            accountUnit.AccountNumber          = input.AccountNumber;
            accountUnit.Caption                = input.Caption;
            accountUnit.ChartOfAccountId       = input.ChartOfAccountId;
            accountUnit.ParentId               = input.ParentId != 0 ? input.ParentId : null;
            accountUnit.OrganizationUnitId     = input.OrganizationUnitId;
            accountUnit.BalanceSheetName       = input.BalanceSheetName;
            accountUnit.CashFlowName           = input.CashFlowName;
            accountUnit.Description            = input.Description;
            accountUnit.IsActive               = input.IsActive;
            accountUnit.IsApproved             = input.IsApproved;
            accountUnit.IsBalanceSheet         = input.IsBalanceSheet;
            accountUnit.IsCashFlow             = input.IsCashFlow;
            accountUnit.IsDescriptionLocked    = input.IsDescriptionLocked;
            accountUnit.IsDocControlled        = input.IsDocControlled;
            accountUnit.IsElimination          = input.IsElimination;
            accountUnit.IsEnterable            = input.IsEnterable;
            accountUnit.IsProfitLoss           = input.IsProfitLoss;
            accountUnit.IsRollupAccount        = input.IsRollupAccount;
            accountUnit.IsRollupOverridable    = input.IsRollupOverridable;
            accountUnit.IsSummaryAccount       = input.IsSummaryAccount;
            accountUnit.IsUs1120BalanceSheet   = input.IsUs1120BalanceSheet;
            accountUnit.IsUs1120IncomeStmt     = input.IsUs1120IncomeStmt;
            accountUnit.LinkAccountId          = input.LinkAccountId;
            accountUnit.LinkJobId              = input.LinkJobId;
            accountUnit.ProfitLossName         = input.ProfitLossName;
            accountUnit.RollupAccountId        = input.RollupAccountId;
            accountUnit.IsAccountRevalued      = input.IsAccountRevalued;
            accountUnit.TypeOfCurrencyId       = input.TypeOfCurrencyId;
            accountUnit.TypeOfCurrencyRateId   = input.TypeOfCurrencyRateId;
            accountUnit.TypeofConsolidationId  = input.TypeofConsolidationId;
            accountUnit.RollupJobId            = input.RollupJobId;
            accountUnit.TypeOfAccountId        = input.TypeOfAccountId;
            accountUnit.Us1120BalanceSheetName = input.Us1120BalanceSheetName;
            accountUnit.DisplaySequence        = input.DisplaySequence;
            accountUnit.Us1120IncomeStmtName   = input.Us1120IncomeStmtName;
            #endregion

            await _accountUnitManager.UpdateAsync(accountUnit);

            await CurrentUnitOfWork.SaveChangesAsync();

            IdOutputDto <long> responseDto = new IdOutputDto <long>
            {
                AccountId = accountUnit.Id
            };
            return(responseDto);
        }
Пример #2
0
        /// <summary>
        /// Updating the Line
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        public async Task <AccountUnitDto> UpdateLineUnit(UpdateAccountUnitInput input)
        {
            var accountUnit = await _accountUnitRepository.GetAsync(input.AccountId);

            #region Setting the values to be updated

            accountUnit.AccountNumber         = input.AccountNumber;
            accountUnit.Caption               = input.Caption;
            accountUnit.ChartOfAccountId      = input.ChartOfAccountId;
            accountUnit.ParentId              = input.ParentId != 0 ? input.ParentId : null;
            accountUnit.RollupAccountId       = input.RollupAccountId;
            accountUnit.TypeOfCurrencyId      = input.TypeOfCurrencyId;
            accountUnit.TypeofConsolidationId = input.TypeofConsolidationId;
            accountUnit.RollupJobId           = input.RollupJobId;
            accountUnit.TypeOfAccountId       = input.TypeOfAccountId;
            #endregion

            await _accountUnitManager.UpdateAsync(accountUnit);

            await CurrentUnitOfWork.SaveChangesAsync();

            return(accountUnit.MapTo <AccountUnitDto>());
        }