private void FormTambahPegawai_Load(object sender, EventArgs e) { string hasilBaca = Jabatan.BacaData(listJabatan); if (hasilBaca == "1") { foreach (var item in listJabatan) { comboBoxJabatanPegawai.Items.Add(item.IdJabatan + " - " + item.Nama); } } comboBoxJenisKelaminPegawai.Items.Add("Laki-laki"); comboBoxJenisKelaminPegawai.Items.Add("Perempuan"); }
private void FormUbahPegawai_Load(object sender, EventArgs e) { labelNama.Text = FormMaster.listSelectedPegawai[0].Nama; textBoxNoTelpPegawai.Text = FormMaster.listSelectedPegawai[0].NoTelp; labelUsername.Text = FormMaster.listSelectedPegawai[0].Username; textBoxAlamatPegawai.Text = FormMaster.listSelectedPegawai[0].Alamat; labelTanggalLahir.Text = FormMaster.listSelectedPegawai[0].TanggalLahir.ToString("dd MMMM yyyy"); if (FormMaster.listSelectedPegawai[0].Foto != "") { string projectPath = Directory.GetParent(Directory.GetCurrentDirectory()).Parent.FullName + "\\images\\users"; string folderName = Path.Combine(projectPath, FormMaster.listSelectedPegawai[0].Username); pictureBoxUbahFotoUser.ImageLocation = folderName + "\\" + "foto" + FormMaster.listSelectedPegawai[0].Foto.ToString(); } else { pictureBoxUbahFotoUser.Image = Resources.profile_picture; } labelJenisKelamin.Text = FormMaster.listSelectedPegawai[0].JenisKelamin; comboBoxStatusPegawai.Items.Add("Aktif"); comboBoxStatusPegawai.Items.Add("Blokir"); comboBoxStatusPegawai.SelectedItem = FormMaster.listSelectedPegawai[0].Status; string hasilBacaJabatan = Jabatan.BacaData(listJabatan); if (hasilBacaJabatan == "1") { foreach (var item in listJabatan) { comboBoxJabatanPegawai.Items.Add(item.IdJabatan + " - " + item.Nama); } comboBoxJabatanPegawai.SelectedItem = FormMaster.listSelectedPegawai[0].Jabatan.IdJabatan + " - " + FormMaster.listSelectedPegawai[0].Jabatan.Nama; } textBoxNoTelpPegawai.SelectionStart = textBoxNoTelpPegawai.Text.Length; textBoxNoTelpPegawai.SelectionLength = 0; }