public void SetObjects() { if (!BillingIds.Equals("N/A")) { Thread dbThread = new Thread(() => { int[] ids = ParseIds(BillingIds); List <BillingItem> temp = Database.GetBillingItems(ids); items.AddRange(temp); }) { IsBackground = true }; dbThread.Start(); } if (!LineItemIds.Equals("N/A")) { Thread dbThread = new Thread(() => { int[] ids = ParseIds(LineItemIds); List <LineItem> temp = Database.GetLineItems(ids); lineItems.AddRange(temp); }) { IsBackground = true }; dbThread.Start(); } }
public void RemoveLineItemID(int id) { StringBuilder str = new StringBuilder(LineItemIds); str.Replace($"{id},", string.Empty); LineItemIds = str.ToString().Trim(); if (LineItemIds.Equals("")) { LineItemIds = "N/A"; } }
public void AddLineItemID(int id) { if (LineItemIds.Equals("N/A")) { LineItemIds = ""; } if (LineItemIds.Contains($"{id}")) { return; } StringBuilder str = new StringBuilder(LineItemIds); str.Append($"{id}, "); LineItemIds = str.ToString().Trim(); }