protected void Tambah_Clicked(object sender, EventArgs e)
        {
            AyahsServiceClient proxyAyah = new AyahsServiceClient();
            proxyAyah.InsertAyah(Ayah.Text, PkjAyah.Text, Convert.ToDateTime(TglLahirAyah.Text), AlamatAyah.Text);

            IbusServiceClient proxyIbu = new IbusServiceClient();
            proxyIbu.InsertIbu(Ibu.Text, PkjIbu.Text, Convert.ToDateTime(TglLahirIbu.Text), AlamatIbu.Text);

            BalitasServiceClient proxyBalita = new BalitasServiceClient();
            if (LakiRadioButton.Checked == true)
            {
                proxyBalita.InsertBalita(proxyAyah.GetIdByName(Ayah.Text), proxyIbu.GetIdByName(Ibu.Text), Balita.Text, Convert.ToDateTime(TglLahirBalita.Text), AlamatBalita.Text,
                    Convert.ToInt32(AnakKe.Text), "L", Convert.ToDouble(BBL.Text), Convert.ToDouble(TBL.Text));
            }
            else if (PerempuanRadioButton.Checked == true)
            {
                proxyBalita.InsertBalita(proxyAyah.GetIdByName(Ayah.Text), proxyIbu.GetIdByName(Ibu.Text), Balita.Text, Convert.ToDateTime(TglLahirBalita.Text), AlamatBalita.Text,
                    Convert.ToInt32(AnakKe.Text), "L", Convert.ToDouble(BBL.Text), Convert.ToDouble(TBL.Text));
            }

            proxyAyah.Close();
            proxyIbu.Close();
            proxyBalita.Close();

            successNotificatonPanel.Visible = true;
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            string namaBalita = (string)Request.QueryString["Balita"];
            string namaAyah = (string)Request.QueryString["Ayah"];
            string namaIbu = (string)Request.QueryString["Ibu"];

            Balita.Text = namaBalita;
            Ayah.Text = namaAyah;
            Ibu.Text = namaIbu;

            BalitasServiceClient proxyBalita = new BalitasServiceClient();
            BalitaData balita = proxyBalita.GetBalita(Balita.Text, Ayah.Text, Ibu.Text);
            proxyBalita.Close();

            AyahsServiceClient proxyAyah = new AyahsServiceClient();
            AyahData ayah = proxyAyah.GetAyahById(balita.idAyah);
            proxyAyah.Close();

            IbusServiceClient proxyIbu = new IbusServiceClient();
            IbuData ibu = proxyIbu.GetIbuById(balita.idIbu);
            proxyIbu.Close();

            TglLahir.Text = balita.tlBalita.ToShortDateString();
            Alamat.Text = balita.alamatBalita;
            AnakKe.Text = Convert.ToString(balita.anakKe);
            if (Convert.ToString(balita.jnsKelamin) == "L")
                LakiRadioButton.Checked = true;
            else if (Convert.ToString(balita.jnsKelamin) == "P")
                PerempuanRadioButton.Checked = true;
            BBL.Text = Convert.ToString(balita.bbl);
            TBL.Text = Convert.ToString(balita.tbl);

            PkjAyah.Text = ayah.pkjAyah;
            TglLahirAyah.Text = ayah.tlAyah.ToShortDateString();
            AlamatAyah.Text = ayah.alamatAyah;

            PkjIbu.Text = ibu.pkjIbu;
            TglLahirIbu.Text = ibu.tlIbu.ToShortDateString();
            AlamatIbu.Text = ibu.alamatIbu;
        }
コード例 #3
0
        protected void Lihat_Clicked(object sender, EventArgs e)
        {
            BalitasServiceClient proxyBalita = new BalitasServiceClient();
            balita = proxyBalita.GetBalitaByName(Name.Text);
            proxyBalita.Close();

            ImunisasisServiceClient proxyImun = new ImunisasisServiceClient();
            imun = proxyImun.GetImunisasiById(balita.idImunisasi);
            proxyImun.Close();

            if (imun.hbo != DateTime.MinValue)
            {
                HBO.Text = imun.hbo.ToShortDateString();
                HBO.Enabled = false;
                counter++;
            }
            else
                HBO.Enabled = true;

            if (imun.bcg_Polio1 != DateTime.MinValue)
            {
                BCG.Text = imun.bcg_Polio1.ToShortDateString();
                BCG.Enabled = false;
                counter++;
            }
            else
                BCG.Enabled = true;

            if (imun.dptHb1_Polio2 != DateTime.MinValue)
            {
                DPT.Text = imun.dptHb1_Polio2.ToShortDateString();
                DPT.Enabled = false;
                counter++;
            }
            else
                DPT.Enabled = true;

            if (imun.dptHb2_Polio2 != DateTime.MinValue)
            {
                DPT2.Text = imun.dptHb2_Polio2.ToShortDateString();
                DPT2.Enabled = false;
                counter++;
            }
            else
                DPT2.Enabled = true;

            if (imun.dptHb3_Polio4 != DateTime.MinValue)
            {
                DPT3.Text = imun.dptHb3_Polio4.ToShortDateString();
                DPT3.Enabled = false;
                counter++;
            }
            else
                DPT3.Enabled = true;

            if (imun.campak != DateTime.MinValue)
            {
                Campak.Text = imun.campak.ToShortDateString();
                Campak.Enabled = false;
                counter++;
            }
            else
                Campak.Enabled = true;
        }