private void OnButtonbtnGetResultsClick(object sender, System.Windows.RoutedEventArgs e)
 {
     AllStudentDetails.Clear();
     FinalAllotmentResults.Clear();
     InitializeAvailableSeatsAndAllotmentResults();
     ReadAndUpdateStudentData();
     AssignBranchToStudent();
 }
        private void AllocateStudentsToECE()
        {
            AllocateSpecialCategorySeats();
            foreach (var availableSeats in AllAvailableSeats)
            {
                AdjustSpecialCategorySeats(availableSeats);
            }
            AllocateBranchAndUpdateCollection();
            foreach (var availableSeats in AllAvailableSeats)
            {
                if (availableSeats.OCG > 0)
                {
                    availableSeats.OC += availableSeats.OCG;
                }
            }

            //Above test code
            AllocateBranchAndUpdateCollection();
            foreach (var availableSeats in AllAvailableSeats)
            {
                AdjustAvailableSeatsAfterallotment(availableSeats);
            }

            AllocateBranchAndUpdateCollection();
            foreach (var availableSeats in AllAvailableSeats)
            {
                AllocateRemainingSeatsToOpenCategory(availableSeats);
            }

            AllocateBranchAndUpdateCollection();
            foreach (var availableSeats in AllAvailableSeats)
            {
                if (availableSeats.OCG > 0)
                {
                    availableSeats.OC += availableSeats.OCG;
                }
            }
            AllocateBranchAndUpdateCollection();


            //AllocateSpecialCategorySeats();
            //foreach (var availableSeats in AllAvailableSeats)
            //{
            //    AdjustSpecialCategorySeats(availableSeats);
            //}

            //AllocateBranchAndUpdateCollection();
            //foreach (var availableSeats in AllAvailableSeats)
            //{
            //    if (availableSeats.OCG > 0)
            //    {
            //        availableSeats.OC += availableSeats.OCG;
            //    }
            //}
            AllocateBranchAndUpdateCollection();

            foreach (var AllotmentresultsCollection in AllAllotmentResults)
            {
                foreach (var result in AllotmentresultsCollection)
                {
                    FinalAllotmentResults.Add(result);
                }
            }
        }