private void button2_Click(object sender, EventArgs e) { try { Patient p = new Patient() { Id_Pasien = System.Convert.ToInt32(textBox1.Text) }; PeriksaController pc = new PeriksaController(); int hargaPeriksa = pc.TotalPeriksa(p); PasienController pac = new PasienController(); int hari = pac.HariKamar(p); RoomController rc = new RoomController(); int harga = rc.HargaKamar(p); int total = hargaPeriksa + (harga * hari); textBox2.Text = total.ToString(); Patient a = new Patient() { Id_Pasien = System.Convert.ToInt32(textBox1.Text), Tarif_total = System.Convert.ToInt32(textBox2.Text) }; //PasienController pc = new PasienController(); pac.updateTarifPasien(a); } catch (FormatException) { MessageBox.Show("Id Harus Terisi"); } }
private void button2_Click(object sender, EventArgs e) { using (HospitalEntities context = new HospitalEntities()) { int result = (int)(context.GetNewPeriksaId().FirstOrDefault()); if (result > -1) { try { Periksa p = new Periksa() { No_Pemeriksaan = result, id_Pegawai = System.Convert.ToInt32(textBox3.Text), id_Pasien = System.Convert.ToInt32(textBox2.Text), Penyakit_Akhir = textBox4.Text, Tarif = System.Convert.ToInt32(textBox6.Text), Status_Rawat = comboBox1.Text }; PeriksaController rc = new PeriksaController(); rc.addPemeriksaan(p); } catch (FormatException fe) { MessageBox.Show("Data Harus teriisi semua"); } } } }
private void button3_Click(object sender, EventArgs e) { PeriksaController pc = new PeriksaController(); IEnumerable <Periksa> hasil = pc.showPemeriksaan(); dataGridView2.DataSource = hasil.ToList(); }
private void button1_Click(object sender, EventArgs e) { try { Periksa p = new Periksa() { No_Pemeriksaan = System.Convert.ToInt32(textBox1.Text), id_Pegawai = System.Convert.ToInt32(textBox3.Text), id_Pasien = System.Convert.ToInt32(textBox2.Text), Penyakit_Akhir = textBox4.Text, Tarif = System.Convert.ToInt32(textBox6.Text), Status_Rawat = comboBox1.Text }; PeriksaController rc = new PeriksaController(); rc.Update(p); } catch (FormatException fe) { MessageBox.Show("Data harus teriisi semua"); } }
public void TarifPasien() { //arrange int expectedHarga = 470012; Patient p = new Patient() { Id_Pasien = 2 }; PeriksaController pc = new PeriksaController(); int hargaPeriksa = pc.TotalPeriksa(p); PasienController pac = new PasienController(); int hari = pac.HariKamar(p); RoomController rc = new RoomController(); int harga = rc.HargaKamar(p); //act int total = hargaPeriksa + (harga * hari); //assert Assert.AreEqual(expectedHarga, total, "Should be: 470012"); }
private void button3_Click(object sender, EventArgs e) { PeriksaController pc = new PeriksaController(); IEnumerable<Periksa> hasil = pc.showPemeriksaan(); dataGridView2.DataSource = hasil.ToList(); }