private void FinishWork(Label lb) { FinishForm ff = new FinishForm(); ff.idghe = lb.Name; if (lb.Text.Contains(":")) { string[] text = lb.Text.Split(':'); ff.time = Convert.ToInt16(text[0]) * 3600 + Convert.ToInt16(text[1]) * 60 + Convert.ToInt16(text[2]); if (ff.ShowDialog() == DialogResult.OK) { load(); loadState(); } } else { ff.time = FileConfig.config.workingtime; if (ff.ShowDialog() == DialogResult.OK) { load(); loadState(); } } }
private void FinishBtn(object sender, EventArgs e) { //Wedding Planning String alamatNikah = weddingAddress.Text; String teleponNikah = weddingPhone.Text; var tanggalNikah = weddingDate.Value; String deskripsiNikah = weddingDescription.Text; //Broombride Data String nomorIDPria = maleCivilID.Text; String namaPria = maleFullName.Text; String tempatLahirPria = maleBornPlace.Text; var tanggalLahirPria = maleBirthDate.Value; ////Broombride Data Lifestyle String alamatPria = maleHomeAddress.Text + ", " + maleCity.Text + ", " + malePostalCode + ", " + maleProvince.Text; String teleponPria = malePhone.Text; String agamaPria = maleReligion.Items[maleReligion.SelectedIndex].ToString(); String kewarganegaraanPria = maleCivil.Items[maleCivil.SelectedIndex].ToString(); String pekerjaanPria = maleWork.Text; //Broombride Parent Data ///Father String nomorIDAyahPria = maleFatherID.Text; String namaAyahPria = maleFatherName.Text; String tempatLahirAyahPria = maleFatherBornPlace.Text; var tanggalLahirAyahPria = maleFatherBirthDate.Value; String kewarganegaraanAyahPria = maleFatherCivil.Items[maleFatherCivil.SelectedIndex].ToString(); String agamaAyahPria = maleFatherReligion.Items[maleFatherReligion.SelectedIndex].ToString(); ///Mother String nomorIDIbuPria = maleMotherID.Text; String namaIbuPria = maleMotherName.Text; String tempatLahirIbuPria = maleMotherBornPlace.Text; var tanggalLahirIbuPria = maleMotherBirthDate.Value; String kewarganegaraanIbuPria = maleMotherCivil.Items[maleMotherCivil.SelectedIndex].ToString(); String agamaIbuPria = maleMotherReligion.SelectedItem.ToString(); //Bride Data String nomorIDWanita = femaleID.Text; String namaWanita = femaleFullName.Text; String tempatLahirWanita = femaleBirthPlace.Text; var tanggalLahirWanita = femaleBirthDate.Value; //Bride Data Lifestyle String alamatWanita = femaleAddress.Text + ", " + femaleCity.Text + ", " + femalePostal + ", " + femaleProvince.Text; String teleponWanita = femalePhone.Text; String agamaWanita = femaleReligion.Items[femaleReligion.SelectedIndex].ToString(); String kewarganegaraanWanita = femaleCivil.Items[femaleCivil.SelectedIndex].ToString(); String pekerjaanWanita = femaleWork.Text; //Bride Parent Data ///Father String nomorIDAyahWanita = femaleFatherID.Text; String namaAyahWanita = femaleFatherName.Text; String tempatLahirAyahWanita = femaleFatherBirthPlace.Text; var tanggalLahirAyahWanita = femaleFatherBirthDate.Value; String kewarganegaraanAyahWanita = femaleFatherCivil.Items[femaleFatherCivil.SelectedIndex].ToString(); String agamaAyahWanita = femaleFatherReligion.Items[femaleFatherReligion.SelectedIndex].ToString(); ///Mother String nomorIDIbuWanita = femaleMotherID.Text; String namaIbuWanita = femaleMotherName.Text; String tempatLahirIbuWanita = femaleMotherBirthPlace.Text; var tanggalLahirIbuWanita = femaleMotherBirthDate.Value; String kewarganegaraanIbuWanita = femaleMotherCivil.Items[femaleMotherCivil.SelectedIndex].ToString(); String agamaIbuWanita = femaleMotherReligion.Items[femaleMotherReligion.SelectedIndex].ToString(); //Saksi ///Saksi Pertama String namaSaksiPertama = firstWitnessName.Text; String alamatSaksiPertama = firstWitnessHome.Text + ", " + firstWitnessCity.Text + ", " + firstWitnessPostal.Text + ", " + firstWitnessProvince.Text; String catatSaksiPertama = greetingFirstWitness.Items[greetingFirstWitness.SelectedIndex].ToString() + " " + firstWitnessNickname.Text; ///Saksi Kedua String namaSaksiKedua = secondWitnessName.Text; String alamatSaksiKedua = secondWitnessHome.Text + ", " + secondWitnessCity.Text + ", " + secondWitnessPostal.Text + ", " + secondWitnessProvince.Text; String catatSaksiKedua = greetingSecondWitness.Items[greetingSecondWitness.SelectedIndex].ToString() + " " + secondWitnessNickname.Text; if (toggleAgree.Value == true) { progress4.Value += 100; c5.Checked = c5.Enabled = true; planning.NikahAddress = alamatNikah; planning.NikahDate = tanggalNikah; planning.NikahPhone = teleponNikah; planning.NikahDescription = deskripsiNikah; planning.PasanganPria = nomorIDPria; planning.PasanganWanita = nomorIDWanita; planning.CatatSaksiSatu = catatSaksiPertama; planning.CatatSaksiDua = catatSaksiKedua; //[1] Data Pengantin Pria brideMale.PriaNIK = nomorIDPria; brideMale.PriaName = namaPria; brideMale.PriaBirthPlace = tempatLahirPria; brideMale.PriaBirthDate = tanggalLahirPria; brideMale.PriaAddress = alamatPria; brideMale.PriaPhone = teleponPria; brideMale.PriaCivil = kewarganegaraanPria; brideMale.PriaReligion = agamaPria; brideMale.PriaWork = pekerjaanPria; /// Data Orang Tuanya brideMale.MaleFatherNIK = nomorIDAyahPria; brideMale.MaleMotheNIK = nomorIDIbuPria; //Data Ayah Pengantin Pria maleFather.PriaFatherNIK = nomorIDAyahPria; maleFather.PriaFatherName = namaAyahPria; maleFather.PriaFatherBirthPlace = tempatLahirAyahPria; maleFather.PriaFatherBirthDate = tanggalLahirAyahPria; maleFather.PriaFatherCivil = kewarganegaraanAyahPria; maleFather.PriaFatherReligion = agamaAyahPria; //Data Ibu Pengantin Pria maleMother.PriaMotherNIK = nomorIDIbuPria; maleMother.PriaMotherName = namaIbuPria; maleMother.PriaMotherBirthPlace = tempatLahirIbuPria; maleMother.PriaMotherBirthDate = tanggalLahirIbuPria; maleMother.PriaMotherCivil = kewarganegaraanIbuPria; maleMother.PriaMotherReligion = agamaIbuPria; //[2] Data Pengantin wanita brideFemale.FemaleNIK = nomorIDWanita; brideFemale.FemaleName = namaWanita; brideFemale.FemaleBirthPlace = tempatLahirWanita; brideFemale.FemaleBirthDate = tanggalLahirWanita; brideFemale.FemaleAddress = alamatWanita; brideFemale.FemalePhone = teleponWanita; brideFemale.FemaleCivil = kewarganegaraanWanita; brideFemale.FemaleReligion = agamaWanita; brideFemale.FemaleWork = pekerjaanWanita; ///Data Orang tuanya brideFemale.FemaleFatherNIK = nomorIDAyahWanita; brideFemale.FemaleMotherNIK = nomorIDIbuWanita; //Data Ayah Pengantin Wanita femaleFather.WanitaFatherNIK = nomorIDAyahWanita; femaleFather.WanitaFatherName = namaAyahWanita; femaleFather.WanitaFatherBirthPlace = tempatLahirAyahWanita; femaleFather.WanitaFatherBirthDate = tanggalLahirAyahWanita; femaleFather.WanitaFatherCivil = kewarganegaraanAyahWanita; femaleFather.WanitaFatherReligion = agamaAyahWanita; //Data Ibu Pengantin Wanita femaleMother.WanitaMotherNIK = nomorIDIbuWanita; femaleMother.WanitaMotherName = namaIbuWanita; femaleMother.WanitaMotherBirthPlace = tempatLahirIbuWanita; femaleMother.WanitaMotherBirthDate = tanggalLahirIbuWanita; femaleMother.WanitaMotherCivil = kewarganegaraanIbuWanita; femaleMother.WanitaMotherReligion = agamaIbuWanita; //[3]Data Saksi saksi.SaksiSatuName = namaSaksiPertama; saksi.SaksiSatuAddress = alamatSaksiPertama; saksi.SaksiDuaName = namaSaksiKedua; saksi.SaksiDuaAddress = alamatSaksiKedua; //Masukkan ke database nikahEntities.Plannings.Add(planning); nikahEntities.BrideMales.Add(brideMale); nikahEntities.BrideFemales.Add(brideFemale); nikahEntities.MaleFathers.Add(maleFather); nikahEntities.MaleMothers.Add(maleMother); nikahEntities.FemaleFathers.Add(femaleFather); nikahEntities.FemaleMothers.Add(femaleMother); nikahEntities.Saksis.Add(saksi); nikahEntities.SaveChanges(); FinishForm finishForm = new FinishForm(); finishForm.ShowDialog(); } }