コード例 #1
0
        private void btnMH_HastaneyeRaporGonder_Click(object sender, EventArgs e)
        {
            DialogResult sonuc = MessageBox.Show("Rapordaki Meslek Hastalığı bildirim kaydı hastaneye gönderilecektir. Onaylıyor musunuz?", "Dikkat", MessageBoxButtons.YesNo, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button2);

            if (sonuc == DialogResult.Yes)
            {
                HastaneRaporlari hr1 = new HastaneRaporlari();
                hr1.Erkek               = Convert.ToInt32(Erkek_lbl_MH.Text);
                hr1.Kadin               = Convert.ToInt32(Kadin_lbl_MH.Text);
                hr1.Cocuk               = Convert.ToInt32(Cocuk_lbl_MH.Text);
                hr1.Stajer              = Convert.ToInt32(Stajer_lbl_MH.Text);
                hr1.Ozurlu              = Convert.ToInt32(Ozurlu_lbl_MH.Text);
                hr1.Hukumlu             = Convert.ToInt32(Hukumlu_lbl_MH.Text);
                hr1.EskiHukumlu         = Convert.ToInt32(EskiHukumlu_lbl_MH.Text);
                hr1.TerorMagduru        = Convert.ToInt32(TerorMagduru_lbl_MH.Text);
                hr1.Toplam              = Convert.ToInt32(label75.Text);
                hr1.Hastalik            = Convert.ToString(HastalikAdi_lbl_MH.Text);
                hr1.HastalikCozumu      = Convert.ToString(HastalikCozumu_lbl_MH.Text);
                hr1.IzninBasladigiTarih = Convert.ToDateTime(IzninBasladigiTarih_lbl_MH.Text);
                db.HastaneRaporlari.Add(hr1);
                db.SaveChanges();
                MessageBox.Show("Rapor, anlaşmalı hastaneye gönderilmiştir. Teşekkürler!", "Sonuç");
                Erkek_lbl_MH.Text          = ""; Kadin_lbl_MH.Text = ""; Cocuk_lbl_MH.Text = ""; Stajer_lbl_MH.Text = ""; Ozurlu_lbl_MH.Text = "";
                Hukumlu_lbl_MH.Text        = ""; EskiHukumlu_lbl_MH.Text = ""; TerorMagduru_lbl_MH.Text = ""; label75.Text = ""; HastalikAdi_lbl_MH.Text = "";
                HastalikCozumu_lbl_MH.Text = ""; IzninBasladigiTarih_lbl_MH.Text = "";
            }
            else
            {
                MessageBox.Show("Raporun gönderimi onaylanmamıştır.", "Sonuç");
            }
        }
コード例 #2
0
        private void btnIK_HastaneyeRaporGonder_Click(object sender, EventArgs e)
        {
            DialogResult sonuc = MessageBox.Show("Rapordaki İş Kazası bildirim kaydı hastaneye gönderilecektir. Onaylıyor musunuz?", "Dikkat", MessageBoxButtons.YesNo, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button2);

            if (sonuc == DialogResult.Yes)
            {
                HastaneRaporlari hr1 = new HastaneRaporlari();
                hr1.Erkek               = Convert.ToInt32(label26.Text);
                hr1.Kadin               = Convert.ToInt32(label33.Text);
                hr1.Cocuk               = Convert.ToInt32(label19.Text);
                hr1.Stajer              = Convert.ToInt32(label21.Text);
                hr1.Ozurlu              = Convert.ToInt32(label29.Text);
                hr1.Hukumlu             = Convert.ToInt32(label31.Text);
                hr1.EskiHukumlu         = Convert.ToInt32(label18.Text);
                hr1.TerorMagduru        = Convert.ToInt32(label20.Text);
                hr1.Toplam              = Convert.ToInt32(label34.Text);
                hr1.Hastalik            = Convert.ToString(HastalikAdi_lbl.Text);
                hr1.HastalikCozumu      = Convert.ToString(HastalikCozumu_lbl.Text);
                hr1.IzninBasladigiTarih = Convert.ToDateTime(IzninBasladigiTarih_lbl.Text);
                hr1.DinlenmeSuresi      = Convert.ToString(DinlenmeSuresi_lbl.Text);
                db.HastaneRaporlari.Add(hr1);
                db.SaveChanges();
                MessageBox.Show("Rapor, anlaşmalı hastaneye gönderilmiştir. Teşekkürler!", "Sonuç");

                label26.Text  = ""; label19.Text = ""; label33.Text = ""; label21.Text = ""; label29.Text = ""; label31.Text = "";
                label18.Text  = ""; label20.Text = ""; label34.Text = ""; label8.Text = ""; label6.Text = ""; label10.Text = "";
                label11.Text  = ""; label7.Text = ""; label5.Text = ""; HastalikAdi_lbl.Text = ""; HastalikCozumu_lbl.Text = "";
                label132.Text = ""; IzninBasladigiTarih_lbl.Text = ""; DinlenmeSuresi_lbl.Text = "";
            }
            else
            {
                MessageBox.Show("Raporun gönderimi onaylanmamıştır.", "Sonuç");
            }
        }