public void Insert(string nama_kat) { try { kategoriDAL.Insert(nama_kat); } catch (Exception ex) { throw new Exception(ex.Message); } }
protected void btnInsert_Click(object sender, EventArgs e) { try { kategoriDAL.Insert(txtNama.Text); lblKet.Text = $"Data Kategori {txtNama.Text} berhasil ditambah"; } catch (Exception ex) { lblKet.Text = $"Error: {ex.Message}"; } }
public async Task Insert(Kategori obj) { KategoriDAL kategoriDAL = new KategoriDAL(); try { await kategoriDAL.Insert(obj); } catch (Exception ex) { throw new Exception(ex.Message); } }