private void ClearDetilBrg() { // kosongkan tampilan jika berhasil BrgIDText.Clear(); BrgNameText.Clear(); KeteranganText.Clear(); LoadJenisBrgCombo(); LoadColorCombo(); LoadMerkCombo(); LoadKemasanComboBox(); }
private void SaveButton_Click(object sender, EventArgs e) { // cek inputan combobox var subJenisID = SubJenisBrgComboBox.SelectedValue ?? ""; var merkID = MerkComboBox.SelectedValue ?? ""; var colorID = ColorComboBox.SelectedValue ?? ""; var kemasan = KemasanComboBox.Text; var brg = new BrgModel { BrgID = BrgIDText.Text, BrgName = BrgNameText.Text, Keterangan = KeteranganText.Text, ColorID = colorID.ToString(), SubJenisBrgID = subJenisID.ToString(), MerkID = merkID.ToString(), Kemasan = kemasan, BrgNamePrint = String.Concat(BrgNameText.Text, 27), IsAktif = AktifCheckBox.Checked }; try { var result = _brgBL.Save(brg); } catch (Exception x) { MessageBox.Show(x.Message); return; } // kosongkan tampilan jika berhasil BrgIDText.Clear(); BrgNameText.Clear(); KeteranganText.Clear(); LoadJenisBrgCombo(); LoadColorCombo(); LoadMerkCombo(); LoadKemasanComboBox(); }