예제 #1
0
        private void btnSimpan_Click(object sender, EventArgs e)
        {
            if (WithErrors())
            {
                val.validateTextBox(txtKode, errorProvider1, "Kode harus diisi.");
                val.validateTextBox(txtStatus, errorProvider1, "Status harus diisi.");

                return;
            }

            if (Convert.ToInt32(txtId.Text) == 0)
            {
                var status = new REF_STATUS();
                status.KODE_STATUS = txtKode.Text;
                status.STATUS = txtStatus.Text;
                context.REF_STATUS.InsertOnSubmit(status);
            }
            else
            {
                var query = from a in context.REF_STATUS
                            where a.ID_STATUS == Convert.ToInt32(txtId.Text)
                            select a;
                foreach (var a in query)
                {
                    a.KODE_STATUS = txtKode.Text;
                    a.STATUS = txtStatus.Text;
                }
            }
            context.SubmitChanges();
            Close();
        }
예제 #2
0
 partial void DeleteREF_STATUS(REF_STATUS instance);
예제 #3
0
 partial void UpdateREF_STATUS(REF_STATUS instance);
예제 #4
0
 partial void InsertREF_STATUS(REF_STATUS instance);