Example #1
0
        public async Task <BudgetPositionExtend> CreateNewBudgetPositionWithInvoiceNumber(BudgetExtend actualExpenseBudget,
                                                                                          BudgetPositionExtend plannedExpenseBudgetPosition,
                                                                                          double amount, CustomExpandDefaultExtend invoiceField, string invoiceFieldValue)
        {
            var position = await CreateNewBudgetPosition(actualExpenseBudget, plannedExpenseBudgetPosition, amount, invoiceFieldValue);

            await AttachInvoiceNumberToBudgetPosition(position, invoiceField, invoiceFieldValue);

            return(position);
        }
Example #2
0
        private async Task <CustomExpandExtend> AttachInvoiceNumberToBudgetPosition(BudgetPositionExtend position, CustomExpandDefaultExtend invoiceField, string invoiceFieldValue)
        {
            // create new queries
            var customExpands = await _context.customexpandextend.GetCustomExpand(position.BudgetPositionId);

            var customExpand = customExpands
                               .FirstOrDefault(k => k.CustomExpandDefaultId == invoiceField.CustomExpandDefaultId);

            // save
            await _context.customexpandextend.PatchCustomExpand(customExpand.CustomExpandId, ConstantsHelper.CUSTOM_FIELD_TYPE_STRING_VALUE, invoiceFieldValue);

            return(customExpand);
        }