Example #1
0
        private void ShowSelectedInfo()
        {
            if (listViewSales.SelectedItems.Count == 0)
            {
                return;
            }

            var type = listViewSales.SelectedItems[0].SubItems[1].Text;
            var id   = int.Parse(listViewSales.SelectedItems[0].Tag.ToString());

            if (type.Equals("Sale"))
            {
                var showSaleInfo = new ShowSaleInfo(SalesService.GetSaleById(id));
                showSaleInfo.ShowDialog(this);
                showSaleInfo.Dispose();
            }
            else
            {
                var showPrescriptionInfo = new ShowPrescriptionInfo(PrescriptionsService.GetPrescriptionById(id));
                showPrescriptionInfo.ShowDialog(this);
                showPrescriptionInfo.Dispose();
            }
        }