Пример #1
0
        private void SimpanTSB_Click(object sender, EventArgs e)
        {
            mcolor K = new mcolor();

            K.ColorID     = txtColorID.Text;
            K.Description = txtDescription.Text;
            K.Active      = Convert.ToInt32(txtActive.Text);
            //K.Type = null;
            if (new mcolorCRUD().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)
        {
            mcolor k = new mcolor();

            k.ColorID     = txtColorID.Text;
            k.Description = txtDescription.Text;
            k.Active      = Convert.ToInt32(txtActive.Text);
            string costID = k.ColorID;

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