private void btnBeranda_Click(object sender, EventArgs e) { Beranda formBeranda = new Beranda(); formBeranda.Show(); this.Hide(); }
private void btnUnggahResep_Click(object sender, EventArgs e) { Resep resep = new Resep(); //data push idResep = "R0001"; idAkun = Akun.idAkun; judul = tbJudulResep.Text; file = byteImage(); DateTime thisDay = DateTime.Today; date = thisDay.ToString("yyyy-MM-dd"); fav = 0; kategori = cbKategori.SelectedItem.ToString(); alatBahan = tbBahan.Text; stepMasak = tbStepMasak.Text; //panggil method unggah if (String.IsNullOrEmpty(tbJudulResep.Text) && String.IsNullOrEmpty(tbBahan.Text) && String.IsNullOrEmpty(tbStepMasak.Text) && String.IsNullOrEmpty(tbFileGambar.Text)) { MessageBox.Show("Kolom Tidak Boleh Kosong", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { akun.unggah(idResep, idAkun, judul, file, date, fav, kategori, alatBahan, stepMasak); //resep.unggahResep(idResep, idAkun, judul, file, date, fav, kategori, alatBahan, stepMasak); this.Hide(); formBeranda.Show(); } }
public void cekAuthority() { if (!String.IsNullOrEmpty(txtEmail.Text) && !String.IsNullOrEmpty(txtKataSandi.Text)) { Akun akun = new Akun(); if (akun.login(txtEmail.Text, txtKataSandi.Text) == "sukses") { formBeranda.Show(); this.Hide(); } else { MessageBox.Show("Email pengguna atau kata sandi salah!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } } else { MessageBox.Show("Isi email pengguna dan kata sandi!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning); } }