Ejemplo n.º 1
0
        // GET: Class
        public ActionResult Index()
        {
            List <ClassModel> classesList = new List <ClassModel>();

            classesList = classRepository.GetAllClasses();
            return(View("Index", classesList));
        }
        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
        }
Ejemplo n.º 3
0
        // GET: Schedule/Create
        public ActionResult Create()
        {
            var        students    = studentRepository.GetAllStudents();
            SelectList studentList = new SelectList(students, "StudentId", "Name");

            ViewData["student1"] = studentList;

            var        teachers    = teacherRepository.GetAllTeachers();
            SelectList teacherList = new SelectList(teachers, "TeacherId", "Name");

            ViewData["teacher1"] = teacherList;

            var        classes   = classRepository.GetAllClasses();
            SelectList classList = new SelectList(classes, "ClassId", "Name");

            ViewData["class1"] = classList;

            return(View("Create"));
        }
Ejemplo n.º 4
0
        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
        }