コード例 #1
0
        private void SimpanTSB_Click(object sender, EventArgs e)
        {
            mitemstype K = new mitemstype();

            K.ItemsTypeID = txtTypeID.Text;
            K.Description = txtDescription.Text;
            K.Active      = Convert.ToInt32(txtActive.Text);
            K.CategoryID  = txtitemID.Text;
            if (new mitemstypeCRUD().insertData(K))
            {
                MessageBox.Show("Data berhasil di tambahkan");
                Binding();
            }
            else
            {
                MessageBox.Show("Data gagal ditambahkan");
            }
        }
コード例 #2
0
        private void UbahTSB_Click(object sender, EventArgs e)
        {
            mitemstype k = new mitemstype();

            k.ItemsTypeID = txtTypeID.Text;
            k.Description = txtDescription.Text;
            k.Active      = Convert.ToInt32(txtActive.Text);
            k.CategoryID  = txtitemID.Text;

            // string categoryID = k.ItemsTypeID;
            if (new mitemstypeCRUD().updateData(k.ItemsTypeID, k))
            {
                MessageBox.Show("Update Sukses");
                Binding();
            }
            else
            {
                MessageBox.Show("Update tidak berhasil");
            }
        }