Example #1
0
        private void SimpanTSB_Click(object sender, EventArgs e)
        {
            mcategory K = new mcategory();

            K.CategoryID  = txtCategoryID.Text;
            K.Description = txtDescription.Text;
            K.Active      = Convert.ToInt32(txtActive.Text);

            if (new mcategoryCRUD().insertData(K))
            {
                MessageBox.Show("Data berhasil di tambahkan");
                Binding();
            }
            else
            {
                MessageBox.Show("Data gagal ditambahkan");
            }
        }
Example #2
0
        private void UbahTSB_Click(object sender, EventArgs e)
        {
            mcategory k = new mcategory();

            k.CategoryID  = txtCategoryID.Text;
            k.Description = txtDescription.Text;
            k.Active      = Convert.ToInt32(txtActive.Text);
            string categoryID = k.CategoryID;

            if (new mcategoryCRUD().updateData(categoryID, k))
            {
                MessageBox.Show("Update Sukses");
                Binding();
            }
            else
            {
                MessageBox.Show("Update tidak berhasil");
            }
        }