/// <summary> /// Adds fixed allocation to the SelectedBooking item, removes single cost center /// </summary> /// <param name="fixedCostAllocation"></param> public void AddFixedCostAllocation(FixedCostAllocation fixedCostAllocation, int projectId = 0) { if (fixedCostAllocation == null) { throw new Exception("Bitte gültigen Kostenstellenschlüssel angeben."); } SelectedBooking.BookingCostCenterMappingList = new List <BookingCostCenterMapping>(); SelectedBooking.RefFixedCostAllocationId = fixedCostAllocation.FixedCostAllocationId; foreach (FixedCostAllocationDetail item in fixedCostAllocation.FixedCostAllocationDetails) { SelectedBooking.BookingCostCenterMappingList.Add(new BookingCostCenterMapping(0, item.RefCostCenterId, SelectedBooking.AmountWithoutTax * (decimal)(item.Shares / fixedCostAllocation.Shares.Sum()), projectId)); } }
public static bool Update(FixedCostAllocation FixedCostAllocation) { return(WebApi <bool> .PutAsync(controllerName, FixedCostAllocation, "Put").Result); }
public static int Insert(FixedCostAllocation FixedCostAllocation) { return(WebApi <int> .PostAsync(controllerName, FixedCostAllocation, "SinglePost").Result); }