コード例 #1
0
        public void InsertIbu(string nama, string pkj, DateTime tl, string alamat)
        {
            using (DbBhmEntities dc = new DbBhmEntities())
            {
                Ibu ibu = new Ibu();

                ibu.namaIbu = nama;
                ibu.pkjIbu = pkj;
                ibu.tlIbu = tl;
                ibu.alamatIbu = alamat;

                dc.Ibus.AddObject(ibu);
                dc.SaveChanges();
            }
        }
コード例 #2
0
        public void InsertAyah(string nama, string pkj, DateTime tl, string alamat)
        {
            using (DbBhmEntities dc = new DbBhmEntities())
            {
                Ayah ayah = new Ayah();

                ayah.namaAyah = nama;
                ayah.pkjAyah = pkj;
                ayah.tlAyah = tl;
                ayah.alamatAyah = alamat;

                dc.Ayahs.AddObject(ayah);
                dc.SaveChanges();
            }
        }
        public void InsertKegiatan(int idBalita, int idPosyandu, DateTime tgl, double bb, double tb)
        {
            using (DbBhmEntities dc = new DbBhmEntities())
            {
                Kegiatan kegiatan = new Kegiatan();

                kegiatan.idBalita = idBalita;
                kegiatan.idPosyandu = idPosyandu;
                kegiatan.tglPeriksa = tgl;
                kegiatan.bb = bb;
                kegiatan.tb = tb;

                dc.Kegiatans.AddObject(kegiatan);
                dc.SaveChanges();
            }
        }
        public void InsertVitamin(DateTime kapsulBiru, DateTime kapsulMerah1, DateTime kapsulMerah2, DateTime kapsulMerah3,
            DateTime kapsulMerah4)
        {
            using (DbBhmEntities dc = new DbBhmEntities())
            {
                Vitamin vitamin = new Vitamin();

                vitamin.kapsulBiru = DateTime.Now;
                vitamin.kapsulMerah1 = DateTime.Now;
                vitamin.kapsulMerah2 = DateTime.Now;
                vitamin.kapsulMerah3 = DateTime.Now;
                vitamin.kapsulMerah4 = DateTime.Now;

                dc.Vitamins.AddObject(vitamin);
                dc.SaveChanges();
            }
        }
        public void InsertImunisasi(DateTime hbo, DateTime bcg_Polio1, DateTime dptHb1_Polio2, DateTime dptHb2_Polio2,
            DateTime dptHb3_Polio4, DateTime campak)
        {
            using (DbBhmEntities dc = new DbBhmEntities())
            {
                Imunisasi imun = new Imunisasi();

                imun.hbo = hbo;
                imun.bcg_Polio1 = bcg_Polio1;
                imun.dptHb1_Polio2 = dptHb1_Polio2;
                imun.dptHb2_Polio2 = dptHb2_Polio2;
                imun.dptHb3_Polio4 = dptHb3_Polio4;
                imun.campak = campak;

                dc.Imunisasis.AddObject(imun);
                dc.SaveChanges();
            }
        }
        public void UpdateImunisasi(int id, DateTime hbo, DateTime bcg_Polio1, DateTime dptHb1_Polio2, DateTime dptHb2_Polio2,
            DateTime dptHb3_Polio4, DateTime campak)
        {
            try
            {
                using (DbBhmEntities db = new DbBhmEntities())
                {
                    Imunisasi imun = db.Imunisasis.Single(p => p.idImunisasi == id);

                    imun.hbo = hbo;
                    imun.bcg_Polio1 = bcg_Polio1;
                    imun.dptHb1_Polio2 = dptHb1_Polio2;
                    imun.dptHb2_Polio2 = dptHb2_Polio2;
                    imun.dptHb3_Polio4 = dptHb3_Polio4;
                    imun.campak = campak;

                    db.SaveChanges();
                }
            }
            catch
            {
                // Ignore exceptions
            }
        }
        public void UpdatePosyandu(int id, string nama, string desa, string kec, string kab, string prov)
        {
            try
            {
                using (DbBhmEntities db = new DbBhmEntities())
                {
                    Posyandu posyandu = db.Posyandus.Single(p => p.idPosyandu == id);

                    posyandu.namaPosyandu = nama;
                    posyandu.desaPosyandu = desa;
                    posyandu.kecPosyandu = kec;
                    posyandu.kabPosyandu = kab;
                    posyandu.provPosyandu = prov;

                    db.SaveChanges();
                }
            }
            catch
            {
                // Ignore exceptions
            }
        }
        public void InsertPosyandu(string nama, string desa, string kec, string kab, string prov)
        {
            try
            {
                using (DbBhmEntities db = new DbBhmEntities())
                {
                    Posyandu posyandu = new Posyandu();

                    posyandu.namaPosyandu = nama;
                    posyandu.desaPosyandu = desa;
                    posyandu.kecPosyandu = kec;
                    posyandu.kabPosyandu = kab;
                    posyandu.provPosyandu = prov;

                    db.Posyandus.AddObject(posyandu);
                    db.SaveChanges();
                }
            }
            catch
            {
                // Ignore exceptions
            }
        }
コード例 #9
0
        public void UpdateBalita(int id, int idAyah, int idIbu, int idVit, int idImun, string nama, DateTime tl, string alamat, int anak,
            string jk, double bbl, double tbl)
        {
            using (DbBhmEntities db = new DbBhmEntities())
            {
                Balita balita = db.Balitas.Single(p => p.idBalita == id);

                balita.idAyah = idAyah;
                balita.idIbu = idIbu;
                balita.idVitamin = idVit;
                balita.idImunisasi = idImun;
                balita.namaBalita = nama;
                balita.tlBalita = tl;
                balita.alamatBalita = alamat;
                balita.anakKe = anak;
                balita.jnsKelamin = jk;
                balita.bbl = bbl;
                balita.tbl = tbl;

                db.SaveChanges();
            }
        }
コード例 #10
0
        public void InsertBalita(int idAyah, int idIbu, string nama, DateTime tl, string alamat, int anak,
            string jk, double bbl, double tbl)
        {
            using (DbBhmEntities dc = new DbBhmEntities())
            {
                Balita balita = new Balita();

                balita.idAyah = idAyah;
                balita.idIbu = idIbu;
                balita.idVitamin = null;
                balita.idImunisasi = null;
                balita.namaBalita = nama;
                balita.tlBalita = tl;
                balita.alamatBalita = alamat;
                balita.anakKe = anak;
                balita.jnsKelamin = jk;
                balita.bbl = bbl;
                balita.tbl = tbl;

                dc.Balitas.AddObject(balita);
                dc.SaveChanges();
            }
        }
コード例 #11
0
        public void InsertPegawai(string nama, string instansi, string username, string password, bool isAdmin)
        {
            try
            {
                using (DbBhmEntities db = new DbBhmEntities())
                {
                    Pegawai pegawai = new Pegawai();

                    pegawai.namaPgw = nama;
                    pegawai.instansi = instansi;
                    pegawai.usernamePgw = username;
                    pegawai.passwordPgw = password;
                    pegawai.isAdmin = isAdmin;

                    db.Pegawais.AddObject(pegawai);
                    db.SaveChanges();
                }
            }
            catch
            {
                // Ignore exceptions
            }
        }