Exemple #1
0
 private void AccountDetails_Load(object sender, EventArgs e)
 {
     WorkplaceList.ClearSelection();
     UniversityList.ClearSelection();
     WorkplaceList.AutoResizeColumns();
     UniversityList.AutoResizeColumns();
     WorkplaceList.Width  = WorkplaceList.Columns.GetColumnsWidth(DataGridViewElementStates.None);
     UniversityList.Width = UniversityList.Columns.GetColumnsWidth(DataGridViewElementStates.None);
     //if(UniversityList.Columns.Count)
     WorkplaceList.Columns[0].MinimumWidth  = WorkplaceList.MinimumSize.Width;
     UniversityList.Columns[0].MinimumWidth = UniversityList.MinimumSize.Width;
     WorkplaceList.Height  = WorkplaceList.Rows.GetRowsHeight(DataGridViewElementStates.None);
     UniversityList.Height = UniversityList.Rows.GetRowsHeight(DataGridViewElementStates.None);
 }
        public async Task Init()
        {
            if (UniversityList.Count == 0)
            {
                var universityList = await _serviceUniversity.Get <List <University> >(null);

                foreach (var k in universityList)
                {
                    UniversityList.Add(k);
                }
            }

            if (SelectedUniversity != null)
            {
                var listApplicants = await _serviceApplicant.Get <List <Applicant> >(_search);

                ApplicantList.Clear();

                foreach (var m in listApplicants)
                {
                    if (m.UniversityId == SelectedUniversity.UniversityId)
                    {
                        ApplicantList.Add(m);
                    }
                }
            }
            else
            {
                var listApplicants = await _serviceApplicant.Get <List <Applicant> >(_search);

                ApplicantList.Clear();
                foreach (var x in listApplicants)
                {
                    ApplicantList.Add(x);
                }
            }
        }