Ejemplo n.º 1
0
        void FillWithData(HashSet <Medicine> AllMedicine)
        {
            //clear each panel before filling up
            ListPanel.Children.Clear();
            ListPanel2.Children.Clear();

            if (!isSamllCard)
            {
                foreach (Medicine medicine in AllMedicine)
                {
                    MediListCardControl medInfoCard = new MediListCardControl(medicine.name,
                                                                              medicine.medicineOverAllInfo.stocked, medicine.medicineOverAllInfo.batchs,
                                                                              medicine.medicineOverAllInfo.expiredB, medicine.medicineOverAllInfo.currentPrice, medicine.tags);
                    ListPanel.Children.Add(medInfoCard);
                }
            }

            if (isSamllCard)
            {
                foreach (Medicine medicine in AllMedicine)
                {
                    MediListCardControlSmall medInfoCard = new MediListCardControlSmall(medicine.name);
                    medInfoCard.StockedP = medicine.medicineOverAllInfo.stocked;
                    medInfoCard.PriceP   = medicine.medicineOverAllInfo.currentPrice;
                    medInfoCard.BatchP   = medicine.medicineOverAllInfo.batchs;
                    medInfoCard.BatchEP  = medicine.medicineOverAllInfo.expiredB;
                    medInfoCard.Schedule = medicine.medicineScheduleInfo.noOfSch;
                    ListPanel2.Children.Add(medInfoCard);
                }
            }


            if (ListPanel.Children.Count == 0)
            {
                ListPanel.Children.Clear();
                ListPanel.Children.Add(noRecordWarningText);
            }
            if (ListPanel2.Children.Count == 0)
            {
                ListPanel2.Children.Clear();
                ListPanel2.Children.Add(noRecordWarningTextSmall);
            }
        }
Ejemplo n.º 2
0
 //Two type of Cards exchange
 //look next defination for details
 private void btnBigCard_Click(object sender, RoutedEventArgs e)
 {
     isSamllCard           = false;
     isBigCard             = true;
     ListPanel2.Visibility = Visibility.Collapsed;
     ListPanel.Visibility  = Visibility.Visible;
     ListPanel.Children.Clear();
     foreach (Medicine medicine in AllMedicine)
     {
         MediListCardControl medInfoCard = new MediListCardControl(medicine.name,
                                                                   medicine.medicineOverAllInfo.stocked, medicine.medicineOverAllInfo.batchs,
                                                                   medicine.medicineOverAllInfo.expiredB, medicine.medicineOverAllInfo.currentPrice, medicine.tags);
         ListPanel.Children.Add(medInfoCard);
     }
     if (ListPanel.Children.Count == 0)
     {
         ListPanel.Children.Clear();
         ListPanel.Children.Add(noRecordWarningText);
     }
 }