protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.professor_page); _professorRecyclerView = FindViewById <RecyclerView>(Resource.Id.professorPageRecyclerView); // Create your application here _professorLayoutManager = new LinearLayoutManager(this); _addProfessorButton = FindViewById <Button>(Resource.Id.addProfessorButton); _professorRecyclerView.SetLayoutManager(_professorLayoutManager); _professorAdapter = new ProfessorAdapter(); _professorRecyclerView.SetAdapter(_professorAdapter); thisRepository.LoadInstructors(); thisProfList = thisRepository.GetAllProfessors(); thisProfString = setProfSpinner(); FindView(); LinkEventHandlers(); var spinnerProfDelete = FindViewById <Spinner>(Resource.Id.ProfessorDeleteSpinner); spinnerProfDelete.ItemSelected += new EventHandler <AdapterView.ItemSelectedEventArgs>(spinnerProfDelete_ItemSelected); var profSpinnerEdit = FindViewById <Spinner>(Resource.Id.professorIdEdit); profSpinnerEdit.ItemSelected += new EventHandler <AdapterView.ItemSelectedEventArgs>(spinnerProfEdit_ItemSelected); var adapter = new ArrayAdapter <string>(this, Android.Resource.Layout.SimpleSpinnerItem, thisProfString); spinnerProfDelete.Adapter = adapter; profSpinnerEdit.Adapter = adapter; var deleteformprof = FindViewById <LinearLayout>(Resource.Id.ProfessorDeleteForm); var editFormProf = FindViewById <LinearLayout>(Resource.Id.ProfessorEditForm); deleteformprof.Visibility = ViewStates.Invisible; editFormProf.Visibility = ViewStates.Invisible; }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.DisplayClass); var myIntent = Intent; tempStringClass = myIntent.GetStringExtra("classProfObject"); tempRepository.LoadClasses(); tempInstructorRepository.LoadInstructors(); AllClasses = tempRepository.GetAllClasses(); AllInstructors = tempInstructorRepository.GetAllProfessors(); FillForm(); // Create your application here }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.TermMain); _termRecyclerView = FindViewById <RecyclerView>(Resource.Id.TermRecyclerView); var deleteView = FindViewById <LinearLayout>(Resource.Id.MainTermDelete); var editView = FindViewById <LinearLayout>(Resource.Id.MainTermEdit); deleteView.Visibility = ViewStates.Invisible; editView.Visibility = ViewStates.Invisible; theseTerms = thisRepository.LoadTerms(); //theseTerms = thisRepository.GetAllTerms(); ProfRepository.LoadInstructors(); theseProfessors = ProfRepository.GetAllProfessors(); classRepository.LoadClasses(); theseClasses = classRepository.GetAllClasses(); _termLayoutManager = new LinearLayoutManager(this); _termRecyclerView.SetLayoutManager(_termLayoutManager); _termAdapter = new TermAdapter(); _termAdapter.ItemClick += OnItemClick; _termRecyclerView.SetAdapter(_termAdapter); setClassList(); setTermList(); var adapter = new ArrayAdapter <string>(this, Android.Resource.Layout.SimpleSpinnerItem, ClassList); var termAdapter = new ArrayAdapter <string>(this, Android.Resource.Layout.SimpleSpinnerItem, TermsList); var spinnerEditTermName = FindViewById <Spinner>(Resource.Id.EditTermNameSpin); var spinnerDeleteTerm = FindViewById <Spinner>(Resource.Id.DeleteTermSpinner); var spinnerClass1 = FindViewById <Spinner>(Resource.Id.AddTermClass1Spin); var spinnerClass2 = FindViewById <Spinner>(Resource.Id.AddTermClass2Spin); var spinnerClass3 = FindViewById <Spinner>(Resource.Id.AddTermClass3Spin); var spinnerClass4 = FindViewById <Spinner>(Resource.Id.AddTermClass4Spin); var spinnerClass5 = FindViewById <Spinner>(Resource.Id.AddTermClass5Spin); var spinnerClass6 = FindViewById <Spinner>(Resource.Id.AddTermClass6Spin); var editspinnerClass1 = FindViewById <Spinner>(Resource.Id.editTermClass1Spin); var editspinnerClass2 = FindViewById <Spinner>(Resource.Id.editTermClass2Spin); var editspinnerClass3 = FindViewById <Spinner>(Resource.Id.editTermClass3Spin); var editspinnerClass4 = FindViewById <Spinner>(Resource.Id.editTermClass4Spin); var editspinnerClass5 = FindViewById <Spinner>(Resource.Id.editTermClass5Spin); var editspinnerClass6 = FindViewById <Spinner>(Resource.Id.editTermClass6Spin); spinnerEditTermName.ItemSelected += new EventHandler <AdapterView.ItemSelectedEventArgs>(spinnerEditTermName_ItemSelected); spinnerDeleteTerm.ItemSelected += new EventHandler <AdapterView.ItemSelectedEventArgs>(spinnerDeleteTerm_ItemSelected); spinnerClass1.ItemSelected += new EventHandler <AdapterView.ItemSelectedEventArgs>(spinnerClass1_ItemSelected); spinnerClass2.ItemSelected += new EventHandler <AdapterView.ItemSelectedEventArgs>(spinnerClass2_ItemSelected); spinnerClass3.ItemSelected += new EventHandler <AdapterView.ItemSelectedEventArgs>(spinnerClass3_ItemSelected); spinnerClass4.ItemSelected += new EventHandler <AdapterView.ItemSelectedEventArgs>(spinnerClass4_ItemSelected); spinnerClass5.ItemSelected += new EventHandler <AdapterView.ItemSelectedEventArgs>(spinnerClass5_ItemSelected); spinnerClass6.ItemSelected += new EventHandler <AdapterView.ItemSelectedEventArgs>(spinnerClass6_ItemSelected); editspinnerClass1.ItemSelected += new EventHandler <AdapterView.ItemSelectedEventArgs>(editspinnerClass1_ItemSelected); editspinnerClass2.ItemSelected += new EventHandler <AdapterView.ItemSelectedEventArgs>(editspinnerClass2_ItemSelected); editspinnerClass3.ItemSelected += new EventHandler <AdapterView.ItemSelectedEventArgs>(editspinnerClass3_ItemSelected); editspinnerClass4.ItemSelected += new EventHandler <AdapterView.ItemSelectedEventArgs>(editspinnerClass4_ItemSelected); editspinnerClass5.ItemSelected += new EventHandler <AdapterView.ItemSelectedEventArgs>(editspinnerClass5_ItemSelected); editspinnerClass6.ItemSelected += new EventHandler <AdapterView.ItemSelectedEventArgs>(editspinnerClass6_ItemSelected); spinnerEditTermName.Adapter = termAdapter; spinnerDeleteTerm.Adapter = termAdapter; spinnerClass1.Adapter = adapter; spinnerClass2.Adapter = adapter; spinnerClass3.Adapter = adapter; spinnerClass4.Adapter = adapter; spinnerClass5.Adapter = adapter; spinnerClass6.Adapter = adapter; editspinnerClass1.Adapter = adapter; editspinnerClass2.Adapter = adapter; editspinnerClass3.Adapter = adapter; editspinnerClass4.Adapter = adapter; editspinnerClass5.Adapter = adapter; editspinnerClass6.Adapter = adapter; LinkEventHandlers(); FindView(); // Create your application here }