void initFormOperations(int saleId) { tbl_Sale sale = Sale.getById(saleId); dg_ItemPurchased.ItemsSource = SaleItem.getAllBySaleId(saleId); tbl_Customer customer = Customer.getById((int)sale.Customer_Id); if (customer != null) { lbl_CustomerName.Content = customer.Name; } lbl_SaleId.Content = saleId; lbl_Date.Content = ((DateTime)sale.Date_Time).ToShortDateString(); lbl_Total.Content = sale.Amount; }