private void button4_Click(object sender, EventArgs e)
        {
            PasienController pc = new PasienController();
            IEnumerable<Patient> hasil = pc.showData();

            dataGridView1.DataSource = hasil.ToList();
        }
        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 button1_Click(object sender, EventArgs e)
        {
            PasienController      pc    = new PasienController();
            IEnumerable <Patient> hasil = pc.showData();

            dataGridView1.DataSource = hasil.ToList();
        }
Exemple #4
0
 private void button4_Click(object sender, EventArgs e)
 {
     try
     {
         Patient p = new Patient()
         {
             Id_Pasien      = System.Convert.ToInt32(textBox2.Text),
             ID_Pegawai     = System.Convert.ToInt32(textBox10.Text),
             Nama_Pasien    = textBox9.Text,
             Penyakit       = textBox9.Text,
             Jenis_pasien   = comboBox3.Text,
             Golongan_Darah = comboBox2.Text,
             Jenis_Kelamin  = comboBox1.Text,
             Tgl_Lahir      = dateTimePicker2.Value,
             Alamat_Pasien  = textBox4.Text,
             Kota_Pasien    = textBox5.Text,
             No_KTP         = System.Convert.ToInt32(textBox8.Text),
             No_Hp          = System.Convert.ToInt32(textBox7.Text),
             Pekerjaan      = textBox6.Text,
             Tgl_Masuk      = dateTimePicker3.Value,
             Tgl_Keluar     = dateTimePicker4.Value,
             ID_Room        = System.Convert.ToInt32(textBox1.Text),
             Tarif_total    = System.Convert.ToInt32(textBox11.Text)
         };
         PasienController pc = new PasienController();
         pc.updatePasien(p);
     }
     catch (FormatException fe)
     {
         MessageBox.Show("semua data harus terisi");
     }
 }
Exemple #5
0
        private void button2_Click(object sender, EventArgs e)
        {
            using (HospitalEntities context = new HospitalEntities())
            {
                int result = (int)(context.GetNewPatientId().FirstOrDefault());
                if (result > -1)
                {
                    try
                    {
                        Patient p = new Patient()
                        {
                            Id_Pasien      = result,
                            Nama_Pasien    = textBox3.Text,
                            Penyakit       = textBox9.Text,
                            Jenis_pasien   = comboBox3.Text,
                            Golongan_Darah = comboBox2.Text,
                            Jenis_Kelamin  = comboBox1.Text,
                            Tgl_Lahir      = dateTimePicker2.Value,
                            Alamat_Pasien  = textBox4.Text,
                            Kota_Pasien    = textBox5.Text,
                            No_KTP         = System.Convert.ToInt32(textBox8.Text),
                            No_Hp          = System.Convert.ToInt32(textBox7.Text),
                            Pekerjaan      = textBox6.Text,
                            Tgl_Masuk      = dateTimePicker3.Value,
                            ID_Room        = System.Convert.ToInt32(textBox1.Text)
                        };


                        PasienController pc = new PasienController();
                        pc.AddPasien(p);

                        //int stat = System.Convert.ToInt32(textBox1.Text);
                        //if (System.Convert.ToInt32(textBox1.Text) != null)
                        //{

                        /*    Kamar k = new Kamar()
                         *  {
                         *      Id_Room = System.Convert.ToInt32(textBox1.Text),
                         *      Status_Kamar = 1
                         *  };
                         * */
                        RoomController rc = new RoomController();
                        rc.updateStatus(p);
                        //}

                        MessageBox.Show(textBox1.Text);
                    }
                    catch (FormatException fe)
                    {
                        MessageBox.Show("Data harus terisi semua");
                    }
                }
            }
        }
        private void button2_Click(object sender, EventArgs e)
        {
            using (HospitalEntities context = new HospitalEntities())
            {
                int result = (int)(context.GetNewPatientId().FirstOrDefault());
                if (result > -1)
                {
                    try
                    {
                        Patient p = new Patient()
                        {
                            Id_Pasien = result,
                            Nama_Pasien = textBox3.Text,
                            Penyakit = textBox9.Text,
                            Jenis_pasien = comboBox3.Text,
                            Golongan_Darah = comboBox2.Text,
                            Jenis_Kelamin = comboBox1.Text,
                            Tgl_Lahir = dateTimePicker2.Value,
                            Alamat_Pasien = textBox4.Text,
                            Kota_Pasien = textBox5.Text,
                            No_KTP = System.Convert.ToInt32(textBox8.Text),
                            No_Hp = System.Convert.ToInt32(textBox7.Text),
                            Pekerjaan = textBox6.Text,
                            Tgl_Masuk = dateTimePicker3.Value,
                            ID_Room = System.Convert.ToInt32(textBox1.Text)
                        };


                        PasienController pc = new PasienController();
                        pc.AddPasien(p);

                        //int stat = System.Convert.ToInt32(textBox1.Text);
                        //if (System.Convert.ToInt32(textBox1.Text) != null)
                        //{
                        /*    Kamar k = new Kamar()
                            {
                                Id_Room = System.Convert.ToInt32(textBox1.Text),
                                Status_Kamar = 1
                            };
                         * */
                        RoomController rc = new RoomController();
                        rc.updateStatus(p);
                        //}

                        MessageBox.Show(textBox1.Text);
                    }
                    catch (FormatException fe)
                    {
                        MessageBox.Show("Data harus terisi semua");
                    }
                }
                
            }
        }
Exemple #7
0
 private void button5_Click(object sender, EventArgs e)
 {
     try
     {
         PasienController pc = new PasienController();
         pc.deletePasien(System.Convert.ToInt32(textBox2.Text));
     }
     catch (FormatException fe)
     {
         MessageBox.Show("Pilih Data Yang akan Dihapus");
     }
 }
        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");
            }
        }
        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 button4_Click(object sender, EventArgs e)
 {
     try
     {
         Patient p = new Patient()
         {
             Id_Pasien = System.Convert.ToInt32(textBox2.Text),
             ID_Pegawai = System.Convert.ToInt32(textBox10.Text),
             Nama_Pasien = textBox9.Text,
             Penyakit = textBox9.Text,
             Jenis_pasien = comboBox3.Text,
             Golongan_Darah = comboBox2.Text,
             Jenis_Kelamin = comboBox1.Text,
             Tgl_Lahir = dateTimePicker2.Value,
             Alamat_Pasien = textBox4.Text,
             Kota_Pasien = textBox5.Text,
             No_KTP = System.Convert.ToInt32(textBox8.Text),
             No_Hp = System.Convert.ToInt32(textBox7.Text),
             Pekerjaan = textBox6.Text,
             Tgl_Masuk = dateTimePicker3.Value,
             Tgl_Keluar = dateTimePicker4.Value,
             ID_Room = System.Convert.ToInt32(textBox1.Text),
             Tarif_total = System.Convert.ToInt32(textBox11.Text)
         };
         PasienController pc = new PasienController();
         pc.updatePasien(p);
     }
     catch (FormatException fe)
     {
         MessageBox.Show("semua data harus terisi");
     }
 }
 private void button5_Click(object sender, EventArgs e)
 {
     try
     {
         PasienController pc = new PasienController();
         pc.deletePasien(System.Convert.ToInt32(textBox2.Text));
     }
     catch (FormatException fe)
     {
         MessageBox.Show("Pilih Data Yang akan Dihapus");
     }
 }