Ejemplo n.º 1
0
 public void DeleteFixedCostAllocationDetail()
 {
     try
     {
         FixedCostAllocationDetail itemToRemove = SelectedFixedCostAllocation?.FixedCostAllocationDetails.Single(x => x.CostCenter == SelectedFixedCostAllocationDetail.CostCenter);
         SelectedFixedCostAllocation?.FixedCostAllocationDetails.Remove(itemToRemove);
         if (itemToRemove.FixedCostAllocationDetailId != 0)
         {
             FixedCostAllocationDetails.Delete(itemToRemove.FixedCostAllocationDetailId);
         }
     }
     catch (Exception)
     {
         // TODO Error Message
     }
 }
Ejemplo n.º 2
0
        public void AddFixedCostAllocationDetail()
        {
            if (SelectedFixedCostAllocation == null)
            {
                return;
            }

            if (DoesCostCenterAlreadyExist(SelectedCostCenter.CostCenterId))
            {
                Messenger.Default.Send(new OpenDialogWindowMessage("Fehler", "Kostenstelle ist bereits enhalten.", MessageBoxImage.Asterisk));
                return;
            }

            FixedCostAllocationDetail newFixedCostAllocationDetail = new FixedCostAllocationDetail()
            {
                CostCenter      = SelectedCostCenter,
                RefCostCenterId = SelectedCostCenter.CostCenterId,
                Shares          = Shares
            };

            newFixedCostAllocationDetail.CostCenter.CostCenterCategory = SelectedCostCenterCategory;
            SelectedFixedCostAllocation.FixedCostAllocationDetails.Add(newFixedCostAllocationDetail);
        }
 public static bool Update(FixedCostAllocationDetail FixedCostAllocationDetail)
 {
     return(WebApi <bool> .PutAsync(controllerName, FixedCostAllocationDetail, "Put").Result);
 }
 public static int Insert(FixedCostAllocationDetail FixedCostAllocationDetail)
 {
     return(WebApi <int> .PostAsync(controllerName, FixedCostAllocationDetail, "SinglePost").Result);
 }