public void SaveFixedCostAllocation() { if (SelectedFixedCostAllocation.FixedCostAllocationId > 0) { FixedCostAllocations.Update(SelectedFixedCostAllocation); foreach (FixedCostAllocationDetail item in SelectedFixedCostAllocation.FixedCostAllocationDetails) { if (item.RefFixedCostAllocationId == 0) { item.RefFixedCostAllocationId = SelectedFixedCostAllocation.FixedCostAllocationId; FixedCostAllocationDetails.Insert(item); } else { FixedCostAllocationDetails.Update(item); } } } else { int id = FixedCostAllocations.Insert(SelectedFixedCostAllocation); foreach (FixedCostAllocationDetail item in SelectedFixedCostAllocation.FixedCostAllocationDetails) { item.RefFixedCostAllocationId = id; FixedCostAllocationDetails.Insert(item); } } }
private void GetData() { FilteredTaxTypes = new SvenTechCollection <TaxType>(Globals.CoreData.TaxTypeList); CostAccountList = CostAccounts.GetAllVisible().ToList(); CostCenterCategoryList = CostCenterCategories.GetAll().ToSvenTechCollection(); ProjectList = Projects.GetAll().ToSvenTechCollection(); FixedCostAllocationList = FixedCostAllocations.GetAll().ToSvenTechCollection(); }
public void DeleteFixedCostAllocation() { if (SelectedFixedCostAllocation.FixedCostAllocationId != 0) { FixedCostAllocations.Delete(SelectedFixedCostAllocation.FixedCostAllocationId); } FixedCostAllocationList.Remove(SelectedFixedCostAllocation); }
private void GetData() { CostCenterCategoryList = CostCenterCategories.GetAll().ToSvenTechCollection(); FixedCostAllocationList = FixedCostAllocations.GetAll().ToSvenTechCollection(); foreach (FixedCostAllocation fixedCostAllocation in FixedCostAllocationList) { foreach (FixedCostAllocationDetail detail in fixedCostAllocation.FixedCostAllocationDetails) { detail.CostCenter.CostCenterCategory = CostCenterCategoryList.Single(x => x.CostCenterCategoryId == detail.CostCenter.RefCostCenterCategoryId); } } }