Esempio n. 1
0
 private void ClearDetilBrg()
 {
     // kosongkan tampilan jika berhasil
     BrgIDText.Clear();
     BrgNameText.Clear();
     KeteranganText.Clear();
     LoadJenisBrgCombo();
     LoadColorCombo();
     LoadMerkCombo();
     LoadKemasanComboBox();
 }
Esempio n. 2
0
        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();
        }