public FormProfile(string username) //Overload untuk edit { CurrentUser temp = new CurrentUser(); temp = koneksi.returnUser(username); InitializeComponent(); txtUsername.Text = temp.user; txtPassword.Text = temp.pass; txtName.Text = temp.nama; mtbTelephone.Text = temp.telp; cBoxGender.Text = temp.gender; rtbAddress.Text = temp.alamat; cBoxAccountType.Text = temp.tipe; txtFine.Text = temp.fine; lblPhotoPath.Text = temp.path; if (!String.IsNullOrEmpty(temp.path)) { kontrol.setFotoProfil(pictureBox2, temp.path); } if (Program.userSekarang.tipe == "Admin") { lblAccountType.Visible = true; cBoxAccountType.Visible = true; } txtUsername.Focus(); }
private void validasiAkun(CurrentUser akun) { lblAccountName.Text = akun.nama; lblWelcome.Text = "Welcome " + akun.nama + " (" + akun.tipe + ")"; if (akun.tipe != "Guest") { btnLend.Enabled = true; btnLend.BackgroundImage = Properties.Resources.lend; btnProfile.Enabled = true; btnProfile.BackgroundImage = Properties.Resources.profile; } if (akun.tipe == "Admin") { btnManage.Visible = true; } if (!String.IsNullOrEmpty(akun.path)) { kontrol.setFotoProfil(pBoxProfile, akun.path); } notification(); }