private void Initialize() { LightUsers = new LightUsers(); DepartmentsDataGrid.DataSource = LightUsers.DepartmentsDataTable; DepartmentsDataGrid.Columns["DepartmentID"].Visible = false; DepartmentsDataGrid.Columns["Photo"].Visible = false; DepartmentsDataGrid.Columns["Count"].Visible = false; DepartmentsDataGrid.Columns["Name"].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill; DepartmentsDataGrid.Columns["Name"].MinimumWidth = 150; UsersList.UsersDataTable = LightUsers.UsersDataTable; }
private void SetInfo() { PhotoBox.Image = UserProfile.GetUserPhoto(CurrentUserID); NameLabel.Text = CurrentName; string ProfilPosition = GetPosition(PersonalInform.ProfilPositionsDT, 1); string TPSPosition = GetPosition(PersonalInform.TPSPositionsDT, 2); if (ProfilPosition.Length > 0 && TPSPosition.Length > 0) { PositionLabel.Text = ProfilPosition + "\n" + TPSPosition; } else { if (ProfilPosition.Length > 0) { PositionLabel.Text = ProfilPosition; } if (TPSPosition.Length > 0) { PositionLabel.Text = TPSPosition; } } DepartmentLabel.Text = OneLineToTwo(UserProfile.GetDepartmentName(PersonalInform.DepartmentID)); if (PersonalInform.Education.Length == 0) { EducationLabel.Text = "не указано"; } else { EducationLabel.Text = PersonalInform.Education; } if (PersonalInform.EducationPlace.Length == 0) { EduPlaceLabel.Text = "не указано"; } else { EduPlaceLabel.Text = OneLineToTwo(PersonalInform.EducationPlace); } if (PersonalInform.BirthDate.Length == 0) { BirthDateLabel.Text = "не указана"; } else { BirthDateLabel.Text = PersonalInform.BirthDate; } AgeLabel.Text = GetAge(PersonalInform.BirthDate).ToString(); if (PersonalInform.Language.Length == 0) { LanguagesLabel.Text = "нет\\не указано"; } else { LanguagesLabel.Text = GetLanguages(PersonalInform.Language); } DriveLabel.Text = GetDrive(PersonalInform); MilitaryLabel.Text = GetCombat(PersonalInform.CombatArm, PersonalInform.MilitaryRank); MobilePersonalLabel.Text = LightUsers.GetPhoneFormat(Contacts.PersonalMobilePhone); MobileWorkLabel.Text = LightUsers.GetPhoneFormat(Contacts.WorkMobilePhone); CityWorkPhoneLabel.Text = LightUsers.GetPhoneFormat(Contacts.WorkStatPhone); if (Contacts.WorkExtPhone.Length == 0) { WorkExtPhoneLabel.Text = "не указан"; } else { WorkExtPhoneLabel.Text = Contacts.WorkExtPhone; } if (Contacts.Skype.Length == 0) { SkypeLabel.Text = "не указан"; } else { SkypeLabel.Text = Contacts.Skype; } if (Contacts.Email.Length == 0) { MailLabel.Text = "не указан"; } else { MailLabel.Text = Contacts.Email; } if (Contacts.ICQ.Length == 0) { ICQLabel.Text = "не указан"; } else { ICQLabel.Text = Contacts.ICQ; } }