private void frmTrainee_Load(object sender, EventArgs e)
        {
            LoadTrainees();

            BusinessLogic.GenderManager        genderManager = new BusinessLogic.GenderManager();
            List <BusinessEntity.GenderEntity> genders       = genderManager.GetAll();

            cboGender.DataSource    = genders;
            cboGender.ValueMember   = "ID";
            cboGender.DisplayMember = "Title";

            BusinessLogic.AcademicLevelManager        academicLevelManager = new BusinessLogic.AcademicLevelManager();
            List <BusinessEntity.AcademicLevelEntity> academicLevels       = academicLevelManager.GetAll();

            cboAcademicLevel.DataSource    = academicLevels;
            cboAcademicLevel.ValueMember   = "ID";
            cboAcademicLevel.DisplayMember = "Title";

            BusinessLogic.BranchManager        branchManager = new BusinessLogic.BranchManager();
            List <BusinessEntity.BranchEntity> branches      = branchManager.GetAll();

            cboBranch.DataSource    = branches;
            cboBranch.ValueMember   = "ID";
            cboBranch.DisplayMember = "Name";
        }
Пример #2
0
        private void frmSearchTrainee_Load(object sender, EventArgs e)
        {
            BusinessLogic.GenderManager        genderManager = new BusinessLogic.GenderManager();
            List <BusinessEntity.GenderEntity> genders       = genderManager.GetAll();

            cboGender.DataSource    = genders;
            cboGender.ValueMember   = "ID";
            cboGender.DisplayMember = "Title";

            cboSearchGender.DataSource    = genders;
            cboSearchGender.ValueMember   = "ID";
            cboSearchGender.DisplayMember = "Title";
        }
Пример #3
0
        private void PopulateCombobox()
        {
            //populate gender
            BusinessLogic.GenderManager        genderManager = new BusinessLogic.GenderManager();
            List <BusinessEntity.GenderEntity> genders       = genderManager.GetAll();

            genders.Add(new BusinessEntity.GenderEntity()
            {
                ID = 0, Title = "All"
            });

            cboGender.DataSource    = genders.OrderBy(x => x.ID).ToList();
            cboGender.ValueMember   = "ID";
            cboGender.DisplayMember = "Title";

            //populate academic level
            BusinessLogic.AcademicLevelManager        academicLevelManager = new BusinessLogic.AcademicLevelManager();
            List <BusinessEntity.AcademicLevelEntity> academicLevels       = academicLevelManager.GetAll();

            academicLevels.Add(new BusinessEntity.AcademicLevelEntity()
            {
                ID = 0, Title = "All"
            });

            cboAcademicLevel.DataSource    = academicLevels.OrderBy(x => x.ID).ToList();
            cboAcademicLevel.ValueMember   = "ID";
            cboAcademicLevel.DisplayMember = "Title";

            //populate trainee
            BusinessLogic.TraineeManager        traineeManager = new BusinessLogic.TraineeManager();
            List <BusinessEntity.TraineeEntity> trainees       = traineeManager.GetAll();

            trainees.Add(new BusinessEntity.TraineeEntity()
            {
                ID = 0, Fullname = "All"
            });

            cboTrainee.DataSource    = trainees.OrderBy(x => x.ID).ToList();
            cboTrainee.ValueMember   = "ID";
            cboTrainee.DisplayMember = "Fullname";

            cboTraineePayment.DataSource    = trainees.OrderBy(x => x.ID).ToList();
            cboTraineePayment.ValueMember   = "ID";
            cboTraineePayment.DisplayMember = "Fullname";

            //populate course
            BusinessLogic.CourseManager        courseManager = new BusinessLogic.CourseManager();
            List <BusinessEntity.CourseEntity> courses       = courseManager.GetAll();

            courses.Add(new BusinessEntity.CourseEntity()
            {
                ID = 0, Title = "All"
            });

            cboCourse.DataSource    = courses.OrderBy(x => x.ID).ToList();
            cboCourse.ValueMember   = "ID";
            cboCourse.DisplayMember = "Title";

            cboCoursePayment.DataSource    = courses.OrderBy(x => x.ID).ToList();
            cboCoursePayment.ValueMember   = "ID";
            cboCoursePayment.DisplayMember = "Title";
        }