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