Пример #1
0
 public IEnumerable<FacultyList> GetAllforList()
 {
     List<FacultyList> listFac = new List<FacultyList>();
     FacultyList tempAdd = new FacultyList();
     foreach (var s in ds.Faculty)
     {
         listFac.Add(Mapper.Map<FacultyList>(s));
     }
     return listFac;
 }
Пример #2
0
 protected void CLButton_Click(object sender, EventArgs e)
 {
     FirstnameTB.Text  = "";
     LastnameTB.Text   = "";
     MiddlenameTB.Text = "";
     BirthDateTB.Text  = "";
     SexRadioList.ClearSelection();
     FacultyList.ClearSelection();
     GroupTB.Text     = "";
     EnterDateTB.Text = "";
 }
        private async Task SetFacultyList()
        {
            FacultyDataService facultyDataService = new FacultyDataService(new EntityFramework.TimetableManagerDbContext());

            FacultyList = await facultyDataService.GetFacultiesAsync();

            FacultyList.ForEach(list =>
            {
                FacultyNameList.Add(list.FacultyName);
            });
        }
Пример #4
0
        public void BindFacultyDropdown()
        {
            string    command      = "Select UserID, FirstName + ' ' + LastName as FacultyName from Users where role = 'Faculty'";
            DataTable FacultyTable = new DataTable();


            FacultyTable = DataService.GetDataWithoutParameter(command);

            FacultyList.DataValueField = "UserID";
            FacultyList.DataTextField  = "FacultyName";
            FacultyList.DataSource     = FacultyTable;
            FacultyList.DataBind();
            FacultyList.Items.Insert(0, new ListItem("--- Select Faculty ---", "0"));
        }
Пример #5
0
 private void Connector_FacultiesDownloadEnded(List <KSFaculty> faculties)
 {
     foreach (var faculty in faculties)
     {
         try
         {
             FacultyList.Add(new FacultyViewModel()
             {
                 FacultyName = faculty.Name, ID = faculty.Id
             });
         }
         catch (Exception)
         {
         }
     }
 }
        private void FacutlyComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (FacutlyComboBox.SelectedItem == null)
            {
                return;
            }
            String faculty = FacutlyComboBox.SelectedItem.ToString();

            FacultyList.ForEach(e =>
            {
                if (e.FacultyName.Equals(faculty))
                {
                    DepartmentNameList.Clear();
                    e.Departments.ForEach(d =>
                    {
                        DepartmentNameList.Add(d.DepartmentName);
                    });
                }
            });
        }
Пример #7
0
        private void ShowFacultyForm()
        {
            if (!AppPermissions.Check("FacultyForm"))
            {
                MessageBox.Show("У вас нет разрешения на использование этой части приложения.");

                return;
            }

            if (_facultyFormOpened)
            {
                FacultyForm.Activate();
                FacultyForm.Focus();
                return;
            }

            FacultyForm        = new FacultyList(ApiEndpoint);
            _facultyFormOpened = true;
            FacultyForm.Show();
            _facultyFormOpened = false;
        }
 /// <summary>
 /// Load Faculty to ListView
 /// </summary>
 protected void LoadFacultyList()
 {
     FacultyList.DataSource = _fm.GetFaculty();
     FacultyList.DataBind();
 }
        static void MainUniversity(string[] args)
        {
            FacultyList faculty = new FacultyList();

            Student e1 = new Student();

            e1.Name   = "Pepito 1";
            e1.Gender = 0;
            e1.Age    = 50;
            faculty.AddStudent(e1);

            Student estudiante2 = new Student();

            estudiante2.Name = "Pepito 2";
            estudiante2.Age  = 50;
            faculty.AddStudent(estudiante2);

            Student e3 = new Student();

            e3.Name   = "Pepito 3";
            e3.Gender = 1;
            e3.Age    = 50;
            faculty.AddStudent(e3);

            Student est1 = new Student();

            est1.Name = "Pepito 4";
            est1.Age  = 50;
            faculty.AddStudent(est1);

            Course p1 = new Course();

            p1.Code = "p1";
            p1.Name = "Programación 1";
            p1.SetShift(0);
            faculty.AddCourse(p1);


            Course dataStructures1 = new Course();

            dataStructures1.Name = "Data structures 1";
            dataStructures1.Code = "ds1";
            dataStructures1.SetShift(1);
            faculty.AddCourse(dataStructures1);

            Allocation a1 = new Allocation();

            a1.Student = est1;
            a1.Course  = dataStructures1;
            a1.Grade   = 2.5f;
            faculty.AddAllocation(a1);

            Allocation a2 = new Allocation();

            a2.Student = e3;
            a2.Course  = p1;
            a2.Grade   = 4f;
            faculty.AddAllocation(a2);

            Allocation a3 = new Allocation();

            a3.Student = e3;
            a3.Course  = p1;
            a3.Grade   = 2f;
            faculty.AddAllocation(a3);

            Allocation a4 = new Allocation();

            a4.Student = est1;
            a4.Course  = p1;
            a4.Grade   = 2f;
            faculty.AddAllocation(a4);


            //Question: How many allocations there are at night?,
            int nightCountNewMethod = faculty.CountAllocationAtNight();

            System.Console.WriteLine("Amount of nightly allocations (new way): " + nightCountNewMethod);
        }
Пример #10
0
        private void FilterFacultiesList()
        {
            // Note: note that if notification list include General or Custom Notification
            // (not one of XX prefix) then it will not be included here, because its already
            // filtered in the switch cases in the constructor based on the modelType

            if (FacultyList.Count == 0)
            {
                IsPickerListEmpty = false;
                return;
            }
            else
            {
                IsPickerListEmpty = true;
            }

            if (NotificationList.Count == 0)
            {
                return;
            }

            IsNotificationListEmpty = false;

            List <int> facultiesIdFromSettings = new List <int>();

            if (_modelType == NotificationSettingsViewModelType.MutualHelpFaculty)
            {
                foreach (var fclt in NotificationList)
                {
                    facultiesIdFromSettings.Add(int.Parse(fclt.Topic.Substring(3)));
                }
            }
            else
            {
                foreach (var fclt in NotificationList)
                {
                    facultiesIdFromSettings.Add(int.Parse(fclt.Topic.Substring(2)));
                }
            }
            List <Faculty> templist = new List <Faculty>();
            Faculty        tempFaculty;

            foreach (var fclt in facultiesIdFromSettings)
            {
                tempFaculty = FacultyList.Find(c => c.Id == fclt);
                templist.Add(tempFaculty);
                FacultyList.Remove(tempFaculty);
            }

            NotificationFaculty = templist;

            if (FacultyList.Count == 0)
            {
                IsPickerListEmpty = false;
                return;
            }
            else
            {
                IsPickerListEmpty = true;
            }
        }