示例#1
0
 public EditDataPage(TicketDetails ticketDetails, TicketDetailList detailList)
 {
     InitializeComponent();
     Details     = ticketDetails;
     DataContext = Details;
     DetailList  = new TicketDetailList();
     DetailList  = detailList;
 }
示例#2
0
 // method to populate the ObservableCollection
 private ObservableCollection <TicketDetails> PopulateCollection(TicketDetailList detailListData)
 {
     TicketDetailCollection = new ObservableCollection <TicketDetails>();
     for (int i = 0; i < detailListData.Count(); ++i)
     {
         var tDetails = DetailList[i];
         TicketDetailCollection.Add(tDetails);
     }
     return(TicketDetailCollection);
 }
示例#3
0
 private void GenerateXMLData(TicketDetailList detailList)
 {
     if (detailList.Count() > 0)
     {
         XmlSerializer serializer =
             new XmlSerializer(typeof(TicketDetailList));
         TextWriter writer = new StreamWriter("BoockedShowsDetails.xml");
         serializer.Serialize(writer, detailList);
         writer.Close();
     }
 }
示例#4
0
        // constructor with TicketDetailList to handle the drid item source,
        //   writing & reading XML files and ObservableCollection
        public DisplayDataGrid(TicketDetailList detailList)
        {
            InitializeComponent();
            TicketData                = new TicketDetails();
            DetailList                = new TicketDetailList();
            DetailList                = detailList;
            TicketDetailCollection    = PopulateCollection(DetailList);
            dgShowDetails.ItemsSource = TicketDetailCollection.OrderBy(t => t.ShowDate);

            GenerateXMLData(DetailList);
        }
        public ShowEntry()
        {
            InitializeComponent();
            DetailList                  = new TicketDetailList();
            TicketDetailCollection      = new ObservableCollection <TicketDetails>();
            TicketData                  = new TicketDetails();
            comboBoxShowDay.ItemsSource = GetDays();
            Group group = GenreMovieSelction();

            comboBoxGenre.DataContext      = group;
            comboBoxMovie.DataContext      = group;
            txtBoxNumberOfSeat.DataContext = this;
            txtBoxName.DataContext         = this;
        }
        public ShowEntry(TicketDetailList detailList)
        {
            InitializeComponent();
            DetailList             = new TicketDetailList();
            TicketDetailCollection = new ObservableCollection <TicketDetails>();
            DetailList             = detailList;
            for (int i = 0; i < DetailList.Count(); ++i)
            {
                var tDetails = DetailList[i];
                TicketDetailCollection.Add(tDetails);
            }

            TicketData = new TicketDetails();
            comboBoxShowDay.ItemsSource = GetDays();
            Group group = GenreMovieSelction();

            comboBoxGenre.DataContext      = group;
            comboBoxMovie.DataContext      = group;
            txtBoxNumberOfSeat.DataContext = this;
            txtBoxName.DataContext         = this;
        }