public void SetSaleDetailUIs(int SaleId) { List <SaleDetailUI> saleDetailUIs = new(); List <SaleDetail> saleDetails = SaleServices.getSaleDetailsOneSale(SaleId); foreach (SaleDetail saleDetail in saleDetails) { saleDetailUIs.Add(new() { Product = ProductServices.GetProduct(saleDetail.ProductCode), SaleDetail = saleDetail }); } ListSaleDetails = saleDetailUIs; }