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

            K.CostID      = txtCostID.Text;
            K.Description = txtDescription.Text;
            K.Active      = Convert.ToInt32(txtActive.Text);
            //K.Type = null;
            if (new mcostCRUD().insertData(K))
            {
                MessageBox.Show("Data berhasil di tambahkan");
                Binding();
            }
            else
            {
                MessageBox.Show("Data gagal ditambahkan");
            }
        }
Beispiel #2
0
        private void UbahTSB_Click(object sender, EventArgs e)
        {
            mcost k = new mcost();

            k.CostID      = txtCostID.Text;
            k.Description = txtDescription.Text;
            k.Active      = Convert.ToInt32(txtActive.Text);
            string costID = k.CostID;

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