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; }