private void setTextbox() { if (!String.IsNullOrEmpty(tbIdDokter.Text)) { dok = db.tbl_Dokters.FirstOrDefault(x => x.id_dokter == int.Parse(tbIdDokter.Text)); if (dok != null) { tbIdDokter.Text = dok.id_dokter.ToString(); tbNama.Text = dok.nama; cmbJeniskelamin.Text = dok.jenis_kelamin; dtpTanggallahir.Value = dok.tanggal_lahir; rtbAlamat.Text = dok.alamat; tbKota.Text = dok.kota; tbKodepos.Text = dok.kodepos.ToString(); tbTelepon.Text = dok.telepon; tbEmail.Text = dok.email; btnTambah.Text = "UBAH"; } else { va.clear("tbIdDokter"); btnTambah.Text = "TAMBAH"; } } }
private void setTextBox() { if (!String.IsNullOrEmpty(tbIdobat.Text)) { ob = db.tbl_Obats.FirstOrDefault(x => x.id_obat == int.Parse(tbIdobat.Text)); if (ob != null) { tbIdobat.Text = ob.id_obat.ToString(); tbNama.Text = ob.nama_obat; tbHarga.Text = ob.harga.ToString(); nudStok.Value = ob.stok; } else { va.clear("tbIdobat"); } } }
private void setTextbox() { if (!String.IsNullOrEmpty(tbIdjenis.Text)) { tip = db.tbl_tipes.FirstOrDefault(x => x.id_tipe == tbIdjenis.Text); if (tip != null) { tbIdjenis.Text = tip.id_tipe; tbNama.Text = tip.nama; btnTambah.Text = "UBAH"; } else { va.clear("tbIdjenis"); btnTambah.Text = "TAMBAH"; } } }
private void setTextBox() { if (!String.IsNullOrEmpty(tbIddiagnosa.Text)) { diag = db.tbl_Diagnosas.FirstOrDefault(x => x.id_diagnosa == tbIddiagnosa.Text); if (diag != null) { tbIddiagnosa.Text = diag.id_diagnosa; cmbIdantrian.Text = diag.id.ToString(); rtbHasil.Text = diag.hasil_diagnosa; rtbResep.Text = diag.resep; btnTambah.Text = "UBAH"; } else { va.clear("tbIddiagnosa"); btnTambah.Text = "TAMBAH"; } } }
private void setTextbox() { if (!String.IsNullOrEmpty(tbIdruangan.Text)) { ru = db.tbl_Ruangans.FirstOrDefault(x => x.id_ruangan == tbIdruangan.Text); if (ru != null) { tbIdruangan.Text = ru.id_ruangan; tbNamaruangan.Text = ru.nama_ruangan; cmbIdtipe.Text = ru.id_tipe; cmbIddokter.Text = ru.id_dokter.ToString(); cmbIdjadwal.Text = ru.id_jadwal; cmbStatus.Text = ru.status; btnTambah.Text = "UBAH"; } else { va.clear("tbIdruangan"); btnTambah.Text = "TAMBAH"; } } }
private void setTextBox() { if (!String.IsNullOrEmpty(tbIduser.Text)) { us = db.tbl_Users.FirstOrDefault(x => x.id_user == int.Parse(tbIduser.Text)); if (us != null) { tbIduser.Text = us.id_user.ToString(); tbNama.Text = us.nama; cmbJeniskelamin.Text = us.jenis_kelamin; dtpTgllahir.Value = us.tanggal_lahir; rtbAlamat.Text = us.alamat; tbKota.Text = us.kota; tbKodepos.Text = us.kodepos.ToString(); tbTelepon.Text = us.telepon; tbEmail.Text = us.email; } else { va.clear("tbIduser"); } } }
private void btnTambah_Click(object sender, EventArgs e) { double harga; va = new validasi(this.groupBox1.Controls, this.eValidasi); if (va.doValidation() == false) { return; } for (int i = 0; i < lvObat.Items.Count; i++) { if (lvObat.Items[i].SubItems[0].Text == cmbIdobat.Text) { lvObat.Items[i].Remove(); } } ListViewItem lv = new ListViewItem(cmbIdobat.Text); lv.SubItems.Add(tbNamaobat.Text); lv.SubItems.Add(tbHargaobat.Text); lv.SubItems.Add(nupStok.Value.ToString()); harga = Double.Parse(tbHargaobat.Text) * (int)nupStok.Value; lv.SubItems.Add(harga.ToString()); lvObat.Items.Add(lv); va.clear("cmbIdobat"); if (lvObat.Items.Count == 1) { tbTotal.Text = lvObat.Items[0].SubItems[4].Text; } else { for (int i = 1; i < lvObat.Items.Count; i++) { tbTotal.Text = (int.Parse(tbTotal.Text) + int.Parse(lvObat.Items[i].SubItems[4].Text)).ToString(); } } btnHapus.Enabled = true; }
private void button3_Click(object sender, EventArgs e) { loadGrid(); va.clear("tbIdjadwal"); }